-
Notifications
You must be signed in to change notification settings - Fork 6k
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
TS can't play on ExoPlayer but can on android.media.MediaPLayer #1894
Comments
Hi, this happens frequently when playing HD ts, any progress on this? Thanks for your help. |
Do your sample have IDR frames? If not - you should alter Exoplayer implementation (TSExtrator) to setup workaround flag in default constructor. |
@gpinigin Yes, it has IDR frames. Frames:
As your suggestion I changed two places: public TsExtractor(TimestampAdjuster timestampAdjuster) {
this(timestampAdjuster, new DefaultStreamReaderFactory(DefaultStreamReaderFactory.WORKAROUND_ALLOW_NON_IDR_KEYFRAMES));
} int workaroundFlags = DefaultStreamReaderFactory.WORKAROUND_MAP_BY_TYPE | DefaultStreamReaderFactory.WORKAROUND_ALLOW_NON_IDR_KEYFRAMES; It works for this media and other medias that don't have IDR frames! Thank you very much! But this media mentioned above has IDR frame, I don't know why it can't play normally. |
I will be closing this now. I think the file contains I-Frames, which are not actual IDR frames. We will possibly investigate this in the future, but it's not high priority right now. As @gpinigin said, try using the FLAG_ALLOW_NON_IDR_KEYFRAMES flag. |
How is it possible to apply this FLAG_ALLOW_NON_IDR_KEYFRAMES workaround in ExoPlayer 2 (preferably during player preparation)? I found H264Reader parameter, but is it possible to do without modifying the library code? Thanks! |
Have a look at DefaultTsPayloadReaderFactory. The constructor's |
Thanks, I found it, but it seems to be buried deep inside TsExtractor and I can't figure out where exactly I should override it during player preparation. Could you point me in the right direction? Should I override it in buildMediaSource somehow? case C.TYPE_OTHER: return new ExtractorMediaSource(uri, mediaDataSourceFactory, new DefaultExtractorsFactory(), mainHandler, eventLogger); |
You will need to provide your own ExtractorsFactory(instead of the default one), replacing the default TsExtractor constructor for the one that takes a PayloadReaderFactory. If you know you are going to play only Ts files, you can just provide that one. |
@ojw28, sorry to bother you, but do you think it's somehow possible to add an easy way to pass FLAG_ALLOW_NON_IDR_KEYFRAMES argument in ExtractorMediaSource or DefaultExtractorsFactory to avoid building complex custom ExtractorsFactory etc., since it's the only thing I have to change in the library for many TS streams to work? |
Filed #2657. |
HTTP-TS https://raw.githubusercontent.com/edwardaa/aaa/master/exoplay_cannot_play.ts can't play on ExoPlayer, but it can play by using android built in MediaPlayer. I tried it both on Amlogic TV box (6.0.1) and my mobile (4.4).
I am using ExoPlayer r2.0.1.
ExoPlayer demo app log:
The text was updated successfully, but these errors were encountered: