I tried consequentially commands below. On output I'm getting video with a mess (even.mp4).

ffmpeg -i in.MOV -an -vcodec rawvideo -pix_fmt yuv420p rawbitstream.yuv

ffmpeg -r 2 -s 640x480 -i rawbitstream.yuv -vf select="not(mod(n-1\,2))" -c:v rawvideo -r 1 -format rawvideo -pix_fmt yuv420p -an even.yuv

ffmpeg -f rawvideo -vcodec rawvideo -s 640x480 -r 25 -pix_fmt yuv420p -i even.yuv -c:v libx264 -preset ultrafast -qp 0 even.mp4

enter image description here

Here is full log. Video files are here.

  • Share full log of commands
    – Gyan
    Apr 29 '18 at 19:16
  • @Gyan see above.
    – R S
    Apr 29 '18 at 19:30
  • How are you playing the output? Can you share the input?
    – Gyan
    Apr 29 '18 at 19:42
  • @Gyan See the link above. Before I tried to play it with VLC (mess), but it worked in Parole Media Player.
    – R S
    Apr 29 '18 at 21:37
  • So, the issue is with the profile. Do you need lossless?
    – Gyan
    Apr 30 '18 at 5:17


ffmpeg -i in.MOV -an -vcodec rawvideo -pix_fmt yuv420p rawbitstream.yuv

ffmpeg -s 640x480 -i rawbitstream.yuv -vf select="not(mod(n+1\,2))" -c:v rawvideo -vsync 0 -an even.yuv

ffmpeg -f rawvideo -s 640x480 -pix_fmt yuv420p -i even.yuv -c:v libx264 -preset ultrafast -profile:v high -qp 1 even.mp4
  • Thanks a lot. I would like also to understand what is -qp and how it works. Hard to find info about it.
    – R S
    Apr 30 '18 at 19:45
  • 1
    Quantization parameter. It controls how the raw coefficients - the error residuals - are transformed. You need to wade into DSP for the details - see en.wikipedia.org/wiki/Quantization_(image_processing)
    – Gyan
    May 1 '18 at 7:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.