webrtc
webrtc copied to clipboard
IVF writer writing invalid timestamp value into frame headers?
Hey maintainers, thank you for this awesome work.
While working a little bit with some VP8-based streams, I have noticed something interesting related to IVF writers. Is it possible that the value written for the IVF frame timestamp is incorrect?
- what's being written is a sequence number: https://github.com/pion/webrtc/blob/master/pkg/media/ivfwriter/ivfwriter.go#L112
- the reader correctly expects it to be a timestamp: https://github.com/pion/webrtc/blob/master/pkg/media/ivfreader/ivfreader.go#L97,
And, of course, Duck IVF says that 8 bytes at offset 4 are 64-bit presentation timestamp: https://wiki.multimedia.cx/index.php/Duck_IVF.
Shouldn't the writer write the RTP header timestamp value into the IVF frame header?
I would propose the following:
- https://github.com/radekg/boos/pull/3/files#diff-652bfa3efcbaa4c9f2876f1b72e4c566f6539428d6ac738050aa074370b192f1R112-R123
with the following call-site changes:
- https://github.com/radekg/boos/pull/3/files#diff-652bfa3efcbaa4c9f2876f1b72e4c566f6539428d6ac738050aa074370b192f1R156
- https://github.com/radekg/boos/pull/3/files#diff-652bfa3efcbaa4c9f2876f1b72e4c566f6539428d6ac738050aa074370b192f1R172
With these changes, I can handle variable stream framerate when reading frames.
I can provide a PR, if this change is acceptable.
Your environment.
- Version: Release or SHA
- Browser: include version
- Other Information - stacktraces, related issues, suggestions how to fix, links for us to have context
What did you do?
What did you expect?
What happened?
Hi @radekg
Are you still interested in doing this! Anything we can do to improve the timing handling with IVF would be greatly appreciated. I haven't looked into it lately, but is a common complaint.
Sure, sorry for the delay, I'm not often on my private github recently but I can follow up on this.
Any updates on this issue? @Sean-Der. In my case, IVF writer produces a video file with invalid duration
For example I stream 30-second video, audio track has valid duration, while video track lasts for only 15 seconds
Hey @Sean-Der, I have opened a pull request.