[FFmpeg-user] USB Camera ffplay real-time and save to file

Hans Carlson forbyta at gmx.com
Sat Sep 12 03:25:07 EEST 2020


On Fri, 11 Sep 2020, Carl Eugen Hoyos wrote:

>> Am 11.09.2020 um 21:30 schrieb Hans Carlson <forbyta at gmx.com>:
>>
>> $ ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video2 -map 0:0 -c:v rawvideo -pixel_format yuv422p -f sdl :0
>
> The output option is called -pix_fmt

Thanks, that helped.  This command seems to work...

   $ ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video2 -map 0:0 -c:v rawvideo -pix_fmt yuv420p -f sdl "Inspection Camera"
   (full output below)

but there's a couple warning messages and I'm curious if there's any way 
to avoid them:

   [swscaler @ 0x2b5bb00] deprecated pixel format used, make sure you did set range correctly

I'm assuming this is referring to the input pixel format (yuvj422p).  I have no idea how to do "set range correctly".

   [mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input

This one is rather annoying simply because repeats several times/sec.


   $ ffmpeg -f v4l2 -input_format mjpeg -framerate 30 -video_size 1280x720 -i /dev/video2 -map 0:0 -c:v rawvideo -pix_fmt yuv420p -f sdl "Inspection Camera"
ffmpeg version N-99076-gb0203fa72b Copyright (c) 2000-2020 the FFmpeg developers
   built with gcc 9 (GCC)
   configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-static --disable-shared --disable-debug --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-openssl --enable-libbluray --enable-libcdio --enable-libtesseract
   libavutil      56. 58.100 / 56. 58.100
   libavcodec     58.105.100 / 58.105.100
   libavformat    58. 54.100 / 58. 54.100
   libavdevice    58. 11.101 / 58. 11.101
   libavfilter     7. 87.100 /  7. 87.100
   libswscale      5.  8.100 /  5.  8.100
   libswresample   3.  8.100 /  3.  8.100
   libpostproc    55.  8.100 / 55.  8.100
[mjpeg @ 0x2b2c840] unable to decode APP fields: Invalid data found when processing input
Input #0, video4linux2,v4l2, from '/dev/video2':
   Duration: N/A, start: 2073662.898794, bitrate: N/A
     Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Stream mapping:
   Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input
[swscaler @ 0x2b5bb00] deprecated pixel format used, make sure you did set range correctly
Output #0, sdl,sdl2, to 'Inspection Camera':
   Metadata:
     encoder         : Lavf58.54.100
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720, q=2-31, 331776 kb/s, 30 fps, 30 tbn, 30 tbc
     Metadata:
       encoder         : Lavc58.105.100 rawvideo
[mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input
     Last message repeated 11 times
[mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input
     Last message repeated 11 times
[mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input
     Last message repeated 12 times
[mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input
     Last message repeated 11 times
[mjpeg @ 0x2b2e580] unable to decode APP fields: Invalid data found when processing input
     Last message repeated 1 times
frame=   52 fps= 25 q=-0.0 Lsize=N/A time=00:00:02.16 bitrate=N/A speed=1.02x 
video:70200kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.


More information about the ffmpeg-user mailing list