you're reading...

Converting Images to Videos and Vice Versa

For one of my tests I needed to convert my video into individual images. And once again FFMpeg was to my rescue.

ffmpeg -i mytest.flv -f image2 images%04d.jpg

The above command would convert the flv file into images and store the same as image0001.jpg, image0002.jpg … so on in the current directory. we can also specify a separate directory into which the images need to be outputted.

ffmpeg -i mytest.flv -r 1 -f image2 extract/image%04d.jpg

The above command extracts an image per second of audio and stores it in a sub-directory called extract.

Likewise, if we need to convert a sequence of images into a video, the following command would do the rest

ffmpeg -f image2 -i image%03d.jpg myvideo.flv

We can also specify the frame rate using the -r switch in the above command



No comments yet.

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: