#7109: Use segment or audio samples duration in case of single sample video chunk#7112
#7109: Use segment or audio samples duration in case of single sample video chunk#7112mstyura wants to merge 1 commit intovideo-dev:masterfrom
Conversation
…le sample video chunk.
| const audioLengthBasedSampleDuration = audioTrackLength | ||
| ? Math.round(audioTrackLength * track.inputTimeScale) | ||
| : track.inputTimeScale; | ||
| const fragmentLengthOrAudioLengthBasedSampleDuration = fragmentDuration |
There was a problem hiding this comment.
It would be incorrect to use fragment duration in the case where an LL-HLS part is being processed, or a partial segment is being processed (with progressive: true config option).
We'll need to test this against a variety of media with and without that config to confirm it is safe.
This makes sense to include in v1.7 which will focus on I-frame support since that will involve supporting single sample video segments that ideally span full segment durations.
There was a problem hiding this comment.
It would be incorrect to use fragment duration in the case where an LL-HLS part is being processed, or a partial segment is being processed (with progressive: true config option).
I agree, I've tried to "workaround" this by not passing duration of incomplete chunks, but not sure all the cases handled correctly. For some reason I assumed it is not that important because I thought LLHLS is defined only over mp4 chunks, but right now I can't find this in latest rfc.
This makes sense to include in v1.7 which will focus on I-frame support since that will involve supporting single sample video segments that ideally span full segment durations.
I have nothing against this decision, the PR is just an example of solving the issue for the example stream. I hope during development of version 1.7 more robust solution will be considered and hopefully implemented.
|
Closing as #4783 was fixed - the last segment is one frame or video sample in length. The part of these changes that align video duration with audio is doing is already handled by setting |
This PR will...
Change the computation of duration of MP4 video sample when transmuxed from MPEG-TS fragment with single video sample. The duration of segment reported via
#EXTINFtag will be used as duration of single video sample or if this duration now available - the length of audio samples will be used.Why is this Pull Request needed?
Currently playback of HLS streams with TS fragments stuck in case of fragment has single video sample.
Are there any points in the code the reviewer needs to double check?
The issue has been encountered before and reported as #4783 and supposedly fixed by #4794.
It also seems like this is kind of corner case for TS -> MP4 transmuxing which also encountered in Shaka Player.
Resolves issues:
#7109
Checklist
PS: This is probably just one approach to resolve problem and it might be not fully correct. The feedback from maintainers much appreciated.