防止Flutter中通过video_player使用的ExoPlayer滥发日志 [英] Preventing ExoPlayer used via video_player in Flutter from spamming the logs

查看:424
本文介绍了防止Flutter中通过video_player使用的ExoPlayer滥发日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我在 video_player 中播放新文件时,我都会获得一长串日志,因此看我自己的日志要困难得多.大量使用Logging值信息和是否有办法使video_player的聊天性降低很多?

Whenever I play a new file in my video_player I get a long list of logs which makes it a lot harder to see my own logging. A lot of it with Logging value info and hi Is there a way to make the video_player a lot less chatty?

I/ExoPlayerImpl(21717): Init d44ef38 [ExoPlayerLib/2.9.6] [crosshatch, Pixel 3 XL, Google, 29]
W/MetadataUtil(21717): Failed to parse index/count attribute: trkn
D/CCodec  (21717): allocate(c2.qti.avc.decoder)
I/Codec2Client(21717): Creating a Codec2 client to service "default"
I/Codec2Client(21717): Client to Codec2 service "default" created
I/CCodec  (21717): setting up 'default' as default (vendor) store
I/CCodec  (21717): Created component [c2.qti.avc.decoder]
D/CCodecConfig(21717): read media type: video/avc
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: output.buffers.pool-ids.values
D/CCodecConfig(21717): ignoring local param raw.size (0xd2001800) as it is already supported
D/CCodecConfig(21717): ignoring local param raw.color (0xd2001809) as it is already supported
D/CCodecConfig(21717): ignoring local param raw.hdr-static-info (0xd200180a) as it is already supported
I/CCodecConfig(21717): query failed after returning 17 values (BAD_INDEX)
D/CCodecConfig(21717): c2 config diff is Dict {
D/CCodecConfig(21717):   c2::i32 algo.priority.value = -1
D/CCodecConfig(21717):   c2::float algo.rate.value = 4.2039e-44
D/CCodecConfig(21717):   c2::u32 algo.secure-mode.value = 0
D/CCodecConfig(21717):   c2::float coded.frame-rate.value = 30
D/CCodecConfig(21717):   c2::u32 coded.pl.level = 20480
D/CCodecConfig(21717):   c2::u32 coded.pl.profile = 20480
D/CCodecConfig(21717):   c2::u32 coded.vui.color.matrix = 0
D/CCodecConfig(21717):   c2::u32 coded.vui.color.primaries = 0
D/CCodecConfig(21717):   c2::u32 coded.vui.color.range = 0
D/CCodecConfig(21717):   c2::u32 coded.vui.color.transfer = 0
D/CCodecConfig(21717):   c2::u32 default.color.matrix = 0
D/CCodecConfig(21717):   c2::u32 default.color.primaries = 3
D/CCodecConfig(21717):   c2::u32 default.color.range = 2
D/CCodecConfig(21717):   c2::u32 default.color.transfer = 0
D/CCodecConfig(21717):   c2::u32 input.buffers.max-size.value = 13271040
D/CCodecConfig(21717):   c2::u32 input.delay.value = 4
D/CCodecConfig(21717):   string input.media-type.value = "video/avc"
D/CCodecConfig(21717):   c2::u32 output.delay.value = 18
D/CCodecConfig(21717):   string output.media-type.value = "video/raw"
D/CCodecConfig(21717):   c2::u32 raw.color.matrix = 0
D/CCodecConfig(21717):   c2::u32 raw.color.primaries = 0
D/CCodecConfig(21717):   c2::u32 raw.color.range = 0
D/CCodecConfig(21717):   c2::u32 raw.color.transfer = 0
D/CCodecConfig(21717):   c2::float raw.hdr-static-info.mastering.blue.x = 1.4013e-45
D/CCodecConfig(21717):   c2::float raw.hdr-static-info.mastering.blue.y = 1.4013e-45
D/CCodecConfig(21717):   c2::float raw.hdr-
W/ColorUtils(21717): expected specified color aspects (0:0:0:0)
D/SurfaceUtils(21717): connecting to surface 0x7669bd6010, reason connectToSurface
I/MediaCodec(21717): [c2.qti.avc.decoder] setting surface generation to 22238212
D/SurfaceUtils(21717): disconnecting from surface 0x7669bd6010, reason connectToSurface(reconnect)
D/SurfaceUtils(21717): connecting to surface 0x7669bd6010, reason connectToSurface(reconnect)
D/CCodecConfig(21717): no c2 equivalents for csd-1
D/CCodecConfig(21717): no c2 equivalents for native-window
D/CCodecConfig(21717): c2 config diff is   c2::i32 algo.priority.value = 0
D/CCodecConfig(21717):   c2::u32 input.buffers.max-size.value = 393216
D/CCodecConfig(21717):   c2::u32 raw.max-size.height = 450
D/CCodecConfig(21717):   c2::u32 raw.max-size.width = 500
D/CCodecConfig(21717):   c2::u32 raw.pixel-format.value = 34
D/CCodecConfig(21717):   c2::u32 raw.size.height = 450
D/CCodecConfig(21717):   c2::u32 raw.size.width = 500
W/Codec2Client(21717): query -- param skipped: index = 1107298332.
D/CCodec  (21717): client requested max input size 6306, which is smaller than what component recommended (393216); overriding with component recommendation.
W/CCodec  (21717): This behavior is subject to change. It is recommended that app developers double check whether the requested max input size is in reasonable range.
D/CCodec  (21717): setup formats input: AMessage(what = 0x00000000) = {
D/CCodec  (21717):   int32_t feature-secure-playback = 0
D/CCodec  (21717):   int32_t frame-rate = 30
D/CCodec  (21717):   int32_t height = 450
D/CCodec  (21717):   int32_t level = 1
D/CCodec  (21717):   int32_t max-input-size = 393216
D/CCodec  (21717):   string mime = "video/avc"
D/CCodec  (21717):   int32_t priority = 0
D/CCodec  (21717):   int32_t profile = 1
D/CCodec  (21717):   int32_t width = 500
D/CCodec  (21717):   Rect crop(0, 0, 499, 449)
D/CCodec  (21717): } and output: AMessage(what = 0x00000000) = {
D/CCodec  (21717):   int32_t android._video-scaling = 1
D/CCodec  (21717):   Rect crop(0, 0, 499, 449)
D/CCodec  (21717):   int32_t color-standard = 2
D/CCodec  (21717):   int32_t color-range = 2
D/CCodec  (21717):   int32_t color-transfer = 3
D/CCodec  (21717):   int32_t android._dataspace = 258
D/CCodec  (21717):   int32_t width = 500
D/CCodec  (21717):   int32_t feature-secure-playback = 0
D/CCodec  (21717):   int32_t frame-rate = 30
D/CCodec  (21717):   int32_t height = 450
D/CCodec  (21717):   int32_t max-height = 450
D/CCodec  (21717):   int32_t max-width = 500
D/CCodec  (21717):   string mime = "video/raw"
D/CCodec  (21717):   int32_t priority = 0
D/CCodec  (21717):   int32_t rotation-degrees = 0
D/CCodec  (21717):   Buffer hdr-static-info = {
D/CCodec  (21717):     00000000:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
D/CCodec  (21717):     00000010:  00 00 00 00 00 00 00 00  00                       .........
D/CCodec  (21717):   }
D/CCodec  (21717):   int32_t android._color-format = 21307083
W/Codec2Client(21717): query -- param skipped: index = 1342179345.
W/Codec2Client(21717): query -- param skipped: index = 2415921170.
W/Codec2Client(21717): query -- param skipped: index = 1610614798.
D/CCodecBufferChannel(21717): [c2.qti.avc.decoder#139] Query input allocators returned 0 params => BAD_INDEX (6)
D/BufferPoolAccessor(21717): bufferpool2 0x76406c5620 : 8(3145728 size) total buffers - 8(3145728 size) used buffers - 0/8 (recycle/alloc) - 8/77 (fetch/transfer)
D/BufferPoolAccessor(21717): bufferpool2 0x7668ace020 : 5(40960 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/129 (fetch/transfer)
D/BufferPoolAccessor(21717): bufferpool2 0x76408a3020 : 10(3932160 size) total buffers - 10(3932160 size) used buffers - 0/12 (recycle/alloc) - 12/77 (fetch/transfer)
D/BufferPoolAccessor(21717): bufferpool2 0x76c4dcd820 : 6(49152 size) total buffers - 5(40960 size) used buffers - 1/7 (recycle/alloc) - 6/129 (fetch/transfer)
D/CCodecBufferChannel(21717): [c2.qti.avc.decoder#139] Created input block pool with allocatorID 16 => poolID 23 - OK (0)
D/CCodecBufferChannel(21717): [c2.qti.avc.decoder#139] Query output allocators returned 0 params => BAD_INDEX (6)
D/CCodecBufferChannel(21717): [c2.qti.avc.decoder#139] Query output surface allocator returned 0 params => BAD_INDEX (6)
I/CCodecBufferChannel(21717): [c2.qti.avc.decoder#139] Created output block pool with allocatorID 18 => poolID 68 - OK
D/CCodecBufferChannel(21717): [c2.qti.avc.decoder#139] Configured output block pool ids 68 => OK
D/Codec2-block_helper(21717): remote graphic buffer migration 0/0
D/Codec2Client(21717): generation remote change 22238212
D/BufferPoolAccessor(21717): Destruction - bufferpool2 0x76c468f220 cached: 0/0M, 0/0% in use; allocs: 8, 0% recycled; transfers: 77, 90% unfetced
D/CCodec  (21717): allocate(c2.android.aac.decoder)
I/Codec2Client(21717): Creating a Codec2 client to service "default"
I/Codec2Client(21717): Client to Codec2 service "default" created
I/CCodec  (21717): setting up 'default' as default (vendor) store
I/CCodec  (21717): Created component [c2.android.aac.decoder]
D/CCodecConfig(21717): read media type: audio/mp4a-latm
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: algo.buffers.max-count.values
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: output.subscribed-indices.values
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: input.buffers.allocator-ids.values
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: output.buffers.allocator-ids.values
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: algo.buffers.allocator-ids.values
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: output.buffers.pool-ids.values
D/ReflectedParamUpdater(21717): extent() != 1 for single value type: algo.buffers.pool-ids.values
D/CCodecConfig(21717): c2 config diff is   c2::u32 raw.color.primaries = 3
D/CCodecConfig(21717):   c2::u32 raw.color.range = 2
D/CCodecConfig(21717):   c2::u32 raw.crop.height = 450
D/CCodecConfig(21717):   c2::u32 raw.crop.left = 0
D/CCodecConfig(21717):   c2::u32 raw.crop.top = 0
D/CCodecConfig(21717):   c2::u32 raw.crop.width = 500
I/CCodecConfig(21717): query failed after returning 16 values (BAD_INDEX)
D/CCodecConfig(21717): c2 config diff is Dict {
D/CCodecConfig(21717):   c2::u32 coded.aac-packaging.value = 0
D/CCodecConfig(21717):   c2::u32 coded.bitrate.value = 64000
D/CCodecConfig(21717):   c2::u32 coded.pl.level = 0
D/CCodecConfig(21717):   c2::u32 coded.pl.profile = 8192
D/CCodecConfig(21717):   c2::float coding.drc.attenuation-factor.value = 1
D/CCodecConfig(21717):   c2::float coding.drc.boost-factor.value = 1
D/CCodecConfig(21717):   c2::i32 coding.drc.compression-mode.value = 3
D/CCodecConfig(21717):   c2::i32 coding.drc.effect-type.value = 3
D/CCodecConfig(21717):   c2::float coding.drc.encoded-level.value = 0.25
D/CCodecConfig(21717):   c2::float coding.drc.reference-level.value = -16
D/CCodecConfig(21717):   c2::u32 input.buffers.max-size.value = 8192
D/CCodecConfig(21717):   c2::u32 input.delay.value = 0
D/CCodecConfig(21717):   string input.media-type.value = "audio/mp4a-latm"
D/CCodecConfig(21717):   c2::u32 output.delay.value = 2
D/CCodecConfig(21717):   string output.media-type.value = "audio/raw"
D/CCodecConfig(21717):   c2::u32 raw.channel-count.value = 1
D/CCodecConfig(21717):   c2::u32 raw.sample-rate.value = 44100
D/CCodecConfig(21717): }
D/CCodecConfig(21717): config failed => CORRUPTED
D/CCodecConfig(21717): c2 config diff is   c2::u32 raw.channel-count.value = 2
W/Codec2Client(21717): query -- param skipped: index = 1107298332.
D/CCodec  (21717): client requested max input size 399, which is smaller than what component recommended (8192); overriding with component recommendation.
W/CCodec  (21717): This behavior is subject to change. It is recommended that app developers double check whether the requested max input size is in reasonable range.
D/CCodec  (21717): setup formats input: AMessage(what = 0x00000000) = {
D/CCodec  (21717):   int32_t channel-count = 2
D/CCodec  (21717):   int32_t level = 0
D/CCodec  (21717):   int32_t max-input-size = 8192
D/CCodec  (21717):   string mime = "audio/mp4a-latm"
D/CCodec  (21717):   int32_t profile = 2
D/CCodec  (21717):   int32_t sample-rate = 44100
D/CCodec  (21717): } and output: AMessage(what = 0x00000000) = {
D/CCodec  (21717):   int32_t channel-count = 2
D/CCodec  (21717):   string mime = "audio/raw"
D/CCodec  (21717):   int32_t sample-rate = 44100
D/CCodec  (21717): }
W/Codec2Client(21717): query -- param skipped: index = 1342179345.
W/Codec2Client(21717): query -- param skipped: index = 2415921170.
W/Codec2Client(21717): query -- param skipped: index = 1610614798.
D/CCodecBufferChannel(21717): [c2.android.aac.decoder#582] Created input block pool with allocatorID 16 => poolID 24 - OK (0)
D/BufferPoolAccessor(21717): Destruction - bufferpool2 0x76c4d5c420 cached: 0/0M, 0/0% in use; allocs: 7, 14% recycled; transfers: 129, 95% unfetced
I/CCodecBufferChannel(21717): [c2.android.aac.decoder#582] Created output block pool with allocatorID 16 => poolID 78 - OK
D/CCodecBufferChannel(21717): [c2.android.aac.decoder#582] Configured output block pool ids 78 => OK
D/AudioTrack(21717): getTimestamp_l(414): device stall time corrected using current time 13946010578548
W/AudioTrack(21717): getTimestamp_l(414): retrograde timestamp time corrected, 13946013355111 < 13946020549903
I/ExoPlayerImpl(21717): Release c26b052 [ExoPlayerLib/2.9.6] [crosshatch, Pixel 3 XL, Google, 29] [goog.exo.core]
D/SurfaceUtils(21717): disconnecting from surface 0x76bfc5e010, reason disconnectFromSurface
E/BufferQueueProducer(21717): [SurfaceTexture-0-21717-1] detachBuffer: BufferQueue has been abandoned
D/BufferPoolAccessor(21717): Destruction - bufferpool2 0x76406c5620 cached: 0/0M, 0/0% in use; allocs: 8, 0% recycled; transfers: 77, 90% unfetced
D/BufferPoolAccessor(21717): Destruction - bufferpool2 0x7668ace020 cached: 0/0M, 0/0% in use; allocs: 7, 14% recycled; transfers: 129, 95% unfetced
D/AudioTrack(21717): stop(414): called with 129024 frames delivered

推荐答案

Exoplayer提供程序提供了一个用于配置Log的类. https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/util/Log.html

Exoplayer provider a class to config Log. https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/util/Log.html

您可以尝试:

1,将实现添加到模块android的gradle中.

1, Add implement to your gradle of module android.

implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'

2,配置登录 MainActivity

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    Log.setLogLevel(LOG_LEVEL_OFF)
}

希望有帮助!

这篇关于防止Flutter中通过video_player使用的ExoPlayer滥发日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆