media icon indicating copy to clipboard operation
media copied to clipboard

demo-transformer crashes with some videos

Open steelbytes opened this issue 1 year ago • 16 comments

Version

Media3 pre-release (alpha, beta or RC not in this list)

More version details

1.4.0-beta01 also any other branch I tried eg main

Devices that reproduce the issue

Pixel 8 Pro with 14 (ie, current)

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

download http://steelbytes.com/temp/bawbaw.mp4 install demo-transformer select above file click export wait a few seconds

Expected result

no crash

Actual result

crash every time after a few seconds.

Media

http://steelbytes.com/temp/bawbaw.mp4

Bug Report

  • [ ] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

steelbytes avatar Jun 27 '24 23:06 steelbytes

video source is from kdenlive (current-ish version) using h265 software export (ffmpeg). video plays fine in other apps such as Google Photos app, ie the phone's codecs are happy with the video.

steelbytes avatar Jun 27 '24 23:06 steelbytes

Hey @steelbytes Thanks for reporting the issue. We have identified the root cause and will prepare the fix soon. To give you a bit of context, the output video is encoded/transmuxed correctly and is playable. Since Transformer plays both input and output videos side by side it fails to load so much data and throws OOM exception. Otherwise the export is completely successful with the given input file.

SheenaChhabra avatar Jun 28 '24 16:06 SheenaChhabra

it also upsets exoplayer without transformer running in my own app. plays slow and stuttery and then dies with other error types (not out of ram). eg client doesn't own buffer and also nosuchelementdexceptioon

note: my app uses overlays

steelbytes avatar Jun 28 '24 23:06 steelbytes

@steelbytes Can you please share the stack track?

SheenaChhabra avatar Jul 01 '24 10:07 SheenaChhabra

07-03 09:18:17.690 11360 11360 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 72 byte allocation with 95072 free bytes and 92KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.SurfaceView.handleSyncNoBuffer(SurfaceView.java:1323)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.SurfaceView.updateSurface(SurfaceView.java:1266)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.SurfaceView.setFrame(SurfaceView.java:552)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25152)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.onLayout(LinearLayout.java:1638)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.onLayout(LinearLayout.java:1638)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.onLayout(LinearLayout.java:1638)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1891)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1729)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.LinearLayout.onLayout(LinearLayout.java:1638)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at com.android.internal.policy.DecorView.onLayout(DecorView.java:807)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.View.layout(View.java:25158)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewGroup.layout(ViewGroup.java:6460)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:4562)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3830)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2718)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9937)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1406)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.Choreographer.doCallbacks(Choreographer.java:1015)
07-03 09:18:17.690 11360 11360 E AndroidRuntime:        at android.view.Choreographer.doFrame(Choreographer.java:945)
07-03 09:18:17.691 11360 11371 I emo.transformer: WaitForGcToComplete blocked Background on Alloc for 20.107ms
07-03 09:18:17.691 11360 11373 I emo.transformer: Waiting for a blocking GC Alloc
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1389)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:959)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:100)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:232)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:317)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:8592)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
07-03 09:18:17.692 11360 11360 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
07-03 09:18:17.692 11360 11585 I emo.transformer: Waiting for a blocking GC Alloc
07-03 09:18:17.693 11360 11551 E AndroidRuntime: FATAL EXCEPTION: ExoPlayer:Loader:ProgressiveMediaPeriod
07-03 09:18:17.693 11360 11551 E AndroidRuntime: Process: androidx.media3.demo.transformer, PID: 11360
07-03 09:18:17.693 11360 11551 E AndroidRuntime: java.lang.OutOfMemoryError: Failed to allocate a 1528 byte allocation with 70496 free bytes and 68KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.util.Arrays.copyOf(Arrays.java:3578)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:177)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:543)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.lang.StringBuilder.append(StringBuilder.java:186)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at androidx.media3.common.util.Log.appendThrowableString(Log.java:354)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at androidx.media3.common.util.Log$Logger$1.e(Log.java:91)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at androidx.media3.common.util.Log.e(Log.java:306)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:449)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
07-03 09:18:17.693 11360 11551 E AndroidRuntime:        at java.lang.Thread.run(Thread.java:1012)

steelbytes avatar Jul 02 '24 23:07 steelbytes

07-03 09:19:22.512 11586 11743 E LoadTask: OutOfMemory error loading stream
07-03 09:19:22.512 11586 11743 E LoadTask:   java.lang.OutOfMemoryError: Failed to allocate a 65552 byte allocation with 99136 free bytes and 96KB until OOM, target footprint 268435456, growth limit 268435456; giving up on allocation because <1% of heap free after GC.
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.upstream.DefaultAllocator.allocate(DefaultAllocator.java:106)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.source.SampleDataQueue.preAppend(SampleDataQueue.java:233)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.source.SampleDataQueue.sampleData(SampleDataQueue.java:176)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.source.SampleQueue.sampleData(SampleQueue.java:602)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.extractor.TrackOutput$-CC.$default$sampleData(TrackOutput.java:161)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.source.SampleQueue.sampleData(Unknown Source:0)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.extractor.mp4.Mp4Extractor.readSample(Mp4Extractor.java:736)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:332)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:147)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1074)
07-03 09:19:22.512 11586 11743 E LoadTask:       at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:421)
07-03 09:19:22.512 11586 11743 E LoadTask:       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
07-03 09:19:22.512 11586 11743 E LoadTask:       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
07-03 09:19:22.512 11586 11743 E LoadTask:       at java.lang.Thread.run(Thread.java:1012)

steelbytes avatar Jul 02 '24 23:07 steelbytes

ie, it varies a bit.

steelbytes avatar Jul 02 '24 23:07 steelbytes

and in my app which uses android:largeHeap="true" in the manifest I get things like

07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal: Playback error
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:   androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:725)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at android.os.Handler.dispatchMessage(Handler.java:103)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at android.os.Looper.loopOnce(Looper.java:232)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at android.os.Looper.loop(Looper.java:317)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at android.os.HandlerThread.run(HandlerThread.java:85)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:   Caused by: java.util.NoSuchElementException
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.common.util.LongArrayQueue.remove(LongArrayQueue.java:83)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.VideoFrameRenderControl.dropFrame(VideoFrameRenderControl.java:221)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.VideoFrameRenderControl.render(VideoFrameRenderControl.java:179)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.CompositingVideoSinkProvider.render(CompositingVideoSinkProvider.java:336)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.CompositingVideoSinkProvider$VideoSinkImpl.render(CompositingVideoSinkProvider.java:712)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.processOutputBuffer(MediaCodecVideoRenderer.java:1330)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:2084)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:873)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:927)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1141)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:568)
07-03 09:24:35.858  1445 12744 E ExoPlayerImplInternal:       ... 4 more

and

07-03 09:24:35.881  1445  1445 D VespaSnoop: VideoOverlay  exo error  state:1  Unexpected runtime error  null
07-03 09:24:35.881  1445  1445 W System.err: androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
07-03 09:24:35.881   551   693 D hwc-display: [PrimaryDisplay] OperationRateManager::onConfig:rate=120
07-03 09:24:35.881  1445  1445 W System.err:    at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:725)
07-03 09:24:35.881   551   693 I hwc-display: [PrimaryDisplay] OperationRateManager::updateOperationRateLocked:Target@120(desired:120) | Refresh@120(peak:2147483647), Battery:OK, DBV:1180(NsMin:1172)
07-03 09:24:35.881   551   693 I hwc-display: [PrimaryDisplay] setActiveConfigWithConstraints: config(38)
07-03 09:24:35.881  1445  1445 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:103)
07-03 09:24:35.881  1445  1445 W System.err:    at android.os.Looper.loopOnce(Looper.java:232)
07-03 09:24:35.881  1445  1445 W System.err:    at android.os.Looper.loop(Looper.java:317)
07-03 09:24:35.881  1445  1445 W System.err:    at android.os.HandlerThread.run(HandlerThread.java:85)
07-03 09:24:35.881  1445  1445 W System.err: Caused by: java.util.NoSuchElementException
07-03 09:24:35.881  1445  1445 W System.err:    at androidx.media3.common.util.LongArrayQueue.remove(LongArrayQueue.java:83)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.video.VideoFrameRenderControl.dropFrame(VideoFrameRenderControl.java:221)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.video.VideoFrameRenderControl.render(VideoFrameRenderControl.java:179)
07-03 09:24:35.882  1495  1608 I DisplayDeviceRepository: Display device changed: DisplayDeviceInfo{"Built-in Screen": uniqueId="local:4619827535830457088", 1008 x 2244, modeId 4, renderFrameRate 60.000004, defaultModeId 3, userPreferredModeId 3, supportedModes [{id=1, width=1344, height=2992, fps=60.0, vsync=60.0, alternativeRefreshRates=[120.00001], supportedHdrTypes=[2, 3, 4]}, {id=2, width=1344, height=2992, fps=120.00001, vsync=120.00001, alternativeRefreshRates=[60.0], supportedHdrTypes=[2, 3, 4]}, {id=3, width=1008, height=2244, fps=120.00001, vsync=120.00001, alternativeRefreshRates=[60.0], supportedHdrTypes=[2, 3, 4]}, {id=4, width=1008, height=2244, fps=60.0, vsync=60.0, alternativeRefreshRates=[120.00001], supportedHdrTypes=[2, 3, 4]}], colorMode 0, supportedColorModes [0, 7, 9], hdrCapabilities HdrCapabilities{mSupportedHdrTypes=[2, 3, 4], mMaxLuminance=1000.0, mMaxAverageLuminance=120.0, mMinLuminance=5.0E-4}, allmSupported false, gameContentTypeSupported false, density 360, 365.76 x 367.726 dpi, appVsyncOff 6233334, presDeadline 11500000, cutout DisplayCutout{insets=Rect(0, 113 - 0, 0) waterfall=Insets{left=0, top=0, right=0, bottom=0} boundingRect={Bounds=[Rect(0, 0 - 0, 0), Rect(462, 0 - 545, 113), Rect(0, 0 - 0, 0), Rect(0, 0 - 0, 0)]} cutoutPathParserInfo={CutoutPathParserInfo{displayWidth=1008 displayHeight=2244 physicalDisplayWidth=1344 physicalDisplayHeight=2992 density={3.0} cutoutSpec={M 628.75,75 a 43.25,43.25 0 1 0 86.5,0 a 43.25,43.25 0 1 0 -86.5,0 Z @left} rotation={0} scale={1.0} physicalPixelDisplaySizeRatio={0.75}}} sideOverrides={}}, touch INTERNAL, rotation 0, type INTERNAL, address {port=0, model=0x401cecaabcbe1b}, deviceProductInfo DeviceProductInfo{name=HK3-A0B-00, manufacturerPnpId=GGL, productId=0, modelYear=null, manufactureDate=ManufactureDate{week=1, year=1990}, connectionToSinkType=0}, state ON, committedState ON, frameRateOverride , brightnessMinimum 0.0, brightnessMaximum 1.0, brightnessDefault 0.08711423, hdrSdrRatio 1.0, roundedCorners RoundedCorners{[RoundedCorner{position=TopLeft, radius=68, center=Point(68, 68)}, RoundedCorner{position=TopRight, radius=68, center=Point(940, 68)}, RoundedCorner{position=BottomRight, radius=68, center=Point(940, 2176)}, RoundedCorner{position=BottomLeft, radius=68, center=Point(68, 2176)}]}, FLAG_ALLOWED_TO_BE_DEFAULT_DISPLAY, FLAG_ROTATES_WITH_CONTENT, FLAG_SECURE, FLAG_SUPPORTS_PROTECTED_BUFFERS, FLAG_TRUSTED, installOrientation 0, displayShape DisplayShape{ spec=1208095170 displayWidth=1008 displayHeight=2244 physicalPixelDisplaySizeRatio=0.75 rotation=0 offsetX=0 offsetY=0 scale=1.0}}
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.video.CompositingVideoSinkProvider.render(CompositingVideoSinkProvider.java:336)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.video.CompositingVideoSinkProvider$VideoSinkImpl.render(CompositingVideoSinkProvider.java:712)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.processOutputBuffer(MediaCodecVideoRenderer.java:1330)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:2084)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:873)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:927)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1141)
07-03 09:24:35.882  1445  1445 W System.err:    at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:568)
07-03 09:24:35.882  1445  1445 W System.err:    ... 4 more
07-03 09:24:35.892  1445  1445 D VespaSnoop: VideoOverlay  exo stop

steelbytes avatar Jul 02 '24 23:07 steelbytes

and also

07-03 09:27:35.256  1445  1445 W System.err: androidx.media3.exoplayer.ExoPlaybackException: MediaCodecVideoRenderer error, index=0, format=Format(1, null, null, video/hevc, hvc1.1.6.L123.90, -1, null, [1080, 1920, 59.93917, ColorInfo(BT709, Limited range, SDR SMPTE 170M, false, 8bit Luma, 8bit Chroma)], [-1, -1]), format_supported=YES
07-03 09:27:35.257  1445  1445 W System.err:    at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:647)
07-03 09:27:35.257  1445  1445 W System.err:    at android.os.Handler.dispatchMessage(Handler.java:103)
07-03 09:27:35.257  1495  1608 W IPCThreadState: Sending oneway calls to frozen process.
07-03 09:27:35.257  1445  1445 W System.err:    at android.os.Looper.loopOnce(Looper.java:232)
07-03 09:27:35.257  1445  1445 W System.err:    at android.os.Looper.loop(Looper.java:317)
07-03 09:27:35.257  1495  1608 D DisplayManagerService: Ignore redundant display event 0/2 to 10000/8520
07-03 09:27:35.257  1495  1608 D DisplayManagerService: Ignore redundant display event 0/2 to 10272/10362
07-03 09:27:35.257  1445  1445 W System.err:    at android.os.HandlerThread.run(HandlerThread.java:85)
07-03 09:27:35.258  1445  1445 W System.err: Caused by: androidx.media3.exoplayer.video.MediaCodecVideoDecoderException: Decoder failed: c2.exynos.hevc.decoder
07-03 09:27:35.258  1495  1608 W IPCThreadState: Sending oneway calls to frozen process.
07-03 09:27:35.258  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.createDecoderException(MediaCodecVideoRenderer.java:1913)
07-03 09:27:35.258  1495  1608 D DisplayManagerService: Ignore redundant display event 0/2 to 10183/13119
07-03 09:27:35.258  1445  1445 W System.err:    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:893)
07-03 09:27:35.258  1495  1608 D DisplayManagerService: Ignore redundant display event 0/2 to 10260/16351
07-03 09:27:35.258  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.render(MediaCodecVideoRenderer.java:927)
07-03 09:27:35.258  1495  1608 W IPCThreadState: Sending oneway calls to frozen process.
07-03 09:27:35.258  1495  1608 D DisplayManagerService: Ignore redundant display event 0/2 to 10305/20876
07-03 09:27:35.258  1445  1445 W System.err:    at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1141)
07-03 09:27:35.259  1495  1608 W IPCThreadState: Sending oneway calls to frozen process.
07-03 09:27:35.259  1495  1608 D DisplayManagerService: Ignore redundant display event 0/2 to 10208/29564
07-03 09:27:35.259  1445  1445 W System.err:    at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:568)
07-03 09:27:35.259  1445  1445 W System.err:    ... 4 more
07-03 09:27:35.259  1445  1445 W System.err: Caused by: android.media.MediaCodec$CodecException: client does not own the buffer #4
07-03 09:27:35.259  1445  1445 W System.err:    at android.media.MediaCodec.releaseOutputBuffer(Native Method)
07-03 09:27:35.259  1445  1445 W System.err:    at android.media.MediaCodec.releaseOutputBufferInternal(MediaCodec.java:4125)
07-03 09:27:35.260  1445  1445 W System.err:    at android.media.MediaCodec.releaseOutputBuffer(MediaCodec.java:4099)
07-03 09:27:35.260  1445  1445 W System.err:    at androidx.media3.exoplayer.mediacodec.AsynchronousMediaCodecAdapter.releaseOutputBuffer(AsynchronousMediaCodecAdapter.java:206)
07-03 09:27:35.260  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.renderOutputBufferV21(MediaCodecVideoRenderer.java:1647)
07-03 09:27:35.260  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.renderOutputBuffer(MediaCodecVideoRenderer.java:1608)
07-03 09:27:35.260  1445  1445 W System.err:    at androidx.media3.exoplayer.video.MediaCodecVideoRenderer.processOutputBuffer(MediaCodecVideoRenderer.java:1339)
07-03 09:27:35.261  1445  1445 W System.err:    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.drainOutputBuffer(MediaCodecRenderer.java:2084)
07-03 09:27:35.261  1445  1445 W System.err:    at androidx.media3.exoplayer.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:873)
07-03 09:27:35.261  1445  1445 W System.err:    ... 7 more

steelbytes avatar Jul 02 '24 23:07 steelbytes

@steelbytes Your initial stack traces suggests OOM issue so can you first try adding load control on Exoplayer? We have done it in the demo app and the issue does not reproduce after this fix. https://github.com/androidx/media/commit/a1fc4e766fea8aaf2dd7ac5563842fc7178b7786

SheenaChhabra avatar Jul 03 '24 14:07 SheenaChhabra

yes those changes to the buffering made it player in your demo app.

but ...

with the same video (but not seemingly others) when I add video effects it starts to stutter and often (but not always) freeze. I'm still working on a proof of this but loosely adding about 10 TextOverlay.createStaticTextOverlay to your inputPlayer (and using your buffer size change) sometimes produces this stutter and/or freezing. think it's something about the frame drop stuff ...

steelbytes avatar Jul 05 '24 03:07 steelbytes

extra comments:

my pixel 4a5g is perfect, never fails. it's only the 8pro that stutters and sometimes dies (typically a NoSuchElementException callstack as I gave in an earlier comment).

also the 8pro is not always giving me a STATE_ENDED in onPlaybackStateChanged (I use ExoPlayer.REPEAT_MODE_OFF)

steelbytes avatar Jul 05 '24 04:07 steelbytes

still have this with 1.4.0 release

steelbytes avatar Jul 30 '24 23:07 steelbytes

Transformer demo doesn't use any video effect, did you modify it to use setVideoEffects()?

I'm not 100% what your set up is, is it

  • Using transformer to add overlay and play it with ExoPlayer, without video effects (as effects are already burnt in)
  • Using ExoPlayer + setVideoEffects() to play the media to show the overlay?

It seems to me you are doing both combined, so please clarify.

claincly avatar Jul 31 '24 10:07 claincly

Transformer demo doesn't use any video effect, did you modify it to use setVideoEffects()?

I'm not 100% what your set up is, is it

  • Using transformer to add overlay and play it with ExoPlayer, without video effects (as effects are already burnt in)
  • Using ExoPlayer + setVideoEffects() to play the media to show the overlay?

It seems to me you are doing both combined, so please clarify.

Easy and consistent repro of the problem

  • pull androidx/media release branch (which is 1.4.0).
  • compile and install demo-transformer on a Pixel 8 Pro
  • click choose local file, grant all access¹, choose bawbaw.mp4 (download it from link earlier in this issue).
  • click export
  • wait for export to complete and then it starts playing the source+output files in two exoplayers.
  • crash (OOM).

¹ (the other method of permissions granting is infuriating)

steelbytes avatar Aug 13 '24 09:08 steelbytes

Can you upload the file to Google Drive? It takes 5 hours to download it on my end and it failed multiple times.

claincly avatar Aug 13 '24 10:08 claincly

Hey @steelbytes. We need more information to resolve this issue but there hasn't been an update in 14 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Oct 11 '24 01:10 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@steelbytes if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Oct 22 '24 01:10 google-oss-bot