unosquare/ffmediaelement

ffme:MediaElement shows a wrong rotated frame at begin.

Yishan001 opened this issue · 1 comments

Issue Title (ffme:MediaElement shows a wrong rotated frame at begin.)

When just call ffme:MediaElement open (without play) a '.mov' video(captured by iphone), it has a wrong rotated frame shown flickly at begin.
upload .mov video here: https://user-images.githubusercontent.com/11456033/194298421-3051e2a9-3767-456e-ba72-04807eb8b2e4.mov
Other mp4 videos don't have this issue.
Maybe it's the ffme bug or .net framework bug, or others?

Issue Categories

  • Bug

Version Information

  • NuGet Package 4.4.350
  • Visual Studio 2022, .Net Framework 6.0(Long-term support)

Steps to Reproduce

  1. Using below xaml and C# codes (pls change files path).
  2. Build and run.
  3. Click the button. This issue will be shown at first click.

Expected Results

  • Result: Show the right rotated frame directly without the flicking issue.

Sample Code

XAML

<Window x:Class="testFFME.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:ffme="clr-namespace:Unosquare.FFME;assembly=ffme.win"
        xmlns:local="clr-namespace:testFFME"
        mc:Ignorable="d"
        Title="MainWindow" Height="900" Width="900">
    <Grid>
        <StackPanel>
            <ffme:MediaElement x:Name="Media" Background="Gray" LoadedBehavior="Manual" UnloadedBehavior="Manual" Width="720" Height="720"/>
            <Button Height="20" Width="80" Margin="0, 50, 0, 0" Click="Button_Click" />
        </StackPanel>
    </Grid>
</Window>

C#

public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            Unosquare.FFME.Library.FFmpegDirectory = @"D:\ffmpeg\bin";
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var currentVideoFile = @"D:\photos\0CE100B3-8835-4E31-A1B2-692FDC64FBD2.mov";
            Media.Open(new Uri(currentVideoFile)).GetAwaiter();
        }
    }

add the wrong rotated frame picture.

Screen Shot 2022-10-08 at 00 47 01