Skip to content
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

Couldn't select audio track #2056

Closed
bene25 opened this issue Nov 10, 2016 · 17 comments
Closed

Couldn't select audio track #2056

bene25 opened this issue Nov 10, 2016 · 17 comments
Assignees

Comments

@bene25
Copy link

bene25 commented Nov 10, 2016

Hello.
We have m3u8 file format such as:

#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=490000,RESOLUTION=640x360
http://XXX.XXX.XX.XXX:31213/MEDIA/76336503.....583609776254/161/4161/
#EXT-X-STREAM-INF:BANDWIDTH=1500000,RESOLUTION=720x576
http://XXX.XXX.XX.XXX:31213/MEDIA/76336503.....583609776254/161/3161/
#EXT-X-STREAM-INF:BANDWIDTH=2500000,RESOLUTION=1280x720
http://XXX.XXX.XX.XXX:31213/MEDIA/76336503.....583609776254/161/2161/

Each EXT-X-STREAM-INF tag link to file like:

#EXTM3U
#EXT-X-TARGETDURATION:5
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:35156
#EXT-X-START:TIME-OFFSET=-25,PRECISE=YES
#EXT-X-KEY:METHOD=AES-128,URI="http://XXX.XXX.XX.XXX:02444/xxXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/191/2191/aeskey_191_
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/3020314583628416652818934133893/191/2191/seg_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts
#EXTINF:5,
http://XXX.XXX.XX.XXX:XXXXX/SSEGMENT/6545456465456456465454564/191/2191/seg_191_XXXXX.ts

Audio and subtitles are embeded in TS file.
trackSelector.getCurrentSelections().info.getTrackGroups() method doesnt work. How can I get audio and subtitles?

@Avetri
Copy link

Avetri commented Nov 10, 2016

--- library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java  (revision )
+++ library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java  (revision )
@@ -399,7 +399,7 @@
           }
         }
         extractor = new TsExtractor(timestampAdjuster,
-            new DefaultTsPayloadReaderFactory(esReaderFactoryFlags), true);
+            new DefaultTsPayloadReaderFactory(esReaderFactoryFlags), false);
       }
     } else {
       // MPEG-2 TS segments, and we need to continue using the same extractor.

@ojw28
Copy link
Contributor

ojw28 commented Nov 10, 2016

I doubt the above response is relevant.

@Avetri
Copy link

Avetri commented Nov 11, 2016

Yes, I just have noticed that my solution is not for the issue. I got only 1 audio track.

I suppose the issue is an encryption related.

@bene25
Copy link
Author

bene25 commented Nov 13, 2016

I could switch tracks on VLC or SM player. Android media player also can recognize it.
I've inserted my stream link to ExoPlayer 2 demo app and it doesn't identify any track except main video stream. Also somehow he chooses one of the two or three audiotracks and play it.

@bene25
Copy link
Author

bene25 commented Nov 15, 2016

Any news for this issue?

@AquilesCanta
Copy link
Contributor

Have you seen #2014 ? Is this related? If so, this is a duplicate. If that's the case, please close the issue. If not, please clarify, as I might be misunderstanding the problem.

@AquilesCanta
Copy link
Contributor

Also, if not a duplicate, try to provide a link for us to have a look. That makes everything easier. You can do so at [email protected].

@bene25
Copy link
Author

bene25 commented Nov 29, 2016

This is our .ts file sample.
I hope this helps.

https://drive.google.com/open?id=0B6PilUifi8koMkpmMzdaYk5fYkE

@AquilesCanta
Copy link
Contributor

AquilesCanta commented Nov 29, 2016

This is a duplicate of #2014 .

@AquilesCanta
Copy link
Contributor

It won't work perfectly well, but it would be interesting to try @Avetri 's patch(above). The language would be incorrectly set, but I wonder how it would work. @bene25 , give it a try and let me know the outcome. Or send your HLS link to [email protected].

@bene25
Copy link
Author

bene25 commented Nov 30, 2016

@Avetri could you please explain more detail your solution? Where you get DefaultTsPayloadReaderFactory?

@bene25
Copy link
Author

bene25 commented Dec 6, 2016

@Avetri solution helps.
But method name is DefaultStreamReaderFactory instead of DefaultTsPayloadReaderFactory

@AquilesCanta
Copy link
Contributor

You are probably using an older Exoplayer version, that's why.

@bene25
Copy link
Author

bene25 commented Dec 6, 2016

r2.0.4

@bene25
Copy link
Author

bene25 commented Dec 12, 2016

Could you help me please.
@Avetri solution helps, bu there is another issue , after fast switching several streams (4-6), trackSelection on last selected channel returns previous channel value.

@Avetri
Copy link

Avetri commented Dec 12, 2016

@bene25 , I have not noticed a notification from You. I just have seen it.
I am sorry.

@bene25
Copy link
Author

bene25 commented Dec 12, 2016

How to force notifyTrackSelectionsChanged again without setting TrackSelections?
I want only update trackSelection on current values.

@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants