ffmpeg encoding options to maximise Windows 7 compatibility?

0

1

I'd like to encode a few short (e.g. 30 seconds-ish) video clips with a goal of maximising their out-of-the-box compatibility with Windows 7.

Specifically, what ffmpeg encoding parameters should I use to make the output video work with a completely plain/vanilla installation of Windows 7 SP1? (without installing anything else, no codec packs, no VLC, etc.)

My guess is that H.264 (or MPEG-4?) would work, but even so what other encoding paramaters should I use to maximise the chances of the videos playing without a hitch? What about audio? Thank you.

hpy

Posted 2017-12-01T17:34:25.270

Reputation: 5 269

Answers

4

The basic command below will get you a vanilla MP4

ffmpeg -i in -c:v libx264 -profile:v main -pix_fmt yuv420p -c:a aac -ac 2 -movflags +faststart out.mp4

I would have omitted the profile and the forced stereo channel count (-ac 2) normally, but for pre-emptive compatibility, they are safer to have.

Gyan

Posted 2017-12-01T17:34:25.270

Reputation: 21 016

Thank you @Mulvya! So H.264 is indeed supported... I guess I wouldn't need to consider MPEG-4, then? – hpy – 2017-12-01T18:15:12.260

1@hpy If Mulvya's command works then there is no need to output MPEG-4 Part 2 video (which is what you get if using -c:v mpeg4). – llogan – 2017-12-01T18:41:00.393

1

All codecs and containers listed with Windows Vista or higher should be good: https://msdn.microsoft.com/en-us/library/windows/desktop/dd757927(v=vs.85).aspx

– Gyan – 2017-12-01T18:44:44.300

Thanks @LordNeckbeard and @Mulvya! Understood. That said, out of curiosity, how do I get ffmpeg to encode MPEG-4 v1/v2/v3? – hpy – 2017-12-01T23:41:30.687

1MPEG-4 v1/v2/v3 looks to be idiosyncratic terminology used by Microsoft. AFAICT, they are MS implementations of MPEG-4 Part 2 codec, so -c:v mpeg4 -qscale:v 5 in place of -c:v libx264 -profile:v main – Gyan – 2017-12-02T05:18:18.963

Got it, thanks @Mulvya! I wish there's a table or something that clears this up all this terminology... Oh, and does qscale:v affect compatibility?? – hpy – 2017-12-02T10:59:30.913

1No, it affects quality and thus size. – Gyan – 2017-12-02T12:16:52.760

1@hpy You can encode the Microsoft MPEG-4 Part 2 variants "MPEG v2/v3" with -c:v msmpeg4v2 & -c:v msmpeg4v3. I've never tried them. – llogan – 2017-12-04T01:10:14.860

Thank you @LordNeckbeard!! That's great to know. I just tried it but for some reason my virtual vanilla Windows installation claims it doesn't recognise that format... – hpy – 2017-12-04T15:57:15.837