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
Playback fails sometimes on android (top bit not zero and invalid atom length) #451
Comments
@jakubvojacek It seems like exoplayer is complaining about the first bit in NAL unit type. We'll investigate if it is a packager bug or exoplayer bug or source content problem. |
@jakubvojacek Can you clarify what you mean by "randomly"? I am trying to reproduce the problem but wasn't able to. Do we need to play the content for hours to see it happening? |
@kqyang It happened to me like 3x in five minutes of testing on exoplayer. I was not able to reproduce this with our ios player or dashsj / shaka |
@jakubvojacek Which version of ExoPlayer are you using? |
the colleague responsible for android should wake up in a few hours and share more info but I searched the code and found this
that looks like the exoplayer version. |
@jakubvojacek, that's correct, currently we're using 2.8.2 |
We managed to re-produce the problem, after playing for more than 30 minutes. Will take a closer look at the problem! |
@kqyang, as @jakubvojacek said, it's quite random. Sometimes the playback fails within a few minutes and keeps failing, sometimes it takes longer. Thank you. |
There is indeed a problem in trun box. Here is a list of entries I extracted from a trun box:
Seems like the problem originates from the source stream, where samples are not put in the correct order. @okycelt @jakubvojacek Can you record a few hours of contents and send to shaka-packager-issues@google.com? It will help us find out where the problem is and potentially workaround the problem. Since the problem exists on all resolutions, you can record the lowest resolution. |
@kqyang just sent the email, thank you for your kind assistance 👍 |
@jakubvojacek So there is an indeed a problem in the source stream. In the file you sent to me, packet 13740594 has a pts of 6126057840 (pts1) while the next sample, packet 13740622, has a pts of 6126048840 (pts2), which is < pts1. Neither samples have dts. Per 13818-1 specification, A decoding_timestamp (DTS) shall appear in a PES packet header if the decoding time differs from the presentation time. There are no dts in the above two samples, so packager infers that dts = pts. The duration is calculated from the difference in dts, which results in the negative duration for sample 1 as the next sample has a smaller dts. I wonder how is the source stream produced. It may be a valid stream, just missing dts values. We could workaround the problem by dropping the samples with negative timestamp, but that may result in other problems though during playback. |
@kqyang We will ask the operator to check with their multicast provider. Meanwhile, what other problems are you referring to? Will it result in gaps in the content? Would it be possible to add a warning in the packager output each time a sample like this occurs and drop it? Thank you |
There may be decoding problems if there are other frames depending on the dropped frame. I don't see any playback problems though on the packaged content from your stream in either ExoPlayer or Shaka Player.
There are actually a small overlap instead of a gap because dropping the frame with negative duration results in increase in total duration.
Yes, we will. |
Negative duration is not allowed, so set the duration of that sample to an arbitrary small value in case it is needed to decode future samples. Issue #451. Change-Id: I9250d71d163f769ea2657d56e108b6dbd583de67
@jakubvojacek The workaround has been submitted. We decided not to drop the frame but modifying the duration instead to avoid possible decoding problem. Please try and let us know if it works for you. |
@kqyang we have not experienced the issue since the update, seems like it's working perfectly. Thank you 👍 |
Negative duration is not allowed, so set the duration of that sample to an arbitrary small value in case it is needed to decode future samples. Issue #451. Change-Id: I9250d71d163f769ea2657d56e108b6dbd583de67
Cherry-picked to v2.2.1. |
System info
Operating System: latest debian
Shaka Packager Version: latest master
Issue and steps to reproduce the problem
Packaging live unencrypted content crashes in android exoplayer randomly
Packager Command:
Extra steps to reproduce the problem?
Errors we see in android
Unexpected exception loading stream java.lang.IllegalStateException: Top bit not zero: -6000
ExoPlayerImplInternal: Source error. com.google.android.exoplayer2.ParserException: Skipping atom with length > 2147483647 (unsupported).
Do you think this could be an issue with the shaka packager? I do not really understand what the errors mean but perhaps you could give us a hint whether to look for the issue in the packager or exoplayer.
Thank you
The text was updated successfully, but these errors were encountered: