]> git.sesse.net Git - ffmpeg/commit
lavd/v4l2: produce a 0 byte packet when a dequeued buffer's size is unexpected
authorStephan Hilb <stephan@ecshi.net>
Wed, 5 Jun 2019 20:04:38 +0000 (22:04 +0200)
committerAlexander Strasser <eclipse7@gmx.net>
Tue, 30 Jul 2019 10:05:52 +0000 (12:05 +0200)
commitb761ae072a169eb183abe0785a258b9787e267d3
treea94a86b6a711d4b9cdae89338d156bf029952133
parentb3b7523feb5acbe1a3376104616fca389e1aaeca
lavd/v4l2: produce a 0 byte packet when a dequeued buffer's size is unexpected

Behave like we do for V4L2_BUF_FLAG_ERROR, implemented in commit 28f20d2ff4 .

For some devices (probably also related to the V4L driver implementation)
it happens that when invoking the ioctl DQBUF, the returned buffer is not
of the expected size. Here are two examples for such occurrences:

    [video4linux2,v4l2 @ 0x258b440] Dequeued v4l2 buffer contains 609596 bytes, but 614400 were expected. Flags: 0x00000001.
    /dev/video1: Invalid data found when processing input

    [video4linux2,v4l2 @ 0x225f440] Dequeued v4l2 buffer contains 609508 bytes, but 614400 were expected. Flags: 0x00000001.
    /dev/video1: Invalid data found when processing input

For the ffmpeg CLI tool this means it will stop capturing and exit.

The described behaviour was observed at least with one OmniVision USB
web cam and with some stk1160 devices.

If you search the web for the error message, you will find quite a few
instances of this problem. Some of them experienced on other devices.

Probably fixes ticket #4795

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
libavdevice/v4l2.c