ffmpeg - Distorted vlc playback with x264 encoded file -


I have captured raw video in RGB format from my webcam, ffmpeg:
  

Ffmpeg - f video4linux2 -s 320x240 -r 10 -i / dev / video0 -f rawvideo \ -pix-fmt rgb24 -r10 webcam. Rgb 24

This raw video file plays fine in mplayer .

I encode this file using encoded x264:

  x264 - Input-ridge 320x240 - crusher dumus --input-fmt rgb24 --fps 10 \ -o webcam.mkv webcam .rgb24   

However, when I try to run webcam.mkv with vlc, then it is an interlaced, distorted image.

I do not know what I'm doing is wrong. After some more research I was able to successfully encode the raw video stream.

Capture command:

  ffmpeg -t 10 -f video4linux2 -s 320x240 -r 10 - I / dev / video0 -f rawvideo \ -pix_fmt yuv420p -r 10 Webcam .UUV 420P   

(webcam.yuv420p file in the input device / Dev / video captured at the frame rate of 10 for 10 secs and captures output at the Yuv420p pixel format) < P> Encoded command:

  x264 - Input-ridge 320x240 - Commander raw --input-fmt yuv420p --fps 10 \ -o webcam.mkv webcam.yuv420p   

Run the command:

  mplayer -vo gl: nomanyfmts webcam.mkv   

(or open with VLC)

Comments