Closed Generalomosco closed 10 months ago
Emulator?
Real device on Redmi Note 11s
I happen to have a Redmi Note 10S, can't experience the same.
There shouldn't be D/AudioTrack
logs... we only use OpenSL ES for audio.
Can you try disabling the audio (if it fixes the lag):
player.setAudioTrack(AudioTrack.no());
I may go to sleep. It's 2:00 AM here, I will appreciate quick replies (or you have to wait for 8-10 hours).
Still same thing even disabling the audio
D/CCodecBufferChannel(29245): elapsed: mInputMetEos 0, hasPendingOutputsInClient 1, n 17
D/PipelineWatcher(29245): [0xb4000072d4d62868] elapsed: mFramesInPipeline 0, n 17
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/gralloc4(29245): Empty SMPTE 2094-40 data
D/BufferPoolAccessor2.0(29245): bufferpool2 0xb4000072f0bc8228 : 8(16777216 size) total buffers - 8(16777216 size) used buffers - 0/10 (recycle/alloc) - 14/48 (fetch/transfer)
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
D/CCodecBufferChannel(29245): elapsed: mInputMetEos 0, hasPendingOutputsInClient 1, n 17
D/PipelineWatcher(29245): [0xb4000072d4d62868] elapsed: mFramesInPipeline 0, n 17
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
I/MiMediaCodec(29245): send last fps
I/MiMediaCodec(29245): send fps to display with mLastSendedFps:30.000000 state:1 id:5
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
D/BufferPoolAccessor2.0(29245): bufferpool2 0xb4000072f0bc8228 : 8(16777216 size) total buffers - 8(16777216 size) used buffers - 0/10 (recycle/alloc) - 24/115 (fetch/transfer)
D/CCodecBufferChannel(29245): elapsed: mInputMetEos 0, hasPendingOutputsInClient 1, n 17
D/PipelineWatcher(29245): [0xb4000072d4d62868] elapsed: mFramesInPipeline 0, n 17
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
E/gralloc4(29245): Empty SMPTE 2094-40 data
E/gralloc4(29245): Empty SMPTE 2094-40 data
I/MiMediaCodec(29245): send last fps
I/MiMediaCodec(29245): send fps to display with mLastSendedFps:30.000000 state:1 id:5
E/CCodecBufferChannel(29245): [WA] long time elapsed since last input queued, let's queue a specific work to HAL to notify something
D/CCodecBufferChannel(29245): elapsed: mInputMetEos 0, hasPendingOutputsInClient 1, n 17
D/PipelineWatcher(29245): [0xb4000072d4d62868] elapsed: mFramesInPipeline 0, n 17
D/BufferPoolAccessor2.0(29245): bufferpool2 0xb40000742e4af828 : 8(16777216 size) total buffers - 8(16777216 size) used buffers - 0/10 (recycle/alloc) - 6/6 (fetch/transfer)
D/BufferPoolAccessor2.0(29245): bufferpool2 0xb40000742ea60c28 : 8(16777216 size) total buffers - 8(16777216 size) used buffers - 0/10 (recycle/alloc) - 7/7 (fetch/transfer)
D/BufferPoolAccessor2.0(29245): bufferpool2 0xb4000074378ab228 : 8(16777216 size) total buffers - 8(16777216 size) used buffers - 0/10 (recycle/alloc) - 6/6 (fetch/transfer)
How does passing enableHardwareAcceleration: false in VideoController constructor do?
Also... How does mpv perform on your device?
Also... How does mpv perform on your device?
It plays perfect with the app
How does passing enableHardwareAcceleration: false in VideoController constructor do?
Still lagging but no more logs when disabled
This is the video i'm testing it with https://codeuplifts.com/static/NaturePortrait.mp4 but still same with other videos with high dimensions.
With mpv app on playstore sometimes it still stop and continue once or twice, but not that worse as mine. i have fast network
I'm unable to play that MRL in Google Chrome as well. The connection speed seems to be very slow, which seems like the actual issue. Be assured that the performance of package:media_kit is very good on all platforms. Although I'm not denying the presence of any problem which I'm not aware of.
I fetched & downloaded the video; I can't seem to experience lag of any kind on my Redmi Note 10S with G95.
I am experiencing a similar issue using this link . (Downloaded and played with media_kit package)
Any ideas on what could be wrong?
Here is what the console shows:
/CCodecBuffers(32732): Increasing local buffer pool capacity from 66355200 to 132710400
D/CCodecBuffers(32732): Increasing local buffer pool capacity from 132710400 to 265420800
The Flutter DevTools debugger and profiler on H96 Max V58 is available at: http://127.0.0.1:9102?uri=http://127.0.0.1:34401/tJo2l9ZKvww=/
D/CCodecConfig(32732): c2 config diff is c2::u32 raw.crop.height = 2160
D/CCodecConfig(32732): c2::u32 raw.crop.left = 0
D/CCodecConfig(32732): c2::u32 raw.crop.top = 0
D/CCodecConfig(32732): c2::u32 raw.crop.width = 3840
W/ColorUtils(32732): expected specified color aspects (2:0:0:0)
D/CCodecBuffers(32732): [c2.rk.avc.decoder#453:Output[N]] updating image-data
D/CCodecBuffers(32732): [c2.rk.avc.decoder#453:Output[N]] updating stride = 3840, width: 3840, height: 2160
D/CCodecBuffers(32732): [c2.rk.avc.decoder#453:Output[N]] updating vstride = 2160
I/flutter (32732): gpu
I/media_kit(32732): com.alexmercerind.media_kit_video.VideoOutputManager.setSurfaceTextureSize: -5476376625224721712 3840 2160
D/CCodecBufferChannel(32732): [c2.rk.avc.decoder#453] Discard frames from previous generation.
D/CCodecBufferChannel(32732): [c2.rk.avc.decoder#453] Discard frames from previous generation.
D/CCodecBufferChannel(32732): [c2.rk.avc.decoder#453] Discard frames from previous generation.
I/CCodecConfig(32732): query failed after returning 11 values (BAD_INDEX)
W/Codec2Client(32732): query -- param skipped: index = 1342179345.
W/Codec2Client(32732): query -- param skipped: index = 2415921170.
W/Codec2Client(32732): query -- param skipped: index = 1073743886.
W/Codec2Client(32732): query -- param skipped: index = 1610614798.
I/CCodecConfig(32732): query failed after returning 11 values (BAD_INDEX)
W/Codec2Client(32732): query -- param skipped: index = 1342179345.
W/Codec2Client(32732): query -- param skipped: index = 2415921170.
W/Codec2Client(32732): query -- param skipped: index = 1073743886.
W/Codec2Client(32732): query -- param skipped: index = 1610614798.
D/CCodecBufferChannel(32732): [c2.rk.avc.decoder#453] Ignoring stale input buffer done callback: last flush index = 16, frameIndex = 16
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/208 (fetch/transfer)
D/BufferPoolAccessor2.0(32732): evictor expired: 1, evicted: 1
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/547 (fetch/transfer)
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/882 (fetch/transfer)
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/1228 (fetch/transfer)
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/1570 (fetch/transfer)
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/1918 (fetch/transfer)
D/BufferPoolAccessor2.0(32732): bufferpool2 0xb4000079753c60a8 : 4(25067520 size) total buffers - 4(25067520 size) used buffers - 0/4 (recycle/alloc) - 4/2264 (fetch/transfer)
Hi @ScorpiosCrux, thanks for joining in.
Behavior varies on different devices at times, especially in hardware decoding.
Can you try these configurations on your device? The first one seems to be default in mpv; but I experienced crashes.
configuration: const VideoControllerConfiguration(
vo: 'gpu',
hwdec: 'mediacodec',
),
configuration: const VideoControllerConfiguration(
vo: 'mediacodec_embed',
hwdec: 'mediacodec',
),
Also:
Hello, I have added
configuration: const VideoControllerConfiguration(
vo: 'mediacodec_embed',
hwdec: 'mediacodec',
),
and now the video is playing very smoothly with no more than 10% CPU usage.
Thanks for the help!
--vo=mediacodec_embed
is very (very-very) efficient; beats-off anything that exists for Android.
While this happens to work on your device, it may yield a crash on some (older or low-end) devices. An approach for package:media_kit can be to select configurations based on the device chipset (select the most efficient where it's safe). This process will obviously rely upon reports from the users.
I am back with an update.
I am testing the code on 2 devices:
RK3588 quad-core Cortex-A76 and quad-core Cortex-A55
Rockchip RK3588S 8-core 64-bit processor
Two issues:
What I have tried:
... const VideoControllerConfiguration( vo: "gpu", hwdec: "rkmpp", width: 3840, height: 2160, enableHardwareAcceleration: true);
... const VideoControllerConfiguration( vo: "mediacodec_embed", hwdec: "mediacodec", width: 3840, height: 2160, enableHardwareAcceleration: true);
Any suggestions? Also, you mentioned you tested it with 8K 60 FPS, do you know what hardware you tested it on?
I suppose it's not related to hardware problem (this issue is actually opened for it), then.
8K 60FPS is actually heavy for any mobile chipset.
Natively, Android has that android.view.SurfaceHolder
which dynamically sets the render surface size based on the "mount" size.
But, here in Flutter I manually set the render surface size using android.graphics.SurfaceTexture.setDefaultBufferSize
based on video resolution.
See:
You mentioned you tested 8K 60FPS on some hardware, what hardware did you use?
My good ol' Redmi Note 10S with G95.
Hi @ScorpiosCrux, thanks for joining in.
Behavior varies on different devices at times, especially in hardware decoding.
Can you try these configurations on your device? The first one seems to be default in mpv; but I experienced crashes.
configuration: const VideoControllerConfiguration( vo: 'gpu', hwdec: 'mediacodec', ),
configuration: const VideoControllerConfiguration( vo: 'mediacodec_embed', hwdec: 'mediacodec', ),
Hi @ScorpiosCrux, thanks for joining in.
Behavior varies on different devices at times, especially in hardware decoding.
Can you try these configurations on your device? The first one seems to be default in mpv; but I experienced crashes.
configuration: const VideoControllerConfiguration( vo: 'gpu', hwdec: 'mediacodec', ),
configuration: const VideoControllerConfiguration( vo: 'mediacodec_embed', hwdec: 'mediacodec', ),
Is there any similar configuration for macos and windows? it's lagging in macos and windows.
What's your video resolution & hardware specification?
@alexmercerind In my application I have allowed upto 5MB and the video I uploaded is 814KB and also it's lagging if I upload and play audio file (52kb) mainly it's lagging when I play 3-4 audio or video files then the application completely stuck
Have you added media_kit_native_event_loop?
I won't be able to help out with just remarks like these. package:media_kit outperforms Google Chrome if we talk raw performance. Share logs, sample files, platform, specs or at-least the video resolution.
Make sure you dispose Player
s correctly too.
I am not getting any error logs. will share sample files. disposing Player correctly but I didn't added media_kit_native_event_loop. will add this.
A stable version has been rolled out. A number of major enhancements.
Please refer to the "Installation" section of the README to receive the update.
Now direct mediacodec is used on Android, which will greatly enhance the performance. The stability has also been improved.
@BulbulRathore
The current video playback performance is comparable to that in Chromium/Google-Chrome on Windows. This is the performance on my 350$ laptop having entry-level Ryzen 3 2200U with integrated Radeon Vega 3 graphics. It should be better on a more capable GPU/CPU.
Check your video drivers or the presence of media_kit_native_event_loop, which adds support for more simultaneous videos.
Video not playing smoothly, it always print these logs when lagging...