[FFmpeg-user] FFMpeg: Webcam capture not fast enough. Ffmpeg dies half way (Linux)

Paul B Mahol onemda at gmail.com
Wed Aug 21 23:27:13 CEST 2013


On 8/21/13, Raghu Ram <iamanonymouscoward at gmail.com> wrote:
> Hi Paul,
>
> No Problem. Is there any extra information you need. If it helps, I am
> working on Lenovo Laptop, with Chicony webcam.
>
> Can you please tell me how to change the pixel format?

See output of:

ffmpeg -h demuxer=v4l2

>
> Thanks.
>
> On Wed, Aug 21, 2013 at 2:14 PM, Paul B Mahol <onemda at gmail.com> wrote:
>
>> On 8/21/13, Raghu Ram <iamanonymouscoward at gmail.com> wrote:
>> > Hi All,
>> >
>> > I am trying to capture webcam output through FFMpeg (on linux inside a
>> > virtual machine). here is the detailed question.  The capture is not
>> > proceeding beyond 10 seconds. Can you please help.
>> >
>> > The command I used is:
>> >
>> > $ ffmpeg -y  -f video4linux2 -r 20 -s 160x120 -i /dev/video0 -acodec
>> > libfaac -ab 128k  /tmp/web.avi
>> >
>> > The most important message I am getting is:
>> >
>> > *[video4linux2,v4l2 @ 0x9e43fa0] The v4l2 frame is 46448 bytes, but
>> 153600
>> > bytes are expected*
>> > Information on the google for this error is scarce. I am going nuts
>> > over
>> > this problem. Please help.
>>
>> I have same problem, it appears error appear less frequently if I
>> change pixel format.
>>
>> Sorry for not debuging this more.
>>
>> >
>> > Ps: Also asked at
>> >
>> http://stackoverflow.com/questions/18305086/ffmpeg-webcam-capture-not-fast-enough-ffmpeg-dies-half-way-linux
>> >
>> > *Complete message from ffmpeg:*
>> >
>> > ffmpeg version N-55159-gf118b41 Copyright (c) 2000-2013 the FFmpeg
>> > developers
>> >   built on Aug 18 2013 09:09:13 with gcc 4.6 (Ubuntu/Linaro
>> 4.6.3-1ubuntu5)
>> >   configuration: --enable-libass --prefix=/opt/ffmpeg --enable-debug
>> > --enable-libfreetype
>> >   libavutil      52. 40.100 / 52. 40.100
>> >   libavcodec     55. 19.100 / 55. 19.100
>> >   libavformat    55. 12.102 / 55. 12.102
>> >   libavdevice    55.  3.100 / 55.  3.100
>> >   libavfilter     3. 82.100 /  3. 82.100
>> >   libswscale      2.  4.100 /  2.  4.100
>> >   libswresample   0. 17.103 /  0. 17.103
>> > [video4linux2,v4l2 @ 0x9e43fa0] The V4L2 driver changed the video from
>> > 160x120 to 320x240
>> > [video4linux2,v4l2 @ 0x9e43fa0] The driver changed the time per frame
>> > from 1/20 to 1/15
>> > Input #0, video4linux2,v4l2, from '/dev/video0':
>> >   Duration: N/A, start: 6424.338678, bitrate: 18432 kb/s
>> >     Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422,
>> > 320x240, 18432 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc
>> > Codec AVOption ab (set bitrate (in bits/s)) specified for output file
>> > #0 (/tmp/web.avi) has not been used for any stream. The most likely
>> > reason is either wrong type (e.g. a video option with no video
>> > streams) or that it is a private option of some encoder which was not
>> > actually used for any stream.
>> > Output #0, avi, to '/tmp/web.avi':
>> >   Metadata:
>> >     ISFT            : Lavf55.12.102
>> >     Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 320x240,
>> > q=2-31, 200 kb/s, 20 tbn, 20 tbc
>> > Stream mapping:
>> >   Stream #0:0 -> #0:0 (rawvideo -> mpeg4)
>> > Press [q] to stop, [?] for help
>> > [video4linux2,v4l2 @ 0x9e43fa0] The v4l2 frame is 46448 bytes, but
>> > 153600 bytes are expected
>> > /dev/video0: Invalid data found when processing input
>> > frame=   29 fps= 14 q=3.5 Lsize=      87kB time=00:00:01.45 bitrate=
>> > 490.0kbits/s
>> > video:80kB audio:0kB subtitle:0 global headers:0kB muxing overhead
>> > 7.760075%
>> > [video4linux2,v4l2 @ 0x9e43fa0] Some buffers are still owned by the
>> > caller on close.
>> > _______________________________________________
>> > ffmpeg-user mailing list
>> > ffmpeg-user at ffmpeg.org
>> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> >
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list