沒有這樣的輸入格式:MJPEG

沒有這樣的輸入格式:MJPEG

我想將相機像素格式從 YUYV 轉換為 MJPEG。我嘗試使用v4l-utils,但是當我在終端機中使用此命令時:

ffmpeg -f video4linux2 -pixel_format MJPEG -i /dev/video0

但是當我得到這個:

ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
  configuration: 
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
[video4linux2,v4l2 @ 0x1aa4380] No such input format: MJPEG.
/dev/video0: Invalid argument

那麼出了什麼問題,我該做什麼來解決它呢?

答案1

而不是像下面這樣-pixel_format使用-vcodec

ffmpeg -f video4linux2 -vcodec MJPEG -i /dev/video0

相關內容