Saturday, June 6, 2009

splitting a video file using mencoder

Just got asked from a friend to do video cutting, just to fetch the video and mp3 for portion of time 01:07:26 to 01:09:49

Here's what i did after after googling around for some great resources.

To get the range-cutted video, we need to do a two-steps process :

mencoder -endpos 01:09:49 -ovc copy -oac copy in.avi -o out.avi

in.avi is the original avi file
out.avi is the cutted avi file, starting from the beginning to 01:09:49 (hh:mm:ss) of in.avi

mencoder -ss 01:07:26 -oac copy -ovc copy out.avi -o out2.avi

out.avi is the output of the previous step
out2.avi is the final avi file, starting from 01:07:26 (hh:mm:ss) of out.avi till the end of it

Now, the last part, is to extract audio from the cutted video clip

mencoder out2.avi -of rawaudio -oac mp3lame -ovc copy -o file.mp3

The outputs are, out2.avi for the video and file.mp3, the audio extracted from out2.avi

Friday, May 29, 2009

The Lawyer and the Chinese

A lawyer and and a Chinese are sitting next to each other on a long flight.

The lawyer is thinking that all Chinese are so dumb that he could get over on them, easy.
So the lawyer asks if the Chinese would like to play a fun game.

The Chinese is tired and just wants to take a nap, so he politely declines, and tries to catch a few winks.
The lawyer persists, and says that the game is a lot of fun.
I ask you a question, and if you don't know the answer, you pay me only $5; you ask me one,
and if I don't know the answer, I will pay you $500, he says.
This catches the Chinese's attention and to keep the lawyer quiet, he agrees to play the game.

The lawyer asks the first question. 'What's the distance from The Earth to the Moon?'
The Chinese doesn't say a word, reaches in his pocket, pulls out a five-dollar bill, and hands it to the lawyer.

Now, it's the Chinese's turn. He asks the lawyer, 'What goes up a hill with three legs, and comes down with four?'
The lawyer uses his laptop and searches all references he could find on the Net.
He sends e-mails to all the smart friends he knows, all to no avail.
After one hour of searching he finally gives up.

He wakes up the Chinese and hands him $500. The Chinese pockets the $500 and goes right back to sleep.
The lawyer is going nuts not knowing the answer.
He wakes the Chinese up and asks, 'Well, so what goes up a hill with three legs and comes down with four?'
The Chinese reaches in his pocket, hands the lawyer $5 and goes back to sleep. Don't mess with Chinese.