gpt4 book ai didi

android - 带有 ExoPlayer 的 MPEG-TS H.264

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:10:35 24 4
gpt4 key购买 nike

我有两个 mpeg-ts + h.264 视频文件,我尝试使用 ExoPlayer 在 Android 设备(Samsung Tab A 10.1")上阅读它们:

SimpleExoPlayerView view = new SimpleExoPlayerView(this);
TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveVideoTrackSelection.Factory(new DefaultBandwidthMeter());
TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
SimpleExoPlayer mediaPlayer = ExoPlayerFactory.newSimpleInstance(this, trackSelector, new DefaultLoadControl());
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this, Util.getUserAgent(this, getString(R.string.app_name)));
ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
MediaSource source = new ExtractorMediaSource(uri, dataSourceFactory, extractorsFactory, null, null);
view.setPlayer(mediaPlayer);
mediaPlayer.setPlayWhenReady(true);
mediaPlayer.prepare(source);

第一个成功(图像正确显示)但第二个失败(不显示图像),尽管它们在视频特性方面非常相似。我想了解原因。

我使用 mediainfo 来提取视频编码细节。

第一个视频(成功):

General
ID : 0 (0x0)
Complete name : 1080i.ts
Format : MPEG-TS
File size : 56.7 MiB
Duration : 47s 456ms
Overall bit rate mode : Constant
Overall bit rate : 10.0 Mbps

Video
ID : 256 (0x100)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : 27
Duration : 47s 282ms
Bit rate : 9 185 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Bits/(Pixel*Frame) : 0.148
Stream size : 51.8 MiB (91%)

第二个视频(失败):

General
ID : 1 (0x1)
Complete name : fr5.ts
Format : MPEG-TS
File size : 13.8 MiB
Duration : 32s 270ms
Overall bit rate mode : Variable
Overall bit rate : 3 557 Kbps

Video
ID : 420 (0x1A4)
Menu ID : 1045 (0x415)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : 27
Duration : 31s 760ms
Bit rate : 3 252 Kbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : Component
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : MBAFF
Bits/(Pixel*Frame) : 0.063
Stream size : 12.3 MiB (89%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709

最佳答案

两个文件之间最显着的区别在于比特率。工作的具有更高的比特率,并且它是恒定的,而损坏的具有相同的高分辨率,但比特率低得多且可变。除了提供的统计数据之外,我不知道更多,我会责怪用于编码视频的工具。也许有关配置的某些内容导致编码器输出黑帧。您是否在不同的设备上尝试过相同的文件?您可以使用稍微不同的设置重新编码吗?

关于android - 带有 ExoPlayer 的 MPEG-TS H.264,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43073827/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com