google / google/ExoPlayer

Transforming HLS Live to MP4 Causes Crash on Android 10 and Newer

Open
#11,004 10 comments 0 reactions 1 assignee Claimed by @andrewlewis View on GitHub
bug low priority
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### ExoPlayer Version

2.18.3

### Devices that reproduce the issue

Every device that we tested, Android 10, 11, 12, 13

We do not observe this issue on Android versions 9 and lower.

### Devices that do not reproduce the issue

_No response_

### Reproducible in the demo app?

Yes

### Reproduction steps

1. modify `demos/transformer/build.gradle` and add the following line at line 83:
```
implementation project(modulePrefix + 'library-hls'),
```
2. Add the HLS Live Stream URL to the Transformer Demo.
a) add the following HLS Live Stream URL at aline 91:
```
"https://voa-ingest.akamaized.net/hls/live/2033876/tvmc07/playlist.m3u8",
```
b) Add the title for the above URL at line 107:
```
"Test Record HLS Live - akamaized",
```

### Expected result

The media is downloaded and no crash happens.

### Actual result
Download works fine for some HLS URLs, but it fails and app crashes with the following log when using some other HLS URLs:

```
02/20 15:59:44: Launching 'demo-transformer' on 13.5 Freeform (Edited) API 30.
Install successfully finished in 965 ms.
$ adb shell am start -n "com.google.android.exoplayer2.transformerdemo/com.google.android.exoplayer2.transformerdemo.ConfigurationActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 19960 on device '13.5_Freeform_Edited_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/transformerdem: Late-enabling -Xcheck:jni
I/transformerdem: Unquickening 12 vdex files!
W/transformerdem: Unexpected CPU variant for X86 using defaults: x86
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/transformerdem: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/transformerdem: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/HostConnection: HostConnection::get() New Host Connection established 0xed569590, tid 20001
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xed56ada0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xed56ada0: ver 3 0 (tinfo 0xed8bd970) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xed569a60, tid 20001
D/goldfish-address-space: allocate: Ask for block of size 0x100
D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3f1ffc000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_3_0
I/transformerdem: JIT allocated 74KB for compiled code of void android.view.View.(android.content.Context, android.util.AttributeSet, int, int)
D/OpenGLRenderer: endAllActiveAnimators on 0xe7157cb0 (RippleDrawable) with handle 0xbdf0cc10
I/ExoPlayerImpl: Init 69727d7 [ExoPlayerLib/2.18.3] [generic_x86_arm, sdk_gphone_x86_arm, Google, 30]
I/Choreographer: Skipped 41 frames! The application may be doing too much work on its main thread.
I/OpenGLRenderer: Davey! duration=756ms; Flags=1, IntendedVsync=1752029272942, Vsync=1752712606248, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1752721714436, AnimationStart=1752721843436, PerformTraversalsStart=1752722564436, DrawStart=1752759133436, SyncQueued=1752771589436, SyncStart=1752772867436, IssueDrawCommandsStart=1752772996436, SwapBuffers=1752774992436, FrameCompleted=1752787280436, DequeueBufferDuration=10217000, QueueBufferDuration=1076000, GpuCompleted=0,
I/OpenGLRenderer: Davey! duration=762ms; Flags=1, IntendedVsync=1752029272942, Vsync=1752712606248, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1752721714436, AnimationStart=1752721843436, PerformTraversalsStart=1752722564436, DrawStart=1752788572436, SyncQueued=1752788642436, SyncStart=1752789587436, IssueDrawCommandsStart=1752789785436, SwapBuffers=1752791761436, FrameCompleted=1752793156436, DequeueBufferDuration=154000, QueueBufferDuration=590000, GpuCompleted=72343995342127104,
I/TetheringManager: registerTetheringEventCallback:com.google.android.exoplayer2.transformerdemo
D/MPEG4Writer: PreAllocation enabled
D/MPEG4Writer: fpathconf _PC_FILESIZEBITS:64
D/MPEG4Writer: File size limit set to 4503599627370495 bytes implicitly
D/MPEG4Writer: MP4WtrCtrlHlpLooper Started
I/MPEG4Writer: limits: 4503599627370495/0 bytes/us, bit rate: -1 bps and the estimated moov size 3192 bytes
D/MPEG4Writer: kWhatNoIOErrorSoFar
I/MPEG4Writer: setStartTimestampUs: 11667
I/MPEG4Writer: Earliest track starting time: 11667
I/MPEG4Writer: setStartTimestampUs: 0
I/MPEG4Writer: Earliest track starting time: 0
A/libc: FORTIFY: write: count 4294967295 > SSIZE_MAX
A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20063 (MPEG4Writer), pid 19960 (transformerdemo)
```

### Media

Here are example HLS live streams URL that crash happens:
- https://voa-ingest.akamaized.net/hls/live/2033876/tvmc07/playlist.m3u8
- https://svs.itworkscdn.net/rudawlive/rudawlive.smil/playlist.m3u8

### Bug Report

- [X] You will email the zip file produced by `adb bugreport` to dev.exoplayer@gmail.com after filing this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.