You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With some of my streams I get the following NullPointerException with r2.0.4:
E/LoadTask: Unexpected exception loading stream
java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.exoplayer2.extractor.ts.ElementaryStreamReader.init(com.google.android.exoplayer2.extractor.ExtractorOutput, com.google.android.exoplayer2.extractor.ts.ElementaryStreamReader$TrackIdGenerator)' on a null object reference
at com.google.android.exoplayer2.extractor.ts.TsExtractor$PmtReader.consume(TsExtractor.java:470)
at com.google.android.exoplayer2.extractor.ts.TsExtractor.read(TsExtractor.java:242)
at com.google.android.exoplayer2.source.hls.HlsMediaChunk.load(HlsMediaChunk.java:180)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:295)
It happens because streamReaderFactory.createStreamReader in TxExtractor returns null in the following snippet:
pesPayloadReader = streamReaderFactory.createStreamReader(streamType, esInfo);
pesPayloadReader.init(output, new TrackIdGenerator(trackId, MAX_PID_PLUS_ONE));
The reason why createStreamReader returns null is because the flag FLAG_IGNORE_H264_STREAM in DefaultStreamReaderFactory is set. The reason why that flag is set is due to the following lines in HlsChunkSource:
// Sometimes AAC and H264 streams are declared in TS chunks even though they don't really
// exist. If we know from the codec attribute that they don't exist, then we can
// explicitly ignore them even if they're declared.
if (!MimeTypes.AUDIO_AAC.equals(MimeTypes.getAudioMediaMimeType(codecs))) {
esReaderFactoryFlags |= DefaultStreamReaderFactory.FLAG_IGNORE_AAC_STREAM;
}
**if (!MimeTypes.VIDEO_H264.equals(MimeTypes.getVideoMediaMimeType(codecs))) {
esReaderFactoryFlags |= DefaultStreamReaderFactory.FLAG_IGNORE_H264_STREAM;
}**
After debugging this I see that the "codecs" variable only contains the audio codec mp4a.40.2. Other streams that doesn't have this issue lists both the video and audio codecs.
So there is video in the stream.
I then tried to remove esReaderFactoryFlags |= DefaultStreamReaderFactory.FLAG_IGNORE_H264_STREAM in HlsChunkSource and then both video and audio plays just fine.
The text was updated successfully, but these errors were encountered:
Ok, but dev-v2 is still unable to play the video part of the stream. So what has replaced DefaultStreamReaderFactory.FLAG_IGNORE_H264_STREAM in dev-v2?
If there's video in this stream then the HLS master playlist is in violation of the spec. From the HLS spec:
If an EXT-X-STREAM-INF tag or EXT-X-I-FRAME-STREAM-INF tag contains the CODECS attribute, the attribute value MUST include every media format [RFC6381] present in any Media Segment in any of the Renditions specified by the Variant Stream.
In your master playlist CODECS="mp4a.40.2" is indicating that only audio is present. The video codec needs to be listed there too. If the video codec were listed, we'd play the video part of the stream correctly.
With some of my streams I get the following NullPointerException with r2.0.4:
It happens because streamReaderFactory.createStreamReader in TxExtractor returns null in the following snippet:
The reason why createStreamReader returns null is because the flag FLAG_IGNORE_H264_STREAM in DefaultStreamReaderFactory is set. The reason why that flag is set is due to the following lines in HlsChunkSource:
After debugging this I see that the "codecs" variable only contains the audio codec mp4a.40.2. Other streams that doesn't have this issue lists both the video and audio codecs.
So I looked into the TS data and it is:
And when a stream is chosen, the you get this:
So there is video in the stream.
I then tried to remove esReaderFactoryFlags |= DefaultStreamReaderFactory.FLAG_IGNORE_H264_STREAM in HlsChunkSource and then both video and audio plays just fine.
The text was updated successfully, but these errors were encountered: