[Ilugc] pictures to video using mplayer

  • From: girishvenkatachalam@xxxxxxxxx (Girish Venkatachalam)
  • Date: Sun, 10 Apr 2011 09:24:07 +0530

There are several things that trip the unwary.

This is the command that worked for me:

$ mencoder mf://out-*jpg -mf w=300:h=400:fps=2:type=jpg -ovc lavc
-lavcopts vcodec=mpeg4:mbd=2:trell copy -oac copy -o f.avi

And before this I ensured that all pictures are of the same aspect
ratio. Obviously my pictures were of various aspect ratios.

You have to use ImageMagick like this:

$ convert i.jpg -resize !300x400 out-i.jpg

Only then the resizing will be done without minding about the aspect ratio.

You can create a video only using images of the same width and height.
Use the identify(1) command of ImageMagick
for ensuring this:

$ identify out-*
out-MadhubanBKWSUOmShantiBawan.jpg JPEG 300x400 300x400+0+0 8-bit
DirectClass 39.1kb
out-Navnath1.jpg[1] JPEG 300x400 300x400+0+0 8-bit DirectClass 46kb
out-Potala.jpg[2] JPEG 300x400 300x400+0+0 8-bit DirectClass 57kb


Do you see that they all are 300x400

Of course I wrote a script like this from the command line itself.

for i in *jpg
do
convert $i -resize !300x400 out-$i
done

-Girish

-- 
G3 Tech
Networking appliance company
web: http://g3tech.in ?mail: girish at g3tech.in

Other related posts:

  • » [Ilugc] pictures to video using mplayer - Girish Venkatachalam