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

Video encoding doesn't work in Android 14 #265

Open
tobias-r opened this issue Oct 21, 2023 · 8 comments
Open

Video encoding doesn't work in Android 14 #265

tobias-r opened this issue Oct 21, 2023 · 8 comments

Comments

@tobias-r
Copy link

tobias-r commented Oct 21, 2023

Hi there,

encode a video isn't working anymore since Android 14.

final MediaTransformer mediaTransformer = new MediaTransformer(getApplicationContext());

TransformationListener transformationListener = new TransformationListener() { ... }

mediaTransformer.transform( ... );

In Android 13, all works perfectly fine with the same code, since Android 14 it stops after 1 sec without any error callbacks. The onProgress callback is called 1-2 times.

2023-10-21 08:51:59.171 15592-15592 TAG                   com.myproject.android                 D  LiTr onProgress
2023-10-21 08:52:03.950 15592-15837 BufferPoolAccessor2.0   com.myproject.android                 D  evictor expired: 1, evicted: 0
2023-10-21 08:52:04.951 15592-15837 BufferPoolAccessor2.0   com.myproject.android                 D  bufferpool2 0xb4000070c36c7e38 : 5(40960 size) total buffers - 4(32768 size) used buffers - 28/34 (recycle/alloc) - 6/30 (fetch/transfer)
2023-10-21 08:52:04.951 15592-15837 BufferPoolAccessor2.0   com.myproject.android                 D  bufferpool2 0xb4000070c36d34e8 : 5(20480 size) total buffers - 0(0 size) used buffers - 18/24 (recycle/alloc) - 5/46 (fetch/transfer)
2023-10-21 08:52:04.951 15592-15837 BufferPoolAccessor2.0   com.myproject.android                 D  bufferpool2 0xb4000070c3734b88 : 0(0 size) total buffers - 0(0 size) used buffers - 0/0 (recycle/alloc) - 0/0 (fetch/transfer)
2023-10-21 08:52:04.951 15592-15837 BufferPoolAccessor2.0   com.myproject.android                 D  bufferpool2 0xb4000070c36fa798 : 5(36700160 size) total buffers - 4(29360128 size) used buffers - 18/23 (recycle/alloc) - 9/19 (fetch/transfer)
2023-10-21 08:52:04.951 15592-15837 BufferPoolAccessor2.0   com.myproject.android                 D  evictor expired: 4, evicted: 4

Just guessing in the wild, is it the reduced mLock Limit?

Tobias

@izzytwosheds
Copy link
Contributor

Thank for catching this. I will get ahold of Android 14 device and investigate this.

@tobias-r
Copy link
Author

Any news on this one? 😇 Are we the only ones?

@izzytwosheds
Copy link
Contributor

Apologies for the delay. Looking into this now.

@izzytwosheds
Copy link
Contributor

Which device are you using? Things seem to be working well on emulator.

@tobias-r
Copy link
Author

True, in the emulator it works for me too. But on my Pixel 6a it doesn't. Also quite a few app users complained. Can you reproduce it?

@izzytwosheds
Copy link
Contributor

We were not able to reproduce it on Pixel devices (I don't exactly know which ones, I will ask)
I will try to get ahold of a Pixel 6a and debug.

@tobias-r
Copy link
Author

Just checked on a Samsung device and it worked too.
The problem also is, it doesn't throw an error, the service that is processing the video simply crashes, no callbacks.

@tobias-r
Copy link
Author

tobias-r commented Nov 19, 2023

Hi izzy, so I did some debugging on my Pixel 6a, and the problem only occurs with a video target format:
targetVideoFormat.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Flexible);
COLOR_FormatYUV422Flexible works! Is this something you can fix? I can do more tests, if you let me know.

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

No branches or pull requests

2 participants