0

I have been trying for hours to record my USB webcam to a .mp4 file format. The only format that works is .avi right now. I am on a RPi using video4linux2.

This code does not work:

ffmpeg -f video4linux2 -framerate 30 -s 1280x720 -i /dev/video0 /home/pi/videos/output.mp4

When opening the file, it gives me an error in my video player. I also tried adding "-f mp4" but that does not work either. Please help. Thanks!

  • Add `-vf format=yuv420p` output option: `ffmpeg -f video4linux2 -framerate 30 -video_size 1280x720 -i /dev/video0 -vf format=yuv420p /home/pi/videos/output.mp4` – llogan Sep 16 '20 at 21:39
  • Still getting a corrupt file error in VLC. Any other suggestions? – Todd Murphy Sep 17 '20 at 00:16
  • What is the exact error? Also show your ffmpeg command and the complete log. – llogan Sep 17 '20 at 01:43

0 Answers0