-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convenience methods? #9
Comments
Sounds great!
Think I can make some quick additions for the first two; for the second two I'd be happy to add helpers, but can't commit to researching the proper implementations right now. |
I hope 44ebdff addresses the second item in the list (but feel free to propose adjustments). |
Thank you!
That'd be awesome, thank you! (On the subject of other codecs and crates: do you have any plans for H.265? no pressure.)
Thanks! I'll start looking into the second two then. I'm already having second thoughts about bitrate. It looks like unfortunately even defining an interface for it is a bit of a mess because there's not just one result: First, there's multiple CPBs. I'm not quite sure why yet; maybe because of scalable video coding. Then there's VUI vs NAL. I haven't found an explanation in the spec itself yet, but I found this snippet on someone's website:
Of course it's optional to specify HRD parameters. There's also a max allowable one defined by the level and profile. One of the CPBs has to be within that max (see A.3.1.i). |
Here's the initial sketch of codec support. My thinking is that with a dependency on this new crate, we can then extend the Sps type like,
so to get the string you want it should be |
I understand that a lot of the infrastructure like NALU syntax is the same, so yeah I'd like to make it easy to either support H.265 in this crate, maybe renamed ( I've not really got any h265 material passing through my hands at the moment to motivate work on that, but hopefully that'll change at some point! I raised #10 to track that thought. |
I notice the Chromium codebase takes care to avoid integer overflow in the equivalent spot. Sorry for the churn, but |
I'm making progress on my pure-Rust RTSP client so taking a fresh look at this stuff.
|
Regarding |
Any existing crate/type you had in mind? I assume it doesn't make sense to define a type local to h264-reader since it wouldn't interoperate with any existing MP4 writer. |
I'm not aware of anything. I was thinking of just being able to get the raw bytes as a
This is the kind of stuff that I'd imagined the btw, I'm also working on stuff for (de)muxing codecs from RTP packets to access units, which in theory might make more sense in your fwiw, my (very much a work in progress) crate produces the |
What are your feelings on additional convenience methods / methods that interpret the raw fields? I find the H.264 spec rather dense and want to get a few "simple" things without studying it in detail. I imagine other folks will be in the same boat.
Here are some I'd like to have and why I think it's better for the crate to compute them than for callers to do so (badly):
rfc6381_codec
. I see that yourlowly
crate calculates this here this. Mymoonfire-nvr
calculates it here. Seems a little obscure/annoying.SeqParameterSet::pixel_dimensions()
Looks like it's specified in terms of macroblocks and map units. I'm unsure if you're supposed to apply cropping parameters to support frames that aren't a multiple of those things.TimingInfo
: max frame rate (or maybe min time scale units per frame?) I'd have expected this to be super straightforward but I got confused about mentions of interlaced video and frame doubling/tripling, references to a variety of equations with abbreviated names, etc.The text was updated successfully, but these errors were encountered: