15

We have an encoding process in place using ffmpeg on Mac OS X. This process will take a source video and a couple files from that: .m3u8 video, .mp4 video and .mp3 audio file.

By default we've used the video from our m3u8 process which is a h264 (via libx264) video with AAC (via libfaac) audio.

We are mostly using these videos on mobile devices (hence the m3u8 files) but we also use the .mp4 files for Android, Windows Phone, etc. More and more we also need to offer these same videos on the web via either a flash player or HTML5 player.

Therefore, we'd like to have the best audio/video codec combo for all these uses ... where I'm confused is to what is "standard" for a .mp4 file?

If the .mp4 uses the mp3 codec then it plays just fine everywhere but QuickTime, in QuickTime the video plays but there is not audio (works just fine in VLC player tho.)

I've been told it's due to how QuickTime uses file extensions to assume information about the video instead of trying to actually get the codec data from the file? This does make some sense, if we encode the same file but use AAC for the audio codec then it works just fine in QuickTime.

So --- what's the "correct" or "ideal" audio/video codec combo --- is it best and safe to use AAC (i.e. will it work on a broad range of devices) even though it's not a "free" codec?

Justin Jenkins
  • 26,590
  • 6
  • 68
  • 1,285

4 Answers4

8

Compatibility issues set aside, you might want to take into account the quality loss induced by transcoding from mp3 to aac. As your original audio is mp3 encoded, you will have a better end result by remuxing the mp3 bitstream instead of transcoding to aac (even if aac is better than mp3 at a given bitrate).

If your workflow requires lowering the bitrate of the original mp3, then my point looses relevance.

audionuma
  • 333
  • 1
  • 9
  • 15
4

AAC is preferred because many modern devices such as tablets and mobile phones might have hardware decoders for it which will result in better battery and lower CPU consumption. Same applies to h264.

In recent years a growing number of devices have added hardware acceleration for the (HEVC) H.265 codec, but that's probably about ~half of the mobile market at best so not yet a default.

ccpizza
  • 28,968
  • 18
  • 162
  • 169
2

http://en.wikipedia.org/wiki/HTML5_video - scroll down for a compatibility table. Seems like either MP3 or AAC work well with H.264

btk
  • 3,158
  • 2
  • 29
  • 30
0

Definitely use the AAC codec, as you said, it works on a wider range of devices and it is better for use in HTML5

Billjk
  • 10,387
  • 23
  • 54
  • 73