-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Multi-period with presentationTimeOffset can overwrite previous period #1098
Comments
First, It also looks like we aren't handling the |
If you are still having issues after #1099 is fixed, we can reopen this issue and try again. Thanks! |
The fix for #1099 has been pushed to the |
I'll test it and come back with the results. |
Hi! The timescale attribute is already taken into account in the SegmentBase, but frame accuracy is not yet possible, it only jumps from second to second. Also, If the manifest has more than 1 period, the presentationTimeOffset is only taken into account in the first period, playback of the following periods starts in the second 0. This is the mpd file i used for testing. Thanks! |
Without a playable URL to test with, it will be hard to diagnose the problem. You can send it to [email protected] if you can't post it publically. My guess (without being able to look at the content) is that there is a keyframe at 3 seconds. When we set the |
Hi, @TheModMaker , I've tried your guess and it's good. I have generated a file in which all the frames are keyframes and so it is positioned correctly. The playback of the second period still does not take into account the presentationTimeOffset, even with these new files. I've added the regenerated materials and the two manifests I've tested with to the dropbox folder: |
If your goal is to limit what's played by skipping the first, say, 2.1 seconds, you should try the playRangeStart configuration instead of modifying the manifest: https://shaka-player-demo.appspot.com/docs/api/shakaExtern.html#PlayerConfiguration player.configure({
playRangeStart: 2.1
}); Does this help? |
Okay, I think I see what's going on now. We are using presentationTimeOffset in the second Period, but the content is being offset back into the previous Period's time range and overwriting content starting at time 11. Period 1's duration is 13.12, PTO for period 2 is -2.12, so the content starts appearing at 11. |
Hi @joeyparrish thank you! I´ll try with playRangeStart/playRangeEnd and splitting each period in one manifest, not ideal but quite better than transcode :) |
I hope that unblocks you. In the mean time, though, there does seem to be a bug on our side. We should be instructing MediaSource to throw out any content that hangs off the beginning of the Period, and we are not. When I start adding that to our code, I still see some strange behavior, and I'm not sure if it's a Chrome bug or a Shaka bug. Still working to track that down. |
I've put together a non-Shaka demo that shows MediaSource doing the right thing with this keyframe-only content, so any issues I'm having are issues with Shaka Player. |
I've noticed two things that are wrong with your demo content:
I will need to consult with the DASH spec and IOP to understand whether or not the timescales are supposed to match. If so, the content is wrong. If not, the player is wrong. |
The DASH spec says of timescale:
So we should not assume that it matches the timescale of the container. |
With the following changes, I have your all-keyframes content working as I think it is intended:
You can expect fixes for 2 & 3 to be published in the near future. |
According to the DASH spec, the timescale in the manifest need not match the timescale in the media. Therefore, we should be applying scaled presentationTimeOffsets in segment index parsers, since the two scales might differ. Issue #1098 Change-Id: Ic191d1bba399b30a656ab5060d7bb226e659b79a
When shifting content using presentationTimeOffset, especially in combination with SegmentBase and media segment indexes, there can legitimately be segments which are outside the period bounds. Instead of failing an assertion, throw out the unneeded segments. This also drops some largely unnecessary and confusing warnings. Issue #1098 Change-Id: I2addd6d45f1aaf95a1b981cd9373dd24163c13a9
I updated the nightly build with the fixes for this. You can now see a demo of your content here: Is this what you were going for? |
Hi @joeyparrish |
We are always happy to help. It took some time to understand what was happening, but it turned out to be an important bug. So thank you for the report! |
According to the DASH spec, the timescale in the manifest need not match the timescale in the media. Therefore, we should be applying scaled presentationTimeOffsets in segment index parsers, since the two scales might differ. Issue #1098 Change-Id: Ic191d1bba399b30a656ab5060d7bb226e659b79a
When shifting content using presentationTimeOffset, especially in combination with SegmentBase and media segment indexes, there can legitimately be segments which are outside the period bounds. Instead of failing an assertion, throw out the unneeded segments. This also drops some largely unnecessary and confusing warnings. Issue #1098 Change-Id: I2addd6d45f1aaf95a1b981cd9373dd24163c13a9
This avoids having media from one period replaced by media from the next period. Instead, media that comes before the period start will be chopped off by MediaSource. Closes #1098 Change-Id: Idf6dc2ffafe78214e94bc75aca63920e153f1a2c
Fixes cherry-picked to v2.2.6. |
Hi,
Continued with [https://groups.google.com/forum/#!topic/shaka-player-users/2RK662rDMk8]
I didn't try to play it with the master.
I have used the demo application of version 2.2.4 in chrome and firefox
I have a system in which I will receive a series of video files containing a number of black frames at the beginning.
Currently the process to play those files is to transcode them to remove those frames and start playing from 0, but I'd like to skip this step.
So, I tried to use the presentationTimeOffset attribute in the mpd file.
<SegmentBase indexRangeExact="true" indexRange="" presentationTimeOffset="" >
The problem is that I need frame accuracy and it seems that this attribute only has second precision.
I have tried several combinations with this attribute and the timeScale without success. Dash especifications says :
but I get the feeling that this attribute is not being taken into account.
I attach the mpd file I'm testing with.
dash.mpd.txt
I have updated in dropbox the files with which the issue can be played back, and I have added a file in which you can see the expected result (expected_file.mp4) https://www.dropbox.com/sh/zfbynu6n9bxhd9q/AAB4TEvA9g71UADgne0pqwKia?dl=0
What I would like to do is to skip the initial frames (marked with a white counter) and that the playback starts in frame marked with the TC 00:00:00:00 of the file with the green TC, after that, in the second period skip the initial frames again and that the playback starts in frame marked with the TC 00:00:00:00 of the file with the red TC.
Currently if I try to jump 3.12 seconds actually a jump of 4 seconds is made, so for the first period the playback starts at TC 00:00:00:22 instead of 00:00:00:00 and the second period does not jump at all.
If I can change some of the manifest file to make this work, any ideas will be welcome.
Thank you in advance.
TJ
The text was updated successfully, but these errors were encountered: