Open w7virtual opened 7 years ago
av_dump_format
in ff_ffplay.c
I've tried this:
parseMetadata(mMediaPlayer.getMediaMeta().toString());
protected void parseMetadata( String s ) {
String[] kvs = s.split( ";" );
for (String kv : kvs) {
int n = kv.indexOf( '=' );
if (n < 1) continue;
boolean isString = n + 1 < kv.length()
&& kv.charAt( kv.length() - 1) == '\''
&& kv.charAt( n + 1 ) == '\'';
String key = kv.substring( 0, n );
String val = isString ?
kv.substring( n+2, kv.length()-1) :
n + 1 < kv.length() ?
kv.substring( n+1 ) : "";
// yes - we should detect this earlier, but it will not be null in most cases:
Log.i("METADATA", key + val );
}
}
But it returns only this:
11-29 10:09:09.834 1865-1865/tv.danmaku.ijk.media:ijkplayer I/METADATA: Bundle[{streams[Bundle[{codec_level=-99, channel_layout=3, codec_name=aac, type=audio, codec_pixel_format=gray, sample_rate=44100, codec_profile_id=4}]], format=flv, audio=0, video=-1, start_us=0}]
Does not return StreamTitle
@w7virtual
av_dump_format
is a C api of ffmpeg, and for now you can not access it from java.
If you need this data you have to write some jni code for accessing to the ff_ffplay.c
and refer from av_dump_format
in libavformat/dump.c
to get what you want.
Considering that I have no knowledge in this language and little experience with ffmpeg, I see no other option but to abandon the project. Thank you...
Is it possible to read the metadata from the stream?
If I call the IjkMediaPlayer player I see this:
How do i get this to a string? I want to get the data to process StreamTitle later: