FFMediaToolkit
FFMediaToolkit copied to clipboard
Incorrect rotation calculation
I think something wrong with rotation in current version. https://github.com/radek-k/FFMediaToolkit/blob/master/FFMediaToolkit/Decoding/VideoStreamInfo.cs#L32
Previous version:
4.5.1. FFmpeg 6.1
var file = MediaFile.Open(@"C:\out.webm");
Console.WriteLine(file.VideoStreams.First().Info.Rotation); //=> 90
Current version:
4.6.0. FFmpeg 7.1
var file = MediaFile.Open(@"C:\out.webm");
Console.WriteLine(file.VideoStreams.First().Info.Rotation); //=> 179,99999966727137
Oh well, you should pass value like this.
var packetSideData = ffmpeg.av_packet_side_data_get(codec->coded_side_data, codec->nb_coded_side_data, AVPacketSideDataType.AV_PKT_DATA_DISPLAYMATRIX);
if (packetSideData != null)
{
Rotation = CalculateRotation((IntPtr)packetSideData->data);
}