Closed oleksandr-yefremov closed 5 years ago
My understanding was decoderInputFormatChanged and videoSizeChanged should be pairwise, except for the cases when decoder remains the same and video surface size changes (e.g. rotated). Is that correct?
That's mostly the case, but not necessarily. For your case it looks as if the stream with id=livestream_video_04/cenc actually changes its size within the stream itself. That is, the decoded output samples are having different sizes. So even though the declared input format is still the same and ExoPlayer's track selection didn't change its decision, the output video size may change. If that is indeed the issue, it's probably an encoding issue that needs to be solved on the server.
That sounds improbable because same DASH source is played on any desktop player without issues. Where can I start digging more?
If at all possible, please provide us with an example stream sent to dev.exoplayer@gmail.com so that we can take a look.
Ok, thanks for quick reply! I will check with our backend team to find out more about actual encoding. If we won't find anything suspicious or we prove that other players handle same input differently, I will try to prepare a sample livestream (probably with a temporary token) and send it to the email above. Thanks again!
Thanks for the provided information. I was able to reproduce the problem and can see what is happening now.
The manifest updates change the order of the representations in the adaptation set. ExoPlayer assumes that the representations stay in the same order which is also what the DASH-IF interoperability guidelines will suggest in the next version (see here). We keep playing whatever is the i th position in the list, that's why the changing formats.
One example for a manifest update I've seen in the test stream:
<AdaptationSet group="2" contentType="video" /* ... */ >
<Representation id="video_04/cenc" bandwidth="3891200" width="1280" height="720" codecs="avc1.4D4020" scanType="progressive"/>
<Representation id="video_05/cenc" bandwidth="4710400" width="1920" height="1080" codecs="avc1.4D402A" scanType="progressive"/>
<Representation id="video_02/cenc" bandwidth="1331200" width="768" height="432" codecs="avc1.4D4020" scanType="progressive"/>
<Representation id="video_01/cenc" bandwidth="573440" width="640" height="360" codecs="avc1.4D401F" scanType="progressive"/>
<Representation id="video_03/cenc" bandwidth="2826240" width="1024" height="576" codecs="avc1.4D4020" scanType="progressive"/>
</AdaptationSet>
<AdaptationSet group="2" contentType="video" /* ... */ >
<Representation id="video_02/cenc" bandwidth="1331200" width="768" height="432" codecs="avc1.4D4020" scanType="progressive"/>
<Representation id="video_01/cenc" bandwidth="573440" width="640" height="360" codecs="avc1.4D401F" scanType="progressive"/>
<Representation id="video_04/cenc" bandwidth="3891200" width="1280" height="720" codecs="avc1.4D4020" scanType="progressive"/>
<Representation id="video_03/cenc" bandwidth="2826240" width="1024" height="576" codecs="avc1.4D4020" scanType="progressive"/>
<Representation id="video_05/cenc" bandwidth="4710400" width="1920" height="1080" codecs="avc1.4D402A" scanType="progressive"/>
</AdaptationSet>
Would it be possible to ensure that the order of representations stays the same for all updates?
which is also what the DASH-IF interoperability guidelines will suggest
IIRC it's going to be mandatory for DASH-IF interoperability, not just a suggestion.
Ahh, now it all makes sense! I had a feeling that it could be related to manifest updates, but did not check whether current track is determined by index or by id. Looks like Bitmovin and Shaka use id and that's why there is no issue. Yes, we will make sure that order of tracks is maintained across updates, especially if that will be mandatory in future. Thank you for support! I'm closing the ticket.
[REQUIRED] Searched documentation and issues
Looked through samples, javadocs for the mentioned methods, issues on github (opened and closed) and dev guide.
[REQUIRED] Question
Situation: when playing DASH livestreams and VoDs quality changes very frequently (every 6-20 seconds, network is Wifi around 100Mbps, bandwidth is stable). According to this comment and my previous observations
onDecoderInputFormatChanged
should be called whenever track changes adaptively (i.e. if there are multiple tracks within the manifest, the current track switches to accomodate the bandwidth). What we see is there is oneonDecoderInputFormatChanged
callback and manyonVideoSizeChanged
with the resolution of one of the available tracks. I put our DRM'ed livestream into ExoPlayer demo app to exclude any differences in setting up the player. I see the same behaviour even if I disable adaptivity by passing params toDefaultTrackSelector.ParametersBuilder().setForceHighestSupportedBitrate(true).build();
in code or from ExoPlayer demo app (go to "Video" menu and select any single track manully).Short version of log. Longer version is attached as file.
outputIndex - ExoPlayer 2.9.4.txt videoSizeChanged - ExoPlayer 2.5.0.txt videoSizeChanged - ExoPlayer 2.9.4.txt
Questions:
decoderInputFormatChanged
andvideoSizeChanged
should be pairwise, except for the cases when decoder remains the same and video surface size changes (e.g. rotated). Is that correct?videoSizeChanged
callback todrainOutputBuffer
andoutputIndex == MediaCodec.INFO_OUTPUT_FORMAT_CHANGED
. Tried looking further into Android's MediaCodec, but did not understand exactly what could be the reason for output format to change within a single track. Does this mean the actual segments are different? That sounds improbable because same DASH source is played on any desktop player without issues. Where can I start digging more?Appreciate any hints or help.