0

我正在使用 LibVlcSharp 在我的 Xamarin.Forms 应用程序中使用 EncoderNamedPreset.AdaptiveStreaming 设置播放由 Azure 媒体服务转码的自适应视频流 (HLS)。

观看我的视频时,我注意到视频的前几 (5-6) 秒非常模糊。

这可能是因为播放器以“安全”的低比特率开始,并且在下载了几块数据之后,它确定带宽足以显示更高质量的视频,并且可以切换质量。

最初几秒钟的低质量困扰着我,我宁愿让它以更高的比特率开始。

如果视频能更快地切换(<2 秒),我会很高兴,这可能意味着我需要一个不同的编码器设置来产生更小的视频“块”。

但也许更简单的解决方案是将起始比特率设置为更高的值。

我在其他媒体播放器上看到过这种情况,形式为 ams.InitialBitrate = ams.AvailableBitrates.Max<uint>();

LibVlc 有类似的选项吗?

4

1 回答 1

2

This is probably because the player starts with a "safe" low bitrate, and after a few chunks of data have been downloaded, it determines that the bandwith is sufficient for a higher quality video being displayed and it can switch up in quality.

Probably. You could verify that assumption by checking the bitrate at the start at the video and again when the quality improved, like this:

await media.Parse(MediaParseOptions.ParseNetwork);

foreach(var track in media.Tracks)
{
    Debug.WriteLine($"{nameof(track.Bitrate)}: {track.Bitrate}");
}

Does LibVlc have a similar option?

Try this

  --adaptive-logic={,predictive,nearoptimal,rate,fixedrate,lowest,highest} 
                                 Adaptive Logic

You can try it like new LibVLC("--adaptive-logic=highest")

See the docs for more info, or the forums. If that does not work, I'd set it server-side.

于 2021-02-16T02:15:59.687 回答