[FFmpeg-user] Problems dumping H264 stream from Axis camera
paulj at fastmail.es
paulj at fastmail.es
Sat Aug 25 15:44:53 CEST 2012
> <paulj <at> fastmail.es> writes:
>
> > [paulo <at> webserver ~]$ ffmpeg -rtsp_transport tcp -i rtsp://...
> > -vcodec copy -acodec copy -t 10 -f h264 bla.h264
>
> You don't need -f h264 because .h264 already tells ffmpeg that you
> want a raw H264 stream and -acodec copy has no meaning for -f h264.
> Try with -vbsf h264_mp4toannexb to get a valid h264 file.
>
Nope, doesn't work either (see log below). Of course, I realize this is because I'm
using "-vcodec copy", so it can't apply any filters to the stream, but that's the point: I'd rather
not recompress the video, since what's coming out of the camera is a valid H264 stream
already.
If I remove the "-vcodec copy", then it does work, but I have the impression that, in
that case, it does recompress the video stream. I have a profile set up on the camera to
output a 25fps, 1.2 Mbit video stream, and when I dump it with openRTSP and convert then
with "ffmpeg -vcodec copy", the result is indeed a 25fps, 1.2Mbit. video. If I capture it with
"ffmpeg -vbsf h264_mp4toannexb" and then convert with "ffmpeg -vcodec copy", the
resulting video is much smaller, and it's 30fps.
Is there anything else I can do to help you guys debug this?
[paulo at webserver ~]$ ffmpeg -rtsp_transport tcp -i rtsp://root:root@192.168.1.129:554/axis-
media/media.amp?streamprofile=Quality?tcp -vcodec copy -vbsf h264_mp4toannexb -t 10
axis.mp4
ffmpeg version N-43821-gf92f493 Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 23 2012 12:47:11 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-50)
configuration: --enable-encoder=libx264 --enable-libx264 --enable-runtime-cpudetect --
enable-libmp3lame --enable-gpl
libavutil 51. 70.100 / 51. 70.100
libavcodec 54. 54.100 / 54. 54.100
libavformat 54. 25.104 / 54. 25.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 13.100 / 3. 13.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[rtsp @ 0x9a6b5c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://root:root@192.168.1.129:554/axis-
media/media.amp?streamprofile=Quality?tcp':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.099867, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p, 640x480 [SAR 1:1 DAR 4:3], 30 tbr, 90k
tbn, 180k tbc
Output #0, mp4, to 'axis.mp4':
Metadata:
title : Media Presentation
encoder : Lavf54.25.104
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 640x480 [SAR 1:1 DAR 4:3],
q=2-31, 90k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid
argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid
argument
[mp4 @ 0x9ba2180] pts (0) < dts (1) in stream 0
av_interleaved_write_frame(): Invalid argument
Of [paulo at webserver ~]$ ffmpeg -rtsp_transport tcp -i
rtsp://root:root@192.168.1.129:554/axis-media/media.amp?streamprofile=Quality?tcp -
vcodec copy -vbsf h264_mp4toannexb -t 10 axis.mp4
ffmpeg version N-43821-gf92f493 Copyright (c) 2000-2012 the FFmpeg developers
built on Aug 23 2012 12:47:11 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-50)
configuration: --enable-encoder=libx264 --enable-libx264 --enable-runtime-cpudetect --
enable-libmp3lame --enable-gpl
libavutil 51. 70.100 / 51. 70.100
libavcodec 54. 54.100 / 54. 54.100
libavformat 54. 25.104 / 54. 25.104
libavdevice 54. 2.100 / 54. 2.100
libavfilter 3. 13.100 / 3. 13.100
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[rtsp @ 0x9a6b5c0] Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://root:root@192.168.1.129:554/axis-
media/media.amp?streamprofile=Quality?tcp':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.099867, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p, 640x480 [SAR 1:1 DAR 4:3], 30 tbr, 90k
tbn, 180k tbc
Output #0, mp4, to 'axis.mp4':
Metadata:
title : Media Presentation
encoder : Lavf54.25.104
Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuvj420p, 640x480 [SAR 1:1 DAR 4:3],
q=2-31, 90k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid
argument
Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid
argument
[mp4 @ 0x9ba2180] pts (0) < dts (1) in stream 0
av_interleaved_write_frame(): Invalid argument
Paulo.
-------------------------------------------
"Oh, don't worry kids. Most of you will
never fall in love. You'll just marry
for fear of dying alone."
The Simpsons.
-------------------------------------------
More information about the ffmpeg-user
mailing list