-
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
Exoplayer can not play some HLS video stream just only playback audio #5108
Comments
Hi, we are facing same problem, MPEG 4 HD of resolution 1080p and 1920 cannot play in mobile, 720p plays fine. We tried to set parameters in defaulttrackfactory by setvideosize to 1080, instead of default sdsize but it fails to take |
This comment has been minimized.
This comment has been minimized.
This stream works if you enable FLAG_ALLOW_NON_IDR_KEYFRAMES. You can do this by setting the flag when you create the DefaultHlsExtractorFactory. Something like:
Let me know if this does not work for you. Thanks! |
Thanks Santiago and Oliver, We tried inserting the
FLAG_ALLOW_NON_IDR_KEYFRAMES, but getting errors, here is the code below,
please advice at earliest as we are stuck
Following is initializeplayer() method. It has all the code to
initialize exoplayer, load and play. I am able to play all the hls
streams with this code, but not able to play HLS HD live streams.
initializeplayer(){
bandwidthMeter = new DefaultBandwidthMeter();
videoTrackSelectionFactory = new
AdaptiveTrackSelection.Factory(bandwidthMeter);
trackSelector = new
DefaultTrackSelector(videoTrackSelectionFactory);
loadControl = new DefaultLoadControl();
player = ExoPlayerFactory.newSimpleInstance(this,
trackSelector, loadControl);
simpleExoPlayerView = new SimpleExoPlayerView(this);
simpleExoPlayerView = (SimpleExoPlayerView)
findViewById(R.id.player_view);
simpleExoPlayerView.setPlayer(player);
bandwidthMeterA = new DefaultBandwidthMeter();
dataSourceFactory = new DefaultDataSourceFactory(this,
Util.getUserAgent(this, "exoplayer2example"), bandwidthMeterA);
videoSource = new HlsMediaSource(*url*, dataSourceFactory,
1, null, null);
loopingSource = new LoopingMediaSource(videoSource);
player.prepare(loopingSource);
player.setPlayWhenReady(true); //run file/link when ready to play.
player.setVideoDebugListener(this);
}
*compile **'com.google.android.exoplayer:exoplayer:2.6.1'* this is the
exoplayer version which I am using now.
not able to play HD HLS live stream with this code. But If I convert
the same steam into 720p, I can play with this code. So I made some
changes as you suggested.
DefaultHlsExtractorFactory defaultHlsExtractorFactory =
new DefaultHlsExtractorFactory(*DefaultTsPayloadReaderFactory.FLAG_ALLOW_NON_IDR_KEYFRAMES*);
MediaSource mediaSource =
new HlsMediaSource.Factory(dataSourceFactory)
.setExtractorFactory(defaultHlsExtractorFactory)
.createMediaSource(url);
But DefaultHlsExtractorFactory is taking arguments. not allowing to
pass *DefaultTsPayloadReaderFactory.FLAG_ALLOW_NON_IDR_KEYFRAMES. *
…On Mon, Nov 26, 2018 at 5:16 PM Santiago Seifert ***@***.***> wrote:
This stream works if you enable FLAG_ALLOW_NON_IDR_KEYFRAMES. You can do
this by setting the flag when you create the DefaultHlsExtractorFactory.
Something like:
DefaultHlsExtractorFactory defaultHlsExtractorFactory =
new DefaultHlsExtractorFactory(FLAG_ALLOW_NON_IDR_KEYFRAMES);
MediaSource mediaSource =
new HlsMediaSource.Factory(dataSourceFactory)
.setExtractorFactory(defaultHlsExtractorFactory)
.createMediaSource(uri);
Let me know if this does not work for you. Thanks!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AbpBTPJmku3l9AcfBrVPNKKwXfsoDw2yks5uy9SvgaJpZM4YfJ3K>
.
|
From what I understand your issue is that If you don't want to upgrade your ExoPlayer version from 2.6.1 then you'll have to provide your own HlsExtractorFactory implementation that sets FLAG_ALLOW_NON_IDR_KEYFRAMES in the TsExtractor instantiation. Hope this helps. |
Thanks Santiago and Oliver for last time quick response, we had to make lot
of changes to upgrade to new version 2.6.1
After enabling the flag, below is description of problem - Is it anything
to do with Chunk Count as the stream comes from Wowza in HLS protocol and
H.264 codec
An early help would be highly appreciated as our customers are stuck
*Problem:*
Stream is stopping after playing one frame and giving following
error in android logcat in case of HD Streams. But for SD streams it
is working fine.
*Android Error in logcat:* E/ACodec: [OMX.google.h264.decoder]
setPortMode on output to DynamicANWBuffer failed w/ err -1010
*Exoplayer code:*
bandwidthMeter = new DefaultBandwidthMeter();
videoTrackSelectionFactory = new
AdaptiveTrackSelection.Factory(bandwidthMeter);
trackSelector = new
DefaultTrackSelector(videoTrackSelectionFactory);
loadControl = new DefaultLoadControl();
player = ExoPlayerFactory.newSimpleInstance(getActivity(),
trackSelector, loadControl);
simpleExoPlayerView = new SimpleExoPlayerView(getActivity());
simpleExoPlayerView = (SimpleExoPlayerView)
v.findViewById(R.id.player_view);
simpleExoPlayerView.setUseController(true);
simpleExoPlayerView.requestFocus();
simpleExoPlayerView.setPlayer(player);
mp4VideoUri = url;
bandwidthMeterA = new DefaultBandwidthMeter();
dataSourceFactory = new
DefaultDataSourceFactory(getActivity(),
Util.getUserAgent(getActivity(), "exoplayer2example"),
bandwidthMeterA);
DefaultHlsExtractorFactory defaultHlsExtractorFactory =
new
DefaultHlsExtractorFactory(DefaultTsPayloadReaderFactory.FLAG_ALLOW_NON_IDR_KEYFRAMES);
MediaSource mediaSource =
new HlsMediaSource.Factory(dataSourceFactory)
.setExtractorFactory(defaultHlsExtractorFactory)
.createMediaSource(mp4VideoUri);
loopingSource = new LoopingMediaSource(mediaSource);
player.prepare(loopingSource);
*Exoplayer version: *com.google.android.exoplayer:exoplayer:2.9.1
…On Wed, Nov 28, 2018 at 4:48 PM Santiago Seifert ***@***.***> wrote:
From what I understand your issue is that
DefaultHlsExtractorFactory defaultHlsExtractorFactory = new
DefaultHlsExtractorFactory(DefaultTsPayloadReaderFactory.FLAG_ALLOW_NON_IDR_KEYFRAMES);
does not compile. Note that the DefaultHlsExtractorFactory constructor that
takes the flags was added in 2.9.1.
If you don't want to upgrade your ExoPlayer version from 2.6.1 then you'll
have to provide your own HlsExtractorFactory implementation that sets
FLAG_ALLOW_NON_IDR_KEYFRAMES in the TsExtractor instantiation. Hope this
helps.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AbpBTMjlOdaDaHa-PaxwFqiiOg1LQoccks5uznEdgaJpZM4YfJ3K>
.
|
Can you please file a new issue including all the information required in the issue template? Please don't skip any items. |
Use random access indicator in transport streams Issue:#1967 Issue:#2020 Issue:#2182 Issue:#2469 Issue:#2581 Issue:#2748 Issue:#2939 Issue:#2979 Issue:#3316 Issue:#3574 Issue:#3709 Issue:#3747 Issue:#4103 Issue:#4184 Issue:#4355 Issue:#4538 Issue:#4719 Issue:#4861 Issue:#4925 Issue:#4951 Issue:#5108 Issue:#5186 PiperOrigin-RevId: 225798044
Use random access indicator in transport streams Issue:#1967 Issue:#2020 Issue:#2182 Issue:#2469 Issue:#2581 Issue:#2748 Issue:#2939 Issue:#2979 Issue:#3316 Issue:#3574 Issue:#3709 Issue:#3747 Issue:#4103 Issue:#4184 Issue:#4355 Issue:#4538 Issue:#4719 Issue:#4861 Issue:#4925 Issue:#4951 Issue:#5108 Issue:#5186 PiperOrigin-RevId: 225798044
Hi Oliver
Hope you are doing well, we had checked DRM in MPEG-DASH long back,
But all our apps on Android are on HLS, has Exoplayer added DRM
support for HLS also? if yes - in which version and how to integrate
Any help would be highly appreciated
Thanks and Regards
Suraj
…On Mon, Nov 19, 2018 at 7:26 PM Oliver Woodman ***@***.***> wrote:
This seems identical to #5107
<#5107>. Marking as a duplicate.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5108 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AbpBTOcM7dnEnSRzKBJmVxxcXsIyzRvcks5uwrh1gaJpZM4YfJ3K>
.
|
Issue description
I am facing an issue where my exoplayer can not playback H.264+AAC hls stream.It just has only sound track, can not be play video track.
Reproduction steps
Use the m3u8 Link http://119.36.240.18:8099/HLStest/Indeltestvod/index.m3u8 to playback please.
Exoplayer just only play audio sound.But when I used PC/Android side tools such as VLC app, it can be playback correctly.
I guess this issue maybe a compatibility issue. I traced the log , it can not recognized the video stream.
Link to test content http://119.36.240.18:8099/HLStest/Indeltestvod/index.m3u8
Also you can download zip file on http://file.yiyuen.com/detail.html?id=891 or
Indeltestvod.zip
include the log file and test stream clip. Our customer side is a live hls steam, I catched a clip and put in the zip file for sample.
Version of ExoPlayer being used
r.2.9.0 & 2.8.1
Device(s) and version(s) of Android being used
Tested on Xiaomi 6 Android 8.0.
Please let me know if there are any other inputs needed.
The text was updated successfully, but these errors were encountered: