Comments (15)
Hey there,
I was previously implementing this using a fork of the ExoPlayer and martinbonnin's HLS branch (https://github.com/martinbonnin/ExoPlayer/tree/hls). I am currently working on adapting my ID3 work into this hls branch. Would that be a helpful addition for a pull request? Or will you guys be taking care of it on your own?
from exoplayer.
We'll be adding support directly (very soon). There will be a point where external contributions will become really helpful, but I don't think we're quite there yet.
from exoplayer.
I had some issues with TimedMetadata with this implementation, and had to make some minor changes to get the results I anticipated. Granted, I am not an expert in the matter, please see the note I made in the commit for this issue d3a05c9
from exoplayer.
@TheHal85 thanks for your feedback! We did it this way cause we mainly interested in TXXX frames, and TXXX frame by itself contains two strings (Description and Value). But it sounds like you're right the frame type should be the key, I'll investigate it more and update the code.
from exoplayer.
No worries, and thank you for the implementation. I had my eye on this issue and wanted to give it a shot with one of our HLS streams and I was always getting an empty array of metadata. I wasn't sure if the issue was our implementation of metadata insertion or not. Your implementation makes sense if you were concentrating on TXXX frames though. Thanks again!
from exoplayer.
@TheHal85 please take a look at the updates I've made based on your suggestion 71f918c
from exoplayer.
Works for me @andudo. Just in case anyone else uses the implementation, below is the onMetadata I used for testing it out. We are currently throwing closed captions into an ID3 tag, which hopefully is a temporary solution.
@Override
public void onMetadata(Map<String, Object> metadata) {
for (Object o : metadata.entrySet()) {
Map.Entry pairs = (Map.Entry) o;
if (metadata.containsKey(TxxxMetadata.TYPE)) {
TxxxMetadata txxxMetadata = (TxxxMetadata) metadata.get(TxxxMetadata.TYPE);
Log.i(TAG, String.format("ID3 TimedMetadata: description=%s, value=%s",
txxxMetadata.description, txxxMetadata.value));
} else {
Log.d(TAG, String.format("ID3 TimedMetadata: key=%s, value=%s",pairs.getKey(),new String((byte[]) pairs.getValue())));
if (metadata.containsKey("TIT1")) {
String closedCaptioning = new String((byte[]) metadata.get("TIT1"));
//bad to call override onText for TextListener, but works for now
onText(closedCaptioning);
}
}
}
}
Ninja Edit -
Also - I am making the assumption that the Frame is one of the Text based Frames. Instead of the
else {
Log.d(TAG, String.format("ID3 TimedMetadata: key=%s, value=%s",pairs.getKey(),new String((byte[]) pairs.getValue())));
it'd be better to see if the frame key started with "T" but I didn't have the time to really implement that.
from exoplayer.
Just an FYI, @TheHal85 your code snippet is a little buggy, probably a copy&paste issue. For example, if there is a TXXX frame in the map and two others, it will just log the same TXXX 3 times. Use the map entry if you're iterating through it and don't call get() or containsKey() on it. Also cast the element to the right type in the for loop for (Map.Entry<String, Object> entry : metadata.entrySet()) {...}
.
We're working on adding Closed Captions support, so hopefully you won't need to do those tricks soon.
from exoplayer.
Thanks @andudo. This was definitely a quick hack just to be see if it worked out for us, didn't go through all the scenarios. Thanks for the info though, it's appreciated.
from exoplayer.
I came across an issue with dev-hls current, where ExoPlayer finds the track of type "application/id3" from the stream, but fails reading the track.
MetadataTrackRenderer.java:139 never receives SampleSource#SAMPLE_READ from the source, it's always NOTHING_READ. As a result, the subtitles are not displayed.
In HlsSampleSource's read method none of the if-statements match and it returns from the final line of the method.
Test stream that has this issue, EAC-608 format:
http://now.video.nfl.com/i/captiontest/closedcaptiontest_,350k,550k,.mp4.csmil/master.m3u8
It plays with subtitles in Quicktime.
from exoplayer.
@perchrh ID3 and Closed Captions are two different separate things. What @TheHal85 is doing is a hacky work around while we don't have Closed Captions support.
Chunks in your stream have ID3 track registered in PMT, but no packets with ID3 data ever appear, thats why you see that MetadataTrackRenderer never gets SAMPLE_READ.
But you stream does have Closed Captions, which are stored as Closed Captions, not as ID3. Thats why Quicktime displays them. ExoPlayer doesn't support Closed Captions yet, thats why you don't see them displayed in ExoPlayer. There is another open issue for it #68
from exoplayer.
@andudo Thanks for explaining it to me. I erroneously thought every type of subtitle would be present in the ID3 container.
from exoplayer.
Current implementation doesn't seem valid. According to ID3v2.3.0 documentation
but since Map is used to build metadata information in Id3Parser we only get information about last TXXX frame read from ID3 tag.
It's more like ID3 parsing problem than Timed Matadata, but still TM is not working because of that
from exoplayer.
@outlying I suggest filing a bug, not commenting on a closed enhancement
from exoplayer.
@jlacivita I created PR after this comment #1234
from exoplayer.
Related Issues (20)
- Failed to initialize OMX.MTK.VIDEO.DECODER.AVC.secure HOT 1
- Loading glsl shaders in Exoplayer? HOT 1
- play m3u8 media no audio HOT 1
- CC function broken in 2.18.7 HOT 1
- onDeviceVolumeChanged(int volume, boolean muted) is never triggered on a TV device HOT 1
- Video blinking when switching between videos with different ratios (Android 14 only) HOT 1
- How to gather HAR(HTTP Archive) file with ExoPlayer? HOT 1
- add support to play mpd dash which doesn't have default kid in it HOT 2
- Can I defined provision-url not by getProvisionRequest in FrameworkMediaDrm.
- Playing VP8 encoded webm format video, on Android 13, the video screen is unclear and appears blurred
- how triggers FIRST_QUARTILE HOT 1
- how to read sps and pps from the stream
- How in Exoplyaer Upgrade Gradle Version from agp_version = '7.4.2' to the latest 8.2? HOT 3
- how make default buildconfig to release I mean how change gradle that by default when build APK on Android Studio always be release by default? HOT 3
- Decrypting HLS Stream using decryption key locally from code
- DRM session error java.lang.IllegalArgumentException: {}: BAD_VALUE HOT 2
- exoplayer play rtsp ,then call seekToDefaultPosition ,player state already buffing HOT 1
- play error HOT 2
- TIVIMATE and INTERNAL PLAYER question HOT 1
- App crash when target sdk version 34 (android.app.MissingForegroundServiceTypeException: Starting FGS without a type callerApp=ProcessRecord)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exoplayer.