google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Mpeg2 via HLS stutters on Nvidia Shield #1295

Closed IanDBird closed 8 years ago

IanDBird commented 8 years ago

I'll send the file separately, but we have found a playback issue on the Nvidia Shield when playing some MPEG2 content via HLS. Playback basically stutters and only shows a frame every 2-3 seconds. The audio appears to play back correctly though.

The media information:

General
ID : 1 (0x1)
Complete name : /Users/ian/Desktop/mpeg2-60fps/00000.ts
Format : MPEG-TS
File size : 10.2 MiB
Duration : 10s 200ms
Overall bit rate mode : Variable
Overall bit rate : 8 298 Kbps

Video
ID : 256 (0x100)
Menu ID : 1 (0x1)
Format : MPEG Video
Format version : Version 2
Format profile : Main@High
Format settings, BVOP : No
Format settings, Matrix : Default
Format settings, GOP : N=15
Codec ID : 2
Duration : 10s 240ms
Bit rate mode : Variable
Maximum bit rate : 9 792 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
GOP, Open/Closed : Open

Audio
ID : 257 (0x101)
Menu ID : 1 (0x1)
Format : AAC
Format/Info : Advanced Audio Codec
Format version : Version 4
Format profile : LC
Muxing mode : ADTS
Codec ID : 15
Duration : 10s 240ms
Bit rate mode : Variable
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Frame rate : 43.066 fps (1024 spf)
Compression mode : Lossy
Delay relative to video : -23ms

I'll send the HLS files separately...

ojw28 commented 8 years ago

The media is strange, in that many PES packets within the stream don't declare pts timestamps. In other words, ptsFlag is false here.

It's probably possible to work around the issue specifically where the first PES packet does declare a pts timestamp and where the frame duration is known. Fixing wont be high priority, however.

ojw28 commented 8 years ago

@AquilesCanta - This would be a good thing to fix. In the case that PesReader sees a packet where ptsFlag isn't set, it sets timeUs to 0 and ends up propagating this to its payload reader. It should probably propagate a "not set" constant of some kind. This would allow the payload reader to increment time by itself in the case that it knows the sample duration (as is the case here).

AquilesCanta commented 8 years ago

A fix will be available in the next release.