0

VLC.Dotnet.WPF 控件拉伸纵向视频。如何让控件不拉伸视频。横向视频播放正常,当我在手机上录制视频时,例如 .mov 在纵向模式下它会拉伸视频。

如何在不被拉伸的情况下播放视频?有没有可以通过 CreatePlayer 方法的选项?

.xaml

<Grid>
   <vlc:VlcControl x:Name="MediaPlayerOne"
                   VerticalAlignment="Center"
                   HorizontalAlignment="Center" />
</Grid>

。CS

        var currentAssembly = Assembly.GetEntryAssembly();
        var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
        // Default installation path of VideoLAN.LibVLC.Windows
        var libDirectory = new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));

        MediaPlayerOne.SourceProvider.CreatePlayer(libDirectory);
        MediaPlayerOne.SourceProvider.MediaPlayer.Play(new Uri("text.mov"));
4

2 回答 2

0

您可以尝试像这样的各种纵横比

MediaPlayerOne.Video.AspectRatio = "4:3";
MediaPlayerOne.Video.AspectRatio = "16:9";
于 2021-03-15T01:03:35.300 回答
0

这里有问题https://github.com/ZeBobo5/Vlc.DotNet/blob/develop/src/Vlc.DotNet.Wpf/VlcVideoSourceProvider.cs或 libvlc 没有发送正确的视频比例(即原始旋转前的尺寸,而您期望相反)。您可以尝试克隆 Vlc.DotNet 并进一步调查吗?

于 2021-03-15T20:38:42.110 回答