Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to extract frames using mencoder into specific directory?

I can't seem to extract images into a specific directory.

The current command I am running is

mplayer -vo jpeg CustomLogoAni.mp4

Is it also possible to set the prefix for the file? Similar to ffmpeg %d.jpg

When combining the images I run the command:

mencoder "mf://*.jpg" -ovc x264 -o output.avi

But it does not work.

Can anyone help?

like image 367
slik Avatar asked Jan 26 '12 18:01

slik


People also ask

Which method is used to extract images from video in Python?

OpenCV comes with many powerful video editing functions. In current scenario, techniques such as image scanning, face recognition can be accomplished using OpenCV.


2 Answers

You want -vo jpeg:outdir=/tmp/frames/ for output to a specific directory. I don't believe a prefix is possible.

like image 127
sorpigal Avatar answered Oct 14 '22 15:10

sorpigal


This command works very well with ffmpeg. It doesn't matter if you want to convert a 1080p video and you have a slow computer, it converts it on its own pace.

ffmpeg -i "Katy Perry - Firework.mp4" image%08d.png

The %08d format seems to follow the common printf format. It generates a filename like image00000001.png.

ffmpeg can convert a whole video into images.

https://www.ffmpeg.org/ffmpeg.html#Video-and-Audio-grabbing

I couldn't find any info on the specific output directory, however it seems that on Windows you can navigate thru directories with '.'

ffmpeg -i "Katy Perry - Firework.mp4" ./temp/image%08d.png
like image 24
Santiago Villafuerte Avatar answered Oct 14 '22 15:10

Santiago Villafuerte