[FFmpeg-user] ffmpeg stream copy does NOT set AV_PKT_FLAG_KEY when input_format h264

Soho Soho123 soho123.2012 at gmail.com
Tue Mar 26 02:57:04 CET 2013


Hi,

Do you have idea about:
Why ffmpeg does not set AV_PKT_FLAG_KEY when h264 stream copy?
Does ffmpeg parse video data that get from webcam when DQBuffer?
when input_format is YUV, ffmpeg will set AV_PKT_FLAG_KEY,
It is confused why input format is h264 will not.

2013/3/25 Soho Soho123 <soho123.2012 at gmail.com>:
>> Then please provide the complete, uncut console output
>> for the following command so I have at least a chance
>> to help you:
>> $ ffmpeg -f video4linux2 -r 10 -s 640x480 -input_format h264
>> -i /dev/video1 -vcodec copy out.h264
>
> It seems the output file format is NOT key issue,
> do you have any ideas?
>
> the log of the commandline you mentioned:
>
> # ffserver -f /etc/ffserver.conf &
> # ffserver version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
>   built on Mar 21 2013 14:21:02 with gcc 4.4.5-1.5.5p4 (GCC)
>   configuration: --enable-cross-compile --cross-prefix=sdk-linux-
> --arch=mips --target-os=linux --disable
> -doc --disable-htmlpages --disable-manpages --disable-podpages
> --disable-txtpages --disable-mips32r2 --dis
> able-ffplay --disable-postproc --disable-runtime-cpudetect
> --disable-swscale-alpha --disable-mipsdspr1 --d
> isable-mipsdspr2 --disable-mipsfpu --enable-small
> --prefix=/ffmpeg/romfs --bindir=/ffmpeg/romfs --disable-bsfs
> --disable-filters --enable-gpl --enable-libx264 --extra-c
> flags=-I/lib/crosslib/include --extra-libs='-L/lib/crosslib/lib
> -lx264' --enable-filter='aformat,aresample
> ,copy,format,fps,framestep,resample' --disable-encoders
> --enable-encoder='h264,libx264,libx264rgb' --enabl
> e-encoder=yuv4 --enable-encoder=mjpeg --disable-decoders
> --enable-decoder=mjpeg --enable-decoder=h264 --en
> able-decoder=mpegvideo --enable-decoder=mpeg2video --enable-decoder=y
> libavutil      52. 18.100 / 52. 18.
> 100
>   libavcodec     54. 92.100 / 54. 92.100
>   libavformat    54. 63.104 / 54. 63.104
>   libavdevice    54.  3.103 / 54.  3.103
>   libavfilter     3. 42.103 /  3. 42.103
>   libswscale      2.  2.100 /  2.  2.100
>   libswresample   0. 17.102 /  0. 17.102
> Mon Mar 25 10:39:46 2013 FFserver started.
> #
> #
> #
> #
> # ffmpeg  -loglevel debug -f video4linux2 -r 10 -s 640x480 -input_format h264 -i
>  /dev/video1 -vcodec copy /var/tmp/out.h264
> ffmpeg version 1.2 Copyright (c) 2000-2013 the FFmpeg developers
>   built on Mar 21 2013 14:21:02 with gcc 4.4.5-1.5.5p4 (GCC)
>   configuration: --enable-cross-compile --cross-prefix=sdk-linux-
> --arch=mips --target-os=linux --disable
> -doc --disable-htmlpages --disable-manpages --disable-podpages
> --disable-txtpages --disable-mips32r2 --dis
> able-ffplay --disable-postproc --disable-runtime-cpudetect
> --disable-swscale-aSetting frame interval to 1/
> 10 (1000000).
> lUsing frame interval 100000.0 us (10.0 fps).
> pha --disable-mipsdspr1 --disable-mipsdspr2 --disable-mipsfpu
> --enable-small --prefix=/ffmpeg/romfs --bindir=/ffmpeg/romfs
> --disable-bsfs --disable-filters --enable-gpl
>  --enable-libx264 --extra-cflags=-I/lib/crosslib/include
> --extra-libs='-L/lib/crosslib/lib -lx264' --enabl
> e-filter='aformat,aresample,copy,format,fps,framestep,resample'
> --disable-encoders --enable-encoder='h264,
> libx264,libx264rgb' --enable-encoder=yuv4 --enable-encoder=mjpeg
> --disable-decoders --enable-decoder=mjpeg
>  --enable-decoder=h264 --enable-decoder=mpegvideo
> --enable-decoder=mpeg2video --enable-decoder=y  libavuti
> l      52. 18.100 / 52. 18.100
>   libavcodec     54. 92.100 / 54. 92.100
>   libavformat    54. 63.104 / 54. 63.104
>   libavdevice    54.  3.103 / 54.  3.103
>   libavfilter     3. 42.103 /  3. 42.103
>   libswscale      2.  2.100 /  2.  2.100
>   libswresample   0. 17.102 /  0. 17.102
> Splitting the commandline.
> Reading option '-loglevel' ... matched as option 'loglevel' (set
> libav* logging level) with argument 'debug'.
> Reading option '-f' ... matched as option 'f' (force format) with
> argument 'video4linux2'.
> Reading option '-r' ... matched as option 'r' (set frame rate (Hz
> value, fraction or abbreviation)) with argument '10'.
> Reading option '-s' ... matched as option 's' (set frame size (WxH or
> abbreviation)) with argument '640x480'.
> Reading option '-input_format' ... matched as AVOption 'input_format'
> with argument 'h264'.
> Reading option '-i' ... matched as input file with argument '/dev/video1'.
> Reading option '-vcodec' ... matched as option 'vcodec' (force video
> codec ('copy' to copy stream)) with argument 'copy'.
> Reading option '/var/tmp/out.h264' ... matched as output file.
> Finished splitting the commandline.
> Parsing a group of options: global .
> Applying option loglevel (set libav* logging level) with argument debug.
> Successfully parsed a group of options.
> Parsing a group of options: input file /dev/video1.
> Applying option f (force format) with argument video4linux2.
> Applying option r (set frame rate (Hz value, fraction or
> abbreviation)) with argument 10.
> Applying option s (set frame size (WxH or abbreviation)) with argument 640x480.
> Successfully parsed a group of options.
> Opening an input file: /dev/video1.
> [video4linux2,v4l2 @ 0x69e660] fd:3 capabilities:4000001
> [video4linux2,v4l2 @ 0x69e660] Selecting input_channel: 0
> [video4linux2,v4l2 @ 0x69e660] input_channel: 0, input_name: Camera 1
> [video4linux2,v4l2 @ 0x69e660] Setting time per frame to 1/10
> [video4linux2,v4l2 @ 0x69e660] End of v4l2_read_header
> [h264 @ 0x69f190] Using externally provided dimensions
> [video4linux2,v4l2 @ 0x69e660] All info found
> [video4linux2,v4l2 @ 0x69e660] Estimating duration from bitrate, this
> may be inaccurate
> Input #0, video4linux2,v4l2, from '/dev/video1':
>   Duration: N/A, start: 71.100000, bitrate: N/A
>     Stream #0:0, 8, 1/1000000: Video: h264, yuv420p, 640x480,
> 1/2000000, -1 kb/s, 10 fps, 10 tbr, 1000k tb
> n, 2000k tbc
> Successfully opened the file.
> Parsing a group of options: output file /var/tmp/out.h264.
> Applying option vcodec (force video codec ('copy' to copy stream))
> with argument copy.
> Successfully parsed a group of options.
> Opening an output file: /var/tmp/out.h264.
> Successfully opened the file.
> Output #0, h264, to '/var/tmp/out.h264':
>   Metadata:
>     encoder         : Lavf54.63.104
>     Stream #0:0, 0, 1/90000: Video: h264, yuv420p, 640x480, 1/1000000,
> q=2-31, -1 kb/s, 10 fps, 90k tbn, 1
> 000k tbc
> Stream mapping:
>   Stream #0:0 -> #0:0 (copy)
> Press [q] to stop, [?] for help
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A
> frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A
> video:0kB audio:0kB subtitle:0 global headers:0kB muxing overhead nan%
> Output file is empty, nothing was encoded (check -ss / -t / -frames
> parameters if used)
> # ls /var/tmp -al
> drwxr-xr-x    3 root     root            0 Mar 25 10:40 .
> drwxr-xr-x   20 root     root            0 Mar 25 10:39 ..
> -rw-r--r--    1 root     root         4096 Mar 25 10:39 feed1.ffm
> -rw-r--r--    1 root     root            0 Mar 25 10:40 out.h264
> #


More information about the ffmpeg-user mailing list