I have an image file (png) and an audio file (aiff). How do I combine them to make a video file that shows the still image and plays the audio file?

Target operating system: either OS X Lion or Ubuntu, using only free software, must be command-line driven (no GUI solutions please). Thanks in advance!

  • I'm curious why you accepted my answer rather than Josh's more detailed answer that includes a how-to article. I don't mind the reputation points, but it seems like the other answer better addresses your question. Commented Nov 13, 2012 at 18:10
  • 1
    I do actually need the audio added to the video, so although I like the article, it doesn't solve my problem. Even though your answer doesn't actually offer a ready-made solution, I prefer to accept one so as to boost my accept rating (making it more likely that others will continue to answer my questions). Sadly this is a feature of StackExchange---it incentivizes askers to accept an answer, even if it doesn't completely answer the question.
    – jimbo
    Commented Nov 13, 2012 at 19:08
  • I completely agree that you should make a point of accepting good answers, but when you do so is a matter of personal preference. I don't ask a lot of questions, so often like to give a weak answer 5-7 days before I accept it. AVP's traffic is light, and people don't seem shy about adding late answers, so it may not be a big deal. Commented Nov 13, 2012 at 19:32
  • related: superuser.com/questions/1041816/… Commented Dec 8, 2020 at 19:54

2 Answers 2


To expand upon ObscureRobot's answer, use ffmpeg like so:

ffmpeg -loop 1 -f image2 -r 2 -i input1.png -i input2.aiff -c:v libx264 -c:a copy -shortest output.mp4

-loop 1 -f image2 -r 2 -i input1.png tells ffmpeg to loop input1.png forever, at a frame rate of 2fps. -c:v libx264 tells it to use x264 to encode the video, and -c:a copy tells it to simply copy the audio, without encoding. -shortest makes ffmpeg stop when the shortest input ends - input2.aiff in this case.


This article looks like it'll get you close. Doesn't include the audio, but that honestly sounds easier than converting the images to video.


ImageMagick and ffmpeg combined can be used to turn still images into video. Both ImageMagick and ffmpeg have been around for years, and are readily available as packages with most Linux distributions. The tips below allow you to convert images on the command line, which for a may appear to be time consuming, but once you know how to do it you'll find it much faster than using a GUI!

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.