1

I'm using Ffmpeg to record screen videos in Windows 10:

ffmpeg -rtbufsize 1500M -f gdigrab -framerate 29.97 -draw_mouse 0 -offset_x 2777 -offset_y 344 -video_size 1280x720 -i desktop -c:v libx264 -vf format=yuv420p -preset ultrafast D:/myvideo.mpg

If I play the recorded files in VLC they work fine. If I play them back in a built in Windows Media Player or "Movies & TV" I get this error code: 0xc10100be ERROR_INVALID_MODULETYPE

Are there any settings I need to add to Ffmpeg for use in Windows?

3
  • 1
    Use .mp4 instead of .mpg.
    – llogan
    Jul 20, 2017 at 0:02
  • Sorry I just made an edit. Also changing the file name to mp4, mpg or mpeg doesn't make any difference, get the same error.
    – Geordie
    Jul 20, 2017 at 0:28
  • 1
    Did you simply change the name of the existing file, or did you actually re-run the command with the proper output name (myvideo.mp4)?
    – llogan
    Jul 20, 2017 at 0:44

1 Answer 1

5

Big thanks to @LordNeckbeard. I was forgetting that "mpg" files are not containers like "mp4". Good roundup here.

So part 1 was setting the output file type to ".mp4". This at least stopped the crashes and errors but was still getting black video in Windows players. Part 2 was setting the pixel format to yuv420p. From here:

Encoding for dumb players

You may need to use -vf format=yuv420p (or the alias -pix_fmt yuv420p) for your output to work in QuickTime and most other players. These players only supports the YUV planar color space with 4:2:0 chroma subsampling for H.264 video.

Here's the ffmpeg command that works, I'm sure it needs more optimization:

ffmpeg -rtbufsize 1500M -f gdigrab -framerate 29.97 -draw_mouse 0 -offset_x 2633 -offset_y 103 -video_size 1280x720 -i desktop -pix_fmt yuv420p -c:v libx264  -preset ultrafast D:/myvideo.mp4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .