ralfbiedert / openh264-rs

Idiomatic Rust wrappers around OpenH264.
69 stars 35 forks source link

Add integration with mp4 crate #30

Closed DCNick3 closed 1 year ago

DCNick3 commented 1 year ago

This adds an Mp4BitstreamConverter helper struct that converts bitstream from mp4 to what openh264 expects.

It also adds an end-to-end mp4 decoding test and an example

DCNick3 commented 1 year ago

Note that this removes to_bitstream_with_001_* functions, requiring a major release

ralfbiedert commented 1 year ago

Both mp4 and openh264 are relatively young libraries. The issue I see is that inevitably we'd depend on and re-export parts of an older or younger mp4 interface compared to what people use in their projects, which in turn causes compatibility and compilation problems.

Also, there are other container format libraries, and I don't think we could maintain glue code for any significant number of them.

Instead, wouldn't it make sense to add the code in here under examples/ instead? That way there would be no compatibility issues, and we could easily get away with not updating it in a while, while still providing compiling samples of how things work(ed) today? People would have to copy-paste some code, but I'm not sure that that's such a bad thing.

DCNick3 commented 1 year ago

Well.. That's probably fair, following a changing API is quite painful...

I'll move the bitstream converter to the examples

ralfbiedert commented 1 year ago

Thanks! One last thing, could you LFS the mp4 file?

DCNick3 commented 1 year ago

The CI failure seems to be due to some temporary issues with crates.io CDN. I can't restart it though

ralfbiedert commented 1 year ago

Thanks a lot!