Posts Tagged ‘mencoder’

copy part of movie

Wednesday, February 6th, 2008

I wanted to cut a chunk of footage from a video file.
Mencoder does this wonderfully, but, the command is not intuitive.

First, the example. This command goes to 10 minutes after the movie starts and takes 30 seconds after and spits out to ‘out.avi’..

mencoder ./filein.avi -ss 00:10:00 -endpos 00:00:30 -o ./out.avi

More practical example:

Fire up a terminal emulator.. open your source movie with mplayer.
You’ll need to see where in the movie you are, press ‘o’, get a pen and paper. This tells you the time elapsed.
You want to start your video selection at 00:14:24, that is, 14 minutes, 24 seconds.
And you want to stop at 00:15:24.
What you need to figure out is how much time there is betwen the start time and the stop time, in this case, one minute.

So our -ss seek/start time, will be 00:14:24
Once the movie is being copied, the end position (inside the copy movie) will be 00:01:00 (one minute).

Let’s put the command together..

mencoder ./in.avi -ss 00:14:24 -endpos 00:01:00 -o ./out.avi

Wait! Where is the stop time of 00:15:24?? RTFM, remember? endpos is telling mencoder where to stop, this is the target duration of the output movie we are making.

how to join movie files

Wednesday, February 6th, 2008

Examples

mencoder ./a.avi ./b.avi -oac copy -ovc copy -o joined.avi

Basically, there are three sets of parameters, in whatever order..

1) a list of files to join (paths)
2) -o the name of the output file (path)
3) settings for how to deal with audio (-oac) and video (-ovc)

There are a lot more settings then this, for that please see man mencoder.

how to make an avi smaller

Wednesday, January 30th, 2008

Sometimes I have a divx file that is way too big to fit into a cd.
How the heck do you make an avi smaller?

I ripped a copy from dvd to an avi, and got it to under 700 megs, great. That fits in a cd. But then I had a 10 meg subtitle file! So, it didn’t fit! I needed to get the avi a little smaller.

If you look up info on mplayer, mencoder.. there’s a LOT to read.
So here’s how, in no way complete.
Just one way to solve the problem.

   mencoder in.avi -o out.avi -ovc lavc -oac copy  -lavcopts vbitrate=400:vpass=1

Now, what’s very cool about mencoder, is it gives you stats on progress..

   Pos: 101.5s   2435f ( 0%) 213.30fps Trem:  27min 628mb  A-V:0.036 [320:32]

‘Trem’ is rime remaining, and the mb count is the guess for how big it will be.
As the progress gets further along (beyond 10%), the stats will be more precise.