I'm trying to create a timelapse video from several images that I'm fetching from a website. In order to make this faster, my plan was split the workload between multiple cores, each fetching their respective frames (I'm streaming the images to ffmpeg stdin):

ffmpeg -f image2pipe -vcodec mjpeg -i - -f rawvideo part_N

Then I wanted to stitch the rawvideo parts to an mp4:

ffmpeg -f rawvideo -i part_0 -f rawvideo -i part_1 ... output.mp4

But I'm getting the following error:

Picture size 0x0 is invalid`

1 Answer 1


rawvideo has no metadata so you have to supply all parameters. Since your input is mjpeg (edit: sequence), just keep it as that.

ffmpeg -f image2pipe -vcodec mjpeg -i - -c copy -f mjpeg part_N

Generate a text file like this

file part_0
file part_1
file part_2
file part_N

and then

ffmpeg -f concat -safe 0 -r 30 -i list.txt output.mp4

here -r is the desired framerate. Default is 25.

  • I'm getting part_%d: No such file or directory. Also tried %3d and %03d, and enclosed in single quotes, same results
    – Thiatt
    Commented Mar 25, 2020 at 17:22
  • Save to part_N.jpg and then input part_%d.jpg
    – Gyan
    Commented Mar 25, 2020 at 18:06
  • saving it as .jpg causes the output video to only contain the first frame of each
    – Thiatt
    Commented Mar 25, 2020 at 19:59
  • Edited answer with new cmd.
    – Gyan
    Commented Apr 5, 2020 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.