On Wed, Jun 24, 2020 at 08:51:37AM +0100, Laurence Tratt wrote:

> External webcams don't seem to work fully correctly with the uvideo driver
> and mjpeg? If I use this command as an example (since it's cross platform):
> 
>   $ ffmpeg -f v4l2 -input_format mjpeg -video_size 1280x720 -framerate 30 \
>     -i /dev/video0 webcam.mkv
> 
> on my X1 Carbon (6th gen), the internal camera produces correct output, but
> an external Logitech C920s produces endless warnings along the lines of:
> 
>   [mjpeg @ 0xe666c20b800] mjpeg_decode_dc: bad vlc: 0:0 (0xe66ec71f248)
>   [mjpeg @ 0xe666c20b800] error dc
>   [mjpeg @ 0xe666c20b800] error y=57 x=9
>   [mjpeg @ 0xe666c20b800] Found EOI before any SOF, ignoring
>   [mjpeg @ 0xe666c20b800] No JPEG data found in image
>   Error while decoding stream #0:0: Invalid data found when processing input
>   [mjpeg @ 0xe666c20b800] Found EOI before any SOF, ignoring
>   [mjpeg @ 0xe666c20b800] No JPEG data found in image
>   Error while decoding stream #0:0: Invalid data found when processing input

It seems this is because the Logitech C920 has been revised (mine has the
USB ID 046d:0892) and no longer supports a separate H264 mode. Instead it
(somehow) embeds H264 data into the mjpeg stream. From what I can gather,
most/all new Logitech webcams use this new Logitech format. This post [1] is
informative. FFmpeg have an issue for this [2] which goes into more detail.
Since my C920 works fine with FFmpeg on Linux, my working guess is that
FFmpeg has implemented an appropriate demuxer for the Logitech format, but
that uvideo chokes on it. If anyone has any suggestions, I'm all ears!


Laurie

[1] https://stackoverflow.com/posts/56403628/revisions
[2] https://trac.ffmpeg.org/ticket/8413

Reply via email to