google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.7k stars 6.01k forks source link

Handle format changes in Ogg Vorbis streams #8436

Open ChernyshovYuriy opened 3 years ago

ChernyshovYuriy commented 3 years ago

Dear developers, There are some streams that has into jingle and the main stream. It turned out bitrates of these two streams are not the same and it noticeable when the main stream started to play after the jingle. Example URL is https://tcpower.eu:8443/getradio I tested on ExoPlayer, no need additional set up, just to feed this stream to it. I wouldn't bother with question if VLC, for instance, couldn't handle this bitrate transition. I am wondering, is this something ExoPlayer can improve? Or should originator of stream fix the issue on server side?

Regards,

Yurii

andrewlewis commented 3 years ago

For the record, when playing this stream in the demo app there is an intro that sounds fine, but after a few seconds the audio becomes garbled. I didn't spot any errors from the decoder.

I noticed VLC is doing some reconfiguration around the time when the intro finishes: in verbose mode there is logging like this near the time of the transition:

ogg demux debug: end of a group of 1 logical streams
ogg demux debug: File length is 0 bytes
ogg demux debug: found vorbis header
ogg demux debug: beginning of a group of logical streams

I'm not sure exactly what would be needed to make ExoPlayer support this. It probably depends on details of the Ogg Vorbis format and the logic inVorbisReader or StreamReader may need to handle reaching the end of part of the data. We'd consider accepting a small pull request to add support if it can be done in a clean way, but as things stand I don't think this is a common issue so I don't think we can prioritize looking into it. Aside from that, reaching out to the publisher and asking them to provide a stream with a consistent format sounds like it may be worth trying!

ChernyshovYuriy commented 3 years ago

Thanks a lot, I was about the same opinion but decided to ask in case you can provide some additional info that I am not aware of.