Vanilagy / mp4-muxer

MP4 multiplexer in pure TypeScript with support for WebCodecs API, video & audio.
https://vanilagy.github.io/mp4-muxer/demo
MIT License
419 stars 32 forks source link

Incorrect video codec value saved (possibly...) ? #38

Closed Pensarfeo closed 8 months ago

Pensarfeo commented 8 months ago

Hi, Thanks for the great software.

I am creating my videos using your demo example code and the following codec string avc1.42403e. However when I try to ready the file, using mp4box, I get the following codec string avc1.420320, but I can read the file only if I use the value avc1.42403e. I am not sure if the issue is with your package or with mp4box, or my general lack of understanding regarding this topic :)

Thanks Pedro

Pensarfeo commented 8 months ago

This is an example of the output.

https://github.com/Vanilagy/mp4-muxer/assets/14980193/bdfe473b-0bc6-43ca-806e-9bfd7026bbe2

Vanilagy commented 8 months ago

Hi! This might be related to this, older issue: https://github.com/Vanilagy/mp4-muxer/issues/3

I don't think mp4-muxer is at fault for this. mp4-muxer doesn't even know exactly what codec you're using, since you're never telling it. The codec and decoder specifics are provided by the VideoEncoder which mp4-muxer just stores. Check out the issue, the quote by the Chromium dev may help. Is the file not readable with codec avc1.420320? Maybe try avc1.640034 and see if you can read that.

Pensarfeo commented 8 months ago

@Vanilagy thanks for the feedback. avc1.420320 is just the wrong codec so I just can't play the file.

Today I implemented the same functionality using mp4box.js and I found the same problem. I have the feeling is a browser issue. Thanks again for the help!

Vanilagy commented 8 months ago

Hope you can get it to work. The video generated by the demo works for you, tho?

Pensarfeo commented 8 months ago

Yes, if i use the correct codec value or if I play it on some other player it works!