1

I want to use mencoder to convert a sequence of PNG files to video. The PNG files are named like {file1.png, file2.png, ... file1000.png}. However, if I run this:

mencoder mf://*.png -mf fps=25 -ovc copy -oac copy output.avi

The resulting video will not stitch together the frames in the correct order (correct: 1,2,3,.... incorrect: 1, 10, 100, ...). Answers to a similar question suggest that I can manually input the range of frames to have mencoder use the correct numerical order:

mencoder mf://file{1..1000}.png -mf fps=25 -ovc copy -oac copy output.avi

or to manually sort the files with something like ls -v and then save the results to a list (say, list.txt), and then pass that into mencoder:

mencoder mf://@list.txt -mf fps=25 -ovc copy -oac copy output.avi

However, my question is: Is there a way to do this in a single command without specifying the last frame?

Ideally, I would want an equivalent to mf://file*.png that uses a numerical sorting as opposed to the default sorting. For example, ffmpeg has the option to specify input files like file%d.png, which would order the files numerically.

Thanks!

txizzle
  • 820
  • 7
  • 19
  • Any reason you don't want to use ffmpeg for this? – Gyan Dec 08 '17 at 05:03
  • ffmpeg would probably work as well, but the codebase I'm working with uses mencoder elsewhere. – txizzle Dec 08 '17 at 22:33
  • 1
    Ok - workaround if you don't find a direct soln is to read sequence using ffmpeg and pipe it using image2pipe to mencoder. – Gyan Dec 09 '17 at 06:43

0 Answers0