How can I turn a sequence of images into a video using mpv?

0

2

I have a sequence of jpg images that I would like to turn into an avi or mpeg movie file. I tried to install mplayer/mencoder using Macports, but it told me this is obsolete and has been replaced by mpv. However, the man page for mpv doesn't explain how to do this task, of encoding a sequence of images into a video. How can I do that?

The images are in the form yyyymmdd-hhmm.jpg (so that sorting them alphabetically puts them in the right order) and there are about 22000 of them - I want to produce a time lapse video rather than a slide show.

(Note: I've tried using ImageMagick and ffmpeg as well, but convert seems to want to load all the images into memory first, thus locking up my computer and forcing me to reboot, while ffmpeg inexplicably only uses the first 100 frames or so and then stops, producing an output video that's only a few seconds long. I'm open to other suggestions as well.)

Nathaniel

Posted 2017-01-24T06:58:12.207

Reputation: 175

Which OS are you using? – Yisroel Tech – 2017-01-24T07:16:29.453

@YisroelTech Mac OS X El Capitan - but it shouldn't make too much difference for a command line task – Nathaniel – 2017-01-24T07:30:43.710

I'm just not that familiar with MAC (you mentioned MacPorts) so I wasn't sure if you were talking about Windows Linux or MAC. Mencoder in command line should work all fine according to their office site. Want a normal GUI installation the old ones should still work, like http://mplayerosx.ch/#downloads. Another program you may try (GUI) is http://fox-gieg.com/tutorials/2013/image-sequence-to-movie/

– Yisroel Tech – 2017-01-24T07:41:19.680

Answers

3

I managed to figure this out for myself by trial and error, though I won't accept my own answer in case someone wants to give a more comprehensive answer (e.g. explaining how to change the details of the encoding). But for my purposes, the following worked just fine:

mpv "mf://*.jpg" -mf-fps 30 -o movie.mpg

The "mf://*.jpg" is a special syntax for loading images; the -mf-fps 30 is optional and sets the frame rate, and the -o is needed to create an output file. (Otherwise it opens it in a GUI for playback.)

Nathaniel

Posted 2017-01-24T06:58:12.207

Reputation: 175