metalx1000

MPV v4l2 webcam display

Mar 21st, 2021
2,230
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #using Webcam with MPV
  2. sudo apt install mpv v4l2loopback-utils
  3.  
  4. #play video stream
  5. mpv /dev/video0
  6. mpv av://v4l2:/dev/video0
  7.  
  8. #set resolution
  9. v4l2-ctl --set-fmt-video=width=1920,height=1080
  10. v4l2-ctl --set-fmt-video=width=720,height=480
  11.  
  12. #the video will only use resolutions that are supported by your camera
  13. #if you put something not supported it will go to the closest supported
  14. #and you can also just give one of the dimensions (exmaple: height)
  15. #and it will get the width
  16. v4l2-ctl --set-fmt-video=width=720
  17. v4l2-ctl --set-fmt-video=width=200
RAW Paste Data