-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Internal CLR error with square video with 600x600 resolution #104
Comments
Can you provide sample video? and extracting works without any issue. |
@hey-red here is a WeTransfer with a sample video that crashes for me: https://we.tl/t-oyirFjcUju I'm using a windows build I can also reproduce it in a linux environment inside docker with ffmpeg |
This is a full example that crashes with video provided above: using System;
using FFMediaToolkit;
using FFMediaToolkit.Decoding;
using FFMediaToolkit.Graphics;
namespace FfmpegCrashTest
{
class Program
{
static void Main(string[] args)
{
FFmpegLoader.FFmpegPath = "C:\\Users\\Salmondx\\Downloads\\ffmpeg-n4.3.1-19-gaf2a430bb1-win64-gpl-shared-4.3\\ffmpeg-n4.3.1-19-gaf2a430bb1-win64-gpl-shared-4.3\\bin";
MediaOptions options = new MediaOptions()
{
StreamsToLoad = MediaMode.Video,
VideoPixelFormat = ImagePixelFormat.Rgba32,
};
var _file = MediaFile.Open("C:\\Users\\Salmondx\\Documents\\job\\videos\\sample600x600-test.mp4", options);
if (!_file.HasVideo)
{
throw new Exception($"Can't create video resource. Source file of resource doesn't have video stream.");
}
var _videoStream = _file.Video;
ImageData imageData;
bool success = true;
while (success)
{
success = _videoStream.TryGetNextFrame(out imageData);
}
}
}
} And csproj file: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FFMediaToolkit" Version="4.1.1" />
</ItemGroup>
</Project> As you can see, I'm using a slightly outdated version of a library, but same error is reproduceable for me even with the latest version and ffmpeg 5.
Dotnet version: 6.0.100 |
@ggolda I can reproduce it only for .NET 5, with NET 6 it's works. That's strange.. Also, your csproj contains |
Indeed, you are right. Tried with |
Try using |
Hello!
I have an incredibly weird issue to report. My code snippet below fails only on videos that have 600x600 resolution and works absolutely flawlessly on videos with other resolutions.
Here is an example that can help to reproduce such weird behavior:
I tried several different combinations of resolutions, so far I can reproduce it only with 600x600 and 602x602 resolutions. I tested with h264 codec, yuv420p pixel format and mp4 container videos. Below is stream info from ffprobe for a video that I tested:
I tried to transcode it to different resolutions using
-vf 'scale=800:800'
filter for example using ffmpeg, and this strange issue was gone.I also tried to provide a
TargetVideoSize
MediaOptions
to resize frames to a different resolution - no CLR internal issue in this case.Can provide video sample that breaks this library if it helps (tried with different source samples with same resolution).
TLDR; Internal CLR error while fetching frames from videos with 600x600 resolution. With every other resolution combination I can't reproduce such issue.
The text was updated successfully, but these errors were encountered: