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

Unable to play H264 50 tps Video #10910

Open
marufbd opened this issue Jan 9, 2023 · 4 comments
Open

Unable to play H264 50 tps Video #10910

marufbd opened this issue Jan 9, 2023 · 4 comments

Comments

@marufbd
Copy link

marufbd commented Jan 9, 2023

I am trying to play a HLS manifest live stream which is playable in VLC for Android. Its also playable in browser with just hls.js, also playable with ffplay as well.
Stream audio is MPEG-L2 and Video is h264. Attached here a sample ts segment for inspection.
53-05280.zip

FFMPEG probe:

Program 0
Metadata:
variant_bitrate : 4030000
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 4030000
Stream #0:1: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 96 kb/s
Metadata:
variant_bitrate : 4030000

Now, I am trying to play same HLS playlist with exoplayer demo.
Exoplayer shows a black screen without any audio for the same stream.
If I select only the audio I can hear audio just fine.
I even tried with the NDK compiled FFMPEG extensions even though its just for audio and audio is playing fine.
With extension decoders preferred it behaves exactly same.

Exoplayer does not give an error and no error logs etc.

I am not sure if I am missing any special configuration as audio and video codecs seem all supported.

If anyone interested I can generate a time window valid HLS stream url for testing.
Thanks a ton for the devs of this project.

@christosts
Copy link
Contributor

If anyone interested I can generate a time window valid HLS stream url for testing.

We'd need a working URL to an HLS playlist that we can test. In fact, please go through the issue template and provide as much of the information requested (e.g. Exoplayer version, device that shows the problem, Android OS version, bug reports).

If you're unable to share bug reports or test content publicly, please send them to dev.exoplayer@gmail.com using a subject in the format "Issue #1234" ("#1234" is replaced with your issue number). Please also update this issue to indicate you've done this.

Thanks.

@marufbd
Copy link
Author

marufbd commented Jan 20, 2023

Thanks @christosts for looking.
I have generated this HLS manifest URL valid for a week:
HLS Manifest

Let me know if it expires, I can generate a new one as soon as anyone can have a look.
I will keep an eye and update the link anyway after a week.

Player and OS versions:

ExoPlayer version: 2.18.1
Device: Samsung A8
OS Version: Android 11

@christosts
Copy link
Contributor

The first thing I noticed is that the video is interlaced. The decoders on the Android platform are only required to decode progressive videos. Some devices may be able to decode interlaced videos but it's up to the device OEM to have such a decoder on the device. Do not expect to be able to play interlaced videos across different Android devices using the platform decoders. It's also unclear to me whether VLC uses the bundled ffmpeg video decoder for interlaced videos or goes through the platform (i.e. MediaCodec).

The second thing I noticed is that when the player extracts the video frames from the video, no frame is considered a key frame and all video frames are discarded. For video decoding, the player needs to start from a key frame.

@marufbd are you in control of the encoding? Can you check if/why the video file does not contain key frames?

@rohitjoins I'm passing this over to you as, at the moment this seems to be more related to the extractor. That is, either the media is not valid, or TS extraction does not detect the key frames correctly.

@marufbd
Copy link
Author

marufbd commented Jan 24, 2023

@christosts thanks a lot for looking and giving insights.
For the encoding of the live stream I have very limited visibility and no control at all.
I am responsible for the play part which was working with our test devices in VLC for android, it also works with ffplay.
And works on the Firefox browser in hls.js.
We need to move away from VLC and utilise Exoplayer as its much more flexible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants