0

I am encoding and exporting a video in mp4 and webm format. I am using ffmpeg.js. It works fine but i can not make a video longer than 33 seconds.

let ffmpegArguments:string[] = [];
ffmpegArguments.push("-framerate", (1.0/frameTime).toFixed(0),  "-i", "f%03d.jpg" , 
        "-loglevel", "debug", "-v", "verbose", "-c:v");

I tried to change f%03d.jpg with f%04d.jpg or f%08d.jpg but it stops. Any idea why?
Below console log is when i replace f%03d.jpg with f%04d.jpg 1: https://i.stack.imgur.com/kLyf0.png

sb32134
  • 426
  • 8
  • 19
  • No errors? No log? No info? – llogan Sep 14 '21 at 16:16
  • For `f%04d.jpg` or `f%08d.jpg` It says file not found....but also in chrome it does not show details in ffmpeg. It is affmpeg.js in browser. – sb32134 Sep 15 '21 at 06:39
  • Added a console log above. – sb32134 Sep 15 '21 at 07:38
  • Please copy and paste the console text instead of making an image of text. I had to manually go through all of your giant configure line without being able to quickly search and I can't copy text from it. `f%03d.jpg` expects `f001.jpg`, `f002.jpg`, `f003.jpg`, etc. `f%04d.jpg` expects `f0001.jpg`, and `f%08d.jpg` is looking for `f00000001.jpg`. What are your images named? – llogan Sep 15 '21 at 15:52
  • Images are named f001.jpg...f002.jpg....With the above code, i can not generate a video longer than 33 second. How to do that? The first 33 second video is fine. – sb32134 Sep 16 '21 at 11:34
  • My frame filename are created using : ```let fileName = "f" + i.toLocaleString([], { maximumFractionDigits:0, minimumIntegerDigits: 3, }) + ".jpg";``` – sb32134 Sep 17 '21 at 09:20

1 Answers1

0

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";
sb32134
  • 426
  • 8
  • 19