Мой SDP выглядит так, как показано ниже (IP и порт могут измениться), только видео, содержит SPS/PPS и профиль/уровень (настоящие, а не жестко заданные)
v=0
o=- 0 0 IN IP4 null
s=Unnamed
i=N/A
c=IN IP4 192.168.18.26
t=0 0
a=recvonly
m=video 5006 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=42c029;sprop-parameter-sets=Z0LAKY1oB4AiflgHhEI1,aM4BqDXI;
a=control:trackID=1
Моя реализация ExoPlayer актуальна
implementation 'com.google.android.exoplayer:exoplayer-core:2.17.1'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.17.1'
implementation 'com.google.android.exoplayer:exoplayer-rtsp:2.17.1'
И я пытаюсь загрузить выше SDP, используя этот код
Uri uri = Uri.fromFile(file);
exoPlayer.setMediaItem(MediaItem.fromUri(uri));
exoPlayer.prepare();
exoPlayer.setPlayWhenReady(true);
что дает мне
ExoPlayerImplInternal: Playback error
com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:641)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:611)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:214)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (FlvExtractor, FlacExtractor, WavExtractor, FragmentedMp4Extractor, Mp4Extractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, JpegExtractor) could read the stream.
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.init(BundledExtractorsAdapter.java:92)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1020)
....
Этот SDP можно открыть с помощью VLC на рабочем столе (обычный проигрыватель Windows и Linux и реализация .NET lib) или на мобильном устройстве (используя официальную реализацию LibVLC для Android). Что я делаю не так с ExoPlayer?
Отказ от ответственности: это не RT<любая_буква>P. Просто чистый RTP с необработанными блоками NAL, наложенными на какой-то ip:port. Согласно документу, ExoPlayer должен поддерживать RTP/UDP и H264 (но я не вижу Extractor
...)
согласно проблеме ЭТО - в настоящее время ExoPlayer не поддерживает загрузку и воспроизведение файла SDP, к сожалению...