0

I'm encoding an image sequence to an .mp4 file using the following ffmpeg command:

ffmpeg -y -loglevel info -threads 0 -f lavfi -framerate 60  -i image_seq.%06d.tif -r 60 -preset medium -codec:v libx265 -ar 48000 -acodec aac -shortest -strict experimental -sn -vsync 1 -pix_fmt yuv420p -b:v 7340032 -movflags +faststart output_file.mp4

The image sequence itself is 60fps but the resulting .mp4 file contains a number of frames twice as big as in the original image sequence.

I really can't see anything that's wrong with the command.. any ideas?

Thanks!

EDIT:

The command which includes several inputs:

ffmpeg -y -loglevel info -threads 0 -f lavfi -i aevalsrc=0 -framerate 60 -i image.png -start_number 000000 -apply_trc bt709 -i image_seq.%06d.tif -r 60 -preset medium -codec:v libx265 -ar 48000 -acodec aac -shortest -strict experimental -sn -vsync 1 -pix_fmt yuv420p -b:v 7340032 -movflags +faststart -map "2:0" -map "0:0" -shortest output.mp4 2>&1 | tee -a log_file.log

1 Answer 1

1

Assuming that's the unabridged command, I do see many puzzling things.

-threads 0 is set here for decoding the input and is set to 0 = auto. Which is the default. Removed.

-f lavfi is for supplying a filter-generated source, not for a set of image files. Removed.

-r 60 should normally be harmless here, but given the filter format and vsync later on, better to remove this confounding option.

-ar 48000 -acodec aac is for encoding audio, but no audio stream is supplied or generated, so inert here. Removed.

-shortest is needed when there are multiple streams being encoded, and you want the encoding to stop when the shortest stream ends, but there's only one stream, the image sequence, being encoded. Removed.

-strict experimental is needed if you are encoding audio using the internal AAC encoder AND your FFmpeg is older than Dec 2015. In any case, there's no audio encoding occurring. Removed.

-sn disables subtitles, but no subtitle streams are present. Removed.

-vsync 1 produces constant frame rate output but that's the default for MP4 output. Removed.

Use

ffmpeg -y -framerate 60 -i image_seq.%06d.tif
       -preset medium -c:v libx265 -b:v 7340032 -pix_fmt yuv420p
       -movflags +faststart output_file.mp4
7
  • Thanks, could you just see my edit with the command that contains a couple of inputs? It happens there too..
    – YaronGh
    Jul 15, 2016 at 14:09
  • It should be ffmpeg -y -apply_trc bt709 -framerate 60 -i image_seq.%06d.tif -f lavfi -i anullsrc=r=48k -c:v libx265 -pix_fmt yuv420p -b:v 7340032 -c:a aac -shortest -movflags +faststart output.mp4
    – Gyan
    Jul 15, 2016 at 15:43
  • Ah.. what about my -i image.png?
    – YaronGh
    Jul 15, 2016 at 15:47
  • Wasn't being used anywhere.
    – Gyan
    Jul 15, 2016 at 15:49
  • Fair enough, but even if my command contains "redundant" parameters, shouldn't it still work?
    – YaronGh
    Jul 15, 2016 at 15:57

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.