android - 使用 ExoPlayer 时 4k 视频出现大量丢帧
问题描述
我正在尝试用来exoplayer
播放我的本地 4k 视频文件。但是,帧率下降了很多。我试图限制视频大小和缓冲时间,但似乎没有用。
DefaultLoadControl loadControl = new DefaultLoadControl.Builder()
.setBufferDurationsMs(1000, 1000, 500, 500)
.build();
DefaultTrackSelector trackSelector = new DefaultTrackSelector(getContext());
DefaultTrackSelector.ParametersBuilder builder =
new DefaultTrackSelector.ParametersBuilder(getContext());
builder.setMaxVideoSize(300, 500);
trackSelector.setParameters(builder);
trackSelector.setParameters(builder.build());
exoPlayer = new SimpleExoPlayer.Builder(getContext())
.setTrackSelector(trackSelector)
.setLoadControl(loadControl)
.build();
你们有什么建议吗?可以使用 ExoPlayer 演示应用轻松复制它。使用 可以很好地播放视频,没有任何问题MediaPlayer
,但我想要 ExoPlayer 的一些增强功能。
P/s:视频可以在这里下载https://github.com/google/ExoPlayer/issues/9062。
这是我从 logcat 得到的:
2021-06-16 21:55:20.659 24844-25131/ W/AudioCapabilities: Unsupported mime audio/x-ima
2021-06-16 21:55:20.673 24844-25131/ W/AudioCapabilities: Unsupported mime audio/mpeg-L1
2021-06-16 21:55:20.674 24844-25131/ W/AudioCapabilities: Unsupported mime audio/mpeg-L2
2021-06-16 21:55:20.683 24844-25131/ W/AudioCapabilities: Unsupported mime audio/x-ms-wma
2021-06-16 21:55:20.741 24844-25131/ W/VideoCapabilities: Unsupported mime video/mp43
2021-06-16 21:55:20.754 24844-25131/ W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2021-06-16 21:55:20.754 24844-25131/ W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
2021-06-16 21:55:20.754 24844-25131/ W/VideoCapabilities: Unrecognized profile/level 32768/64 for video/mp4v-es
2021-06-16 21:55:20.759 24844-25131/ W/VideoCapabilities: Unsupported mime video/wvc1
2021-06-16 21:55:20.762 24844-25131/ W/VideoCapabilities: Unsupported mime video/wvc1
2021-06-16 21:55:20.783 24844-25131/ W/VideoCapabilities: Unsupported mime video/x-ms-wmv7
2021-06-16 21:55:20.786 24844-25131/ W/VideoCapabilities: Unsupported mime video/x-ms-wmv8
2021-06-16 21:55:20.820 24844-25131/ I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2021-06-16 21:55:20.849 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.Exynos.avc.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.850 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.SEC.avc.sw.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.851 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.Exynos.avc.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.851 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.SEC.avc.sw.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.867 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.Exynos.avc.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.869 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.SEC.avc.sw.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.869 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.Exynos.avc.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.869 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.SEC.avc.sw.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.890 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.Exynos.avc.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.892 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.SEC.avc.sw.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.892 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.Exynos.avc.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.893 24844-25131/ D/MediaCodecInfo: NoSupport [codec.profileLevel, avc1.4D4034, video/avc] [OMX.SEC.avc.sw.dec, video/avc] [on7xelte, SM-G610F, samsung, 27]
2021-06-16 21:55:20.897 24844-25131/ I/ACodec: [] Now uninitialized
2021-06-16 21:55:20.897 24844-25135/ I/ACodec: [] onAllocateComponent
2021-06-16 21:55:20.902 24844-25135/ I/OMXClient: Treble IOmx obtained
2021-06-16 21:55:20.907 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Loaded
2021-06-16 21:55:20.909 24844-25134/ D/SurfaceUtils: connecting to surface 0xca11d808, reason connectToSurface
2021-06-16 21:55:20.910 24844-25134/ I/MediaCodec: [OMX.google.h264.decoder] setting surface generation to 25440257
2021-06-16 21:55:20.910 24844-25134/ D/SurfaceUtils: disconnecting from surface 0xca11d808, reason connectToSurface(reconnect)
2021-06-16 21:55:20.910 24844-25134/ D/SurfaceUtils: connecting to surface 0xca11d808, reason connectToSurface(reconnect)
2021-06-16 21:55:20.912 24844-25135/ E/ACodec: [OMX.google.h264.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
2021-06-16 21:55:20.912 24844-25135/ I/ACodec: can't find wfdsink-exynos-enable
2021-06-16 21:55:20.914 24844-25135/ I/ACodec: codec does not support config priority (err -1010)
2021-06-16 21:55:20.914 24844-25135/ I/ACodec: codec does not support config operating rate (err -1010)
2021-06-16 21:55:20.920 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Loaded->Idle
2021-06-16 21:55:20.936 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Idle->Executing
2021-06-16 21:55:20.938 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Executing
2021-06-16 21:55:20.952 24844-25131/ I/ACodec: [] Now uninitialized
2021-06-16 21:55:20.952 24844-25141/ I/ACodec: [] onAllocateComponent
2021-06-16 21:55:20.954 24844-25141/ I/OMXClient: Treble IOmx obtained
2021-06-16 21:55:20.957 24844-25141/ I/ACodec: [OMX.google.aac.decoder] Now Loaded
2021-06-16 21:55:20.958 24844-25141/ I/ACodec: codec does not support config priority (err -2147483648)
2021-06-16 21:55:20.959 24844-25141/ I/ACodec: codec does not support config operating rate (err -2147483648)
2021-06-16 21:55:20.960 24844-25141/ I/ACodec: [OMX.google.aac.decoder] Now Loaded->Idle
2021-06-16 21:55:20.978 24844-25141/ I/ACodec: [OMX.google.aac.decoder] Now Idle->Executing
2021-06-16 21:55:20.978 24844-25141/ I/ACodec: [OMX.google.aac.decoder] Now Executing
2021-06-16 21:55:20.984 24844-25141/ I/ACodec: [OMX.google.aac.decoder] Now handling output port settings change
2021-06-16 21:55:20.990 24844-25141/ I/ACodec: [OMX.google.aac.decoder] Now Executing
2021-06-16 21:55:23.547 24844-25134/ I/ACodec: [OMX.google.h264.decoder] signalFlush
2021-06-16 21:55:23.547 24844-25135/ I/ACodec: [OMX.google.h264.decoder] ExecutingState flushing now (codec owns 7/8 input, 7/8 output).
2021-06-16 21:55:23.547 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Flushing
2021-06-16 21:55:23.736 24844-25135/ I/ACodec: [OMX.google.h264.decoder] FlushingState onOMXEvent(0,1,0)
2021-06-16 21:55:23.736 24844-25135/ I/ACodec: [OMX.google.h264.decoder] FlushingState onOMXEvent(0,1,1)
2021-06-16 21:55:23.736 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Executing
2021-06-16 21:55:25.541 24844-25134/ I/ACodec: [OMX.google.h264.decoder] signalFlush
2021-06-16 21:55:25.542 24844-25135/ I/ACodec: [OMX.google.h264.decoder] ExecutingState flushing now (codec owns 7/8 input, 7/8 output).
2021-06-16 21:55:25.542 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Flushing
2021-06-16 21:55:25.737 24844-25135/ I/ACodec: [OMX.google.h264.decoder] FlushingState onOMXEvent(0,1,0)
2021-06-16 21:55:25.737 24844-25135/ I/ACodec: [OMX.google.h264.decoder] FlushingState onOMXEvent(0,1,1)
2021-06-16 21:55:25.737 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Executing
2021-06-16 21:55:27.519 24844-25134/ I/ACodec: [OMX.google.h264.decoder] signalFlush
2021-06-16 21:55:27.519 24844-25135/ I/ACodec: [OMX.google.h264.decoder] ExecutingState flushing now (codec owns 7/8 input, 7/8 output).
2021-06-16 21:55:27.519 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Flushing
2021-06-16 21:55:27.712 24844-25135/ I/ACodec: [OMX.google.h264.decoder] FlushingState onOMXEvent(0,1,0)
2021-06-16 21:55:27.712 24844-25135/ I/ACodec: [OMX.google.h264.decoder] FlushingState onOMXEvent(0,1,1)
2021-06-16 21:55:27.712 24844-25135/ I/ACodec: [OMX.google.h264.decoder] Now Executing
2021-06-16 21:55:28.574 24844-24852/ I/zygote: Do full code cache collection, code=252KB, data=204KB
2021-06-16 21:55:28.576 24844-24852/ I/zygote: After code cache collection, code=218KB, data=150KB
解决方案
推荐阅读
- python - date - offsets.MonthBegin(1) 如果日期是本月的第一天,则返回上个月
- ruby-on-rails - Rails 5:在范围内使用模型函数
- python - 尝试使用python将输入的UTC时间转换为太平洋时间
- reactjs - 什么在构建期间呈现 Create React App html 模板
- javascript - 由于过滤器导致表达式更改,*ngIf 的渲染延迟 - Angular
- c# - 从服务器执行查询时的记录数不同
- xcode - Xcode 11 - 模拟器不会响应
- xpath - 当我提出稍微复杂的请求时,Google 表格中的 IMPORTXML 返回 N/D
- javascript - 使用 twilio javascript 客户端呼叫号码时捕获接受事件
- bash - 如果服务器在 bash 中不可 ping,如何抛出错误