FORUMS: list search recent posts

Optimal quality/file size ratio for MP4 H264

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Or Martonovitch
Optimal quality/file size ratio for MP4 H264
on Oct 5, 2014 at 8:34:55 am

Hi,

We are building a server side FFMPEG video conversion service for our website.
We are wondering what are the optimal MP4 H264 encoding settings that will result in optimal quality/file size, and a file that will be supported in all browsers and mobile devices.
In terms of profile, bitrate, resolution, etc.
Does someone have recommendations about such optimal settings?
We will greatly appreciate any help.

Thank you,
Or M
Inspire Creative Solutions


Return to posts index

Reuben Martin
Re: Optimal quality/file size ratio for MP4 H264
on Oct 13, 2014 at 4:30:27 am

There is no magic setting that works everywhere.

Different browsers support different combinations of codecs and formats. And even then sometimes a single browser offers different support for different platforms. Mobile devices support different encoding profiles depending on what chip they use to proved hardware accelerated decoding.


Return to posts index

Or Martonovitch
Re: Optimal quality/file size ratio for MP4 H264
on Oct 13, 2014 at 6:35:15 am

Thanks, thats right, but there must be settings which are optimal for all or at least most of the devices.
I am sure big website which serve videos use this kind of settings, Facebook for example.


Return to posts index


Reuben Martin
Re: Optimal quality/file size ratio for MP4 H264
on Oct 14, 2014 at 3:59:33 am

No, most big website offer multiple sources tags within a video tag for different browsers and platforms.

Firefox and Opera for instance will not play mp4 files and only accepts webm and ogg. (Well, until today at least. Firefox 33 released just today now natively supports mp4, thanks to cisco.) Internet Explorer and Safari only support mp4. Chrome has supported all 3 for quite a while.

Mobile devices are even more fragmented. Many devices only support baseline profile, (which kinda sucks) though the newer ones are starting to support main and high profiles. Very few of them have acceleration for decoding webm or ogg. And even then it's highly recommended to use something like HLS that serves the video in chunked format so that it doesn't waste mobile bandwidth.

So, if you want a "single encode" that has the most broad support you can try the following:

ffmpeg -i <input_file> -c:v libx264 -crf 20 -g 45 -profile:v baseline -pix_fmt yuv420p -c:a libfdk_aac -vbr 3 -f mp4 -movflags faststart <output_file>


Return to posts index

Or Martonovitch
Re: Optimal quality/file size ratio for MP4 H264
on Oct 14, 2014 at 6:33:13 am

Great information, very helpful, thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]