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.7k stars 6.02k forks source link

Some ts files are not playing #5705

Closed tipoc123 closed 5 years ago

tipoc123 commented 5 years ago

[REQUIRED] Content description

I'm using ExoPlayer demo app. I have 6 files, 3 files are playable, other 3 files are not playable.

Non playable (i.e. FAILURE): DISCOVERY_CIVILIZATION_HD.ts HOME_AND_HEALTH_HD.ts TVN_HD.ts

Playable (i.e. SUCCESS): DISCOVERY_KIDS_HD.ts ESPN_2_HD.ts FOX_SPORTS_2_HD.ts

Info from ffmpeg's output:

Non playable:

1. http://stand.netup.tv/downloads/tipoc/DISCOVERY_CIVILIZATION_HD.ts

    Stream #0:0[0x4ba]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x4b2](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:2[0x4b4](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:3[0x4b6](spa): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 96 kb/s
    Stream #0:4[0x4b8](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 96 kb/s
    Stream #0:5[0x4c9](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:6[0x4cb](spa): Unknown: none ([130][0][0][0] / 0x0082)

2. http://stand.netup.tv/downloads/tipoc/HOME_AND_HEALTH_HD.ts

    Stream #0:0[0x64a]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x642](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x644](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x646](spa): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 96 kb/s
    Stream #0:4[0x648](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 96 kb/s
    Stream #0:5[0x659](spa): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
    Stream #0:6[0x65b](spa): Unknown: none ([130][0][0][0] / 0x0082)
    Stream #0:7[0x668]: Data: scte_35

3. http://stand.netup.tv/downloads/tipoc/TVN_HD.ts

    Stream #0:0[0xe21]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0xe23]: Audio: aac_latm (HE-AAC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
    Stream #0:2[0x126]: Data: bin_data ([6][0][0][0] / 0x0006)
    Stream #0:3[0xe24]: Unknown: none ([17][0][0][0] / 0x0011)

Playable:

1. http://stand.netup.tv/downloads/tipoc/DISCOVERY_KIDS_HD.ts

    Stream #0:0[0x5e6]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x5de](spa): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x5e0](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:3[0x5e2](spa): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 96 kb/s
    Stream #0:4[0x5e4](eng): Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, mono, s16p, 96 kb/s
    Stream #0:5[0x604]: Data: scte_35

2. http://stand.netup.tv/downloads/tipoc/ESPN_2_HD.ts

    Stream #0:0[0x44]: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
    Stream #0:1[0x45]: Audio: mp3 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s

3. http://stand.netup.tv/downloads/tipoc/FOX_SPORTS_2_HD.ts

    Stream #0:0[0x71]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 59.94 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x72]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 128 kb/s

Logcat's output for non-playable content something like this:

03-29 21:31:01.824 I/ExoPlayerImpl( 1331): Init 66adc8a [ExoPlayerLib/2.9.6] [p212_1113, p212, Amlogic, 23]
03-29 21:31:01.828 I/System.out( 1331): ((DefaultExtractorsFactory) extractorsFactory).setTsExtractorFlags(FLAG_DETECT_ACCESS_UNITS | FLAG_ALLOW_NON_IDR_KEYFRAMES)
03-29 21:31:01.828 D/EventLogger( 1331): state [0.00, 0.00, window=0, true, BUFFERING]
03-29 21:31:01.885 D/EventLogger( 1331): surfaceSizeChanged [0.06, 0.00, window=0, 1920, 1080]
03-29 21:31:01.931 I/ActivityManager( 4073): Displayed com.google.android.exoplayer2.demo/.PlayerActivity: +157ms
03-29 21:31:01.943 D/EventLogger( 1331): timelineChanged [0.12, 0.00, window=0, periodCount=1, windowCount=1, reason=PREPARED
03-29 21:31:01.943 D/EventLogger( 1331):   period [?]
03-29 21:31:01.943 D/EventLogger( 1331):   window [?, false, false]
03-29 21:31:01.943 D/EventLogger( 1331): ]
03-29 21:31:01.946 D/EventLogger( 1331): mediaPeriodCreated [0.12, 0.00, window=0, period=0]
03-29 21:31:01.947 D/EventLogger( 1331): loading [0.12, 0.00, window=0, period=0, true]
03-29 21:31:02.005 W/SurfaceFlinger( 3742): couldn't log to binary event log: overflow.

What is a possible reason? I see only difference in existence of some 'Unknown stream' in non playable files.

[REQUIRED] Link to test content

Non playable: http://stand.netup.tv/downloads/tipoc/DISCOVERY_CIVILIZATION_HD.ts http://stand.netup.tv/downloads/tipoc/HOME_AND_HEALTH_HD.ts http://stand.netup.tv/downloads/tipoc/TVN_HD.ts

Playable: http://stand.netup.tv/downloads/tipoc/DISCOVERY_KIDS_HD.ts http://stand.netup.tv/downloads/tipoc/ESPN_2_HD.ts http://stand.netup.tv/downloads/tipoc/FOX_SPORTS_2_HD.ts

[REQUIRED] Version of ExoPlayer being used

ExoPlayer 2.9.6.

[REQUIRED] Device(s) and version(s) of Android being used

Android 6.0.1 STB GIEC MP1113 (chip Amlogic s905x)

tipoc123 commented 5 years ago

As you can see I even use necessary TS flags according to your FAQ:

03-29 21:31:01.828 I/System.out( 1331): ((DefaultExtractorsFactory) extractorsFactory).setTsExtractorFlags(FLAG_DETECT_ACCESS_UNITS | FLAG_ALLOW_NON_IDR_KEYFRAMES)
tipoc123 commented 5 years ago

Streams marked as Unknown:

1. http://stand.netup.tv/downloads/tipoc/DISCOVERY_CIVILIZATION_HD.ts
    Unknown stream: Subtitle Spanish SCTE-27 subtitles (SC27) (it's 'Stream #0:6[0x4cb](spa): Unknown: none ([130][0][0][0] / 0x0082)' above)

2. http://stand.netup.tv/downloads/tipoc/HOME_AND_HEALTH_HD.ts
    Unknown stream: Subtitle Spanish SCTE-27 subtitles (SC27) (it's 'Stream #0:6[0x65b](spa): Unknown: none ([130][0][0][0] / 0x0082)' above)

3. http://stand.netup.tv/downloads/tipoc/TVN_HD.ts
    Unknown stream: Audio LATM (it's 'Stream #0:3[0xe24]: Unknown: none ([17][0][0][0] / 0x0011)' above)
ojw28 commented 5 years ago

The first two are both caused by https://github.com/google/ExoPlayer/issues/5330. I'm not sure about the third one.

ojw28 commented 5 years ago

5330 was fixed, so this is only tracking why the third of the not playable stream doesn't play.

tipoc123 commented 5 years ago

Thanks! First two streams are working now. We look forward to fixes for the third stream.

AquilesCanta commented 5 years ago

The issue with the 3rd stream (http://stand.netup.tv/downloads/tipoc/TVN_HD.ts) is that its PMT declares an audio track on PID 3620 for which there is no elementary stream. If the PMT is fixed by removing the entry for PID 3620, the TS plays correctly.

tipoc123 commented 5 years ago

@AquilesCanta, thank you so much! You are the best!