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

Not able to generate video longer than 33 second #163

Closed
suvirbhargav opened this issue Sep 16, 2021 · 1 comment
Closed

Not able to generate video longer than 33 second #163

suvirbhargav opened this issue Sep 16, 2021 · 1 comment

Comments

@suvirbhargav
Copy link

suvirbhargav commented Sep 16, 2021

ffmpegArguments.push("-framerate", (1.0/frameTime).toFixed(0), "-i", "f%03d.jpg", "-c:v"); ffmpegArguments.push("libx264", "-preset", "ultrafast", "-tune", "zerolatency", "-crf", "22", "out.mp4");

On chrome.

If i use below pattern glob, i can make video of any length but then order is wrong.

ffmpegArguments.push("-framerate", (1.0/frameTime).toFixed(0), "-pattern_type", "glob", "-i", "*.jpg", "-c:v");

My frame file names are created using
let fileName = "f" + i.toLocaleString([], { maximumFractionDigits:0, minimumIntegerDigits: 3, }) + ".jpg";

The last file generated always stops at 2,983.jpg, even though the encoding finished is only 20 % FFMPEGVideoExport.ts?a302:214 fileName f0002,980.jpg FFMPEGVideoExport.ts?a302:214 fileName f0002,981.jpg FFMPEGVideoExport.ts?a302:214 fileName f0002,982.jpg FFMPEGVideoExport.ts?a302:214 fileName f0002,983.jpg

@suvirbhargav
Copy link
Author

I was able to solve this using 8 digits instead of 3. And padding the digits.
ffmpegArguments.push("-framerate", (1.0/frameTime).toFixed(0), "-i", "f%08d.jpg", "-c:v"); let fileName = "f" + i.toString().padStart(8, '0') + ".jpg";

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