nickdesaulniers / netfix

Let's build a Netflix
http://nickdesaulniers.github.io/netfix
172 stars 129 forks source link

How can I encode a video to match the MIME codec in this example? #2

Closed jimkang closed 8 years ago

jimkang commented 8 years ago

Hi, I am really glad this example is around!

However, I'm having trouble getting videos other than frag_bunny.mp4 to play. I fragment my video like so:

mp4fragment --verbosity 3 ecm-presenter-640x360.mp4 ecm-presenter-bento.mp4

And when I check it out with Bento's mp4dump, it looks OK. However, when I get the codec string from mp4info, I end up with a MIME codec like this:

video/mp4; codecs="avc1.42C01E, mp4a.40.2"

While the one in the example is:

video/mp4; codecs="avc1.42E01E, mp4a.40.2"

I'd think that would be OK as long as I updated it in the code, but on Firefox, MediaSource.isTypeSupported says that it is not supported. On Chrome, it says it does, but then it crashes the renderer process when it tries to play. (The frag_bunny.mp4 does play on Chrome.)

It looks like that bit field (C0 in frag_bunny.mp4 and E0 in my video) is profile compatibility. The thing is, I have no idea how to encode either in Bento or ffmpeg in such a way that that value is set to C0. I was hoping you might.

jimkang commented 8 years ago

Hey, it turns out that profile compatibility is OK in Chrome (must've been something else wrong with that particular video) and can play. Also in Firefox Developer Edition!

apachisundari commented 8 years ago

Hey Jim could you guide me while I root my nexus 7 device?