Skip to content
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

[BUG] For certain FPS settings VideoWriter creation fails with "make sure you have the specific codec installed" #925

Open
basrijn opened this issue Apr 6, 2024 · 1 comment
Assignees

Comments

@basrijn
Copy link

basrijn commented Apr 6, 2024

Describe the bug
For certain fps settings, VideoWriter creation fails with "Unable to create Videowriter. Make sure you have the specific codec installed" . Manually lowering the fps will create the writer at some point. The point where this happens is different for different systems. My application uses relative high frame rates (100-400fps)

** OS / Platform **
Windows 11

** .Net version **
.Net Framework 6.0

CPU Architecture
x86_64

** Emgu CV package used**
Emgu.CV 4.8.1.5350 (latest via nuget)

To Reproduce
Backend IDX set to MSFT as per example code
int fourcc = Emgu.CV.VideoWriter.Fourcc('h', '2', '6', '4');

new Emgu.CV.VideoWriter(outputFile, backend_idx, fourcc, fps, new Size(width,height), true);

The code runs fine, but for certain high (>100) framerates it throws the "unable to create video writer" error. I manually change the FPS and at some point it will create the file as expected. The framerate where this happens seems to be different on different systems. On one system it will happily create a file at 440FPS, another system throws an error at 170 FPS (but works at 160)

Expected behavior
Throw an error that describes why the specific FPS is not acceptable. Or create the file at the requested FPS

Additional context
Add any other context about the problem here.

@basrijn basrijn changed the title VideoWriter fails with "make sur you correct codec installed" for certain FPS settings For certain FPS settings VideoWriter creation fails with "make sur you correct codec installed" Apr 6, 2024
@basrijn basrijn changed the title For certain FPS settings VideoWriter creation fails with "make sur you correct codec installed" For certain FPS settings VideoWriter creation fails with "make sure you have the specific codec installed" Apr 6, 2024
@basrijn
Copy link
Author

basrijn commented Apr 10, 2024

Turns out it's not actually different per machine. It depends on the width of the video:

Creating video file with W=[146] x H=[540] @ FPS=[440] --> Works fine
Creating video file with W=[144] x H=[540] @ FPS=[440] --> Fails

But if I lower the FPS, it will create it again:

Creating video file with W=[144] x H=[540] @ FPS=[172] --> Works fine

And then fails again if I move up:

Creating video file with W=[144] x H=[540] @ FPS=[174] --> Fails

Any patterns that stand out?

@basrijn basrijn changed the title For certain FPS settings VideoWriter creation fails with "make sure you have the specific codec installed" [BUG] For certain FPS settings VideoWriter creation fails with "make sure you have the specific codec installed" Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants