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

FFmpeg-mt can't convert PNG images to a video, hangs with no callback #714

Open
ArsenicBismuth opened this issue Apr 1, 2024 · 2 comments

Comments

@ArsenicBismuth
Copy link

ArsenicBismuth commented Apr 1, 2024

I tried to do a simple images-to-video conversion using this library. I already ensured the FFmpeg is loaded and working just fine by transcoding the bunny video.

The command I run is below, but somehow there's no feedback at all (no error, no log, no progress), and the command after it aren't executed (so it's stuck).

And yes I already confirmed the images exist and can be loaded by FFmpeg (by writing => loading => preview on browser). The file is stored inside images/ in FS and with format 000.png, 001.png, etc.

await this.ffmpeg.exec([
    '-framerate', '1',
    '-i', 'images/%03d.png',
    '-r', '30',
    'output.mp4'
  ]);

The FFmpeg command is also properly detecting the images, there will be FS error otherwise. So something is "stuck" during the execution, I also receive no progress callback. I tried using 1 hardcoded image instead of pattern and got the same result.

@ArsenicBismuth
Copy link
Author

Solved it thanks to this guy (step-1): https://stackoverflow.com/a/70325534/15858248

I got the images from a canvas, and turns out only image/jpeg are supported (note, image/jpg is NOT working, and image/png is somehow unsupported). Immediately I got the video and even the progress callback is properly called.

But this pretty much leave 2 major issues unresolved:

  • Why is image/png unsupported.
  • Why is there no error nor progress callbacks.

If anyone can clarify why is this behavior, I will close this issue.

@ArsenicBismuth
Copy link
Author

Decided to revisit this issue, turns out this is due to using the mt version. Using the single-threaded version and it works flawlessly.

Thanks to this guy: #542

@ArsenicBismuth ArsenicBismuth changed the title FFmpeg can't convert images to a video, hangs with no callback FFmpeg-mt can't convert PNG images to a video, hangs with no callback Apr 23, 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

1 participant