Simple video from picture

Occasionally I like to post a short audio recording on Facebook. But Facebook only allows videos or pictures. No problem, I take a picture and make it into a video and have the recording as the audio.

Here are three easy steps in FFMPEG to create such a video

1. Pic dimensions have to be even numbered of pixels on width and height. That is, if your picture is 603×258, you’ll have to resize it to 604×258 to make both numbers even.

2. Open your audio file and make note of how long it lasts, for example 2:25.

3. Create a video of the picture
ffmpeg -loop 1 -i JW.png (or jpg) -t 00:02:25 vid.mp4
(-t should match the length of the audio or maybe slightly longer.)

4. Merge the two inputs to make the final video
ffmpeg -i vid.mp4 -i song.mp3 -c:v copy -c:a libfaac mix.mp4

The final product can be uploaded to Facebook or YouTube. The original quality of the picture is kept for the video.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s