Saturday, November 15, 2008

How to convert different video file format to MP4 format for your PSP/Ipod

So we're going out-of-town this weekend, it's a two-hour drive and my two nephews, 5 and 6 years old, are coming with us.

Question: What are the odds that these two boys will willingly share and wait for their turn for their PSP toy.

Answer: Yeah, right. Battle royal, wailing and crying is more like it for that 2 hours long drive.

So what's an intrepid uncle ought to do? Why find a reasonable middle-ground that both these boys can agree on, of course.

And how do you propose to do that? Hehe, 'got a plan, boy. Get their favorite movies/TV shows from bittorrent (ie. boy with a tacky watch and that small Japanese robot boy that can fly) and put them on their PSP. Tada! Good, no?

Now this is more like Part II of my last blog (ie. how to rip videos from your DVDs), since you can also use dvdrip to encode the file to different format except that I couldn't find a container format for H.264/MPEG-4 (which is the format of choice for handheld devices). I tried mencoder like real men do, but it was effin messy and couldn't get the command-line options right :-( There has to be easier to do it.

As always, I assume you're using your friendly Fedora Linux distro. Also, bear in mind that every time you convert from one format to another, the quality of your video gradually degrades (not that you'll notice it when watching it on your PSP).

And so without further ado, here's how you can convert those avi/wmv/mpeg files from TPB into something you can watch on your PSP/iPhone or any handheld devices.

Avidemux rock!!

===

Step 1: Log in as root and from the console, run the following command:

# yum -y install avidemux

Step 2: Log in as regular user and from the console, run the following command:

$ rpm -q avidemux

$ avidemux

You should see the following Avidemux window:


Step 3: Open the file video file you wish to encode to another format. In the menu, click File->Open and then look for the video file you would like to convert.



Note: If you get a message that says something like "Index is not up date: You should use Tool->Rebuild frame. Do it now?". Just click "Yes".

Step 4: In the menu, click Auto->PlayStation Portable(H.264). You should see the following window:


Don't forget to

Step 5: Save the file, click File->Save (or just click the Save button). The Save window should pop up.


Type the name of your new video file. Don't forget to include the .mp4 extension to the name of the file.

Step 6: Once you click on the Save button, encoding should now start, you can now sit back and wait. Depending on fast your workstation is, and how large the file you want encode, this might take a while.


Once it finished, you should get the following pop-up message box.


Step 7: Now you can hook-up your PSP to your computer and copy the .mp4 file to the Video folder of your PSP.

If you're video editing needs are modest, you can also use Avidemux for cutting/deleting some scene, or join two or more video clips into a single video file, or add borders and subtitles to your videos.

Enjoy!!

Monday, November 3, 2008

How to rip video CD/DVDs using dvdrip tool

First a few rants...

Don't you hate it when you commissioned someone to video tape an event and all they give you is a DVD copy of the event. What if you wanted your friends and relatives to watch this video, do you give each one of them a DVD copy? Or what if you want to store it on your handheld devices like mobile phone or PSP? Or as is most likely the case, you just want to post it on Youtube and share it? What do you do? No can do?

I mean, it's your wedding day or your first childs' baptismal or any of those special events, you definitely want someone professional to do it right? You'd even be glad to pay for it. But then, you'd also want to share the finish product with as many friends/relatives/colleagues as you can.

I suppose these folks also want to protect their intellectual property rights, and I don't begrudge them that (never mind those DVD movies you legally paid for). But since it's a personal video of you/your friends/relatives, and that you're paying for it, then it's only fair that you should be able to ask for a mpeg/avi file version of it that you can easily distribute to others.

Hehe, I'm so emo, I don't even know why I'm so work up over DVD movies when ripping them is dead easy, if you have the right tool that is. Eniways, here's how you would rip your DVD movies.


Step 1: Log in as root and run the following command:

# yum -y install dvdrip ffmpeg


Step 2: As regular user, type the following from the command line:

$ rpm -q dvdrip ffmpeg
$ dvdrip &

Note: The first time you run the dvdrip utility, it will prompt you to set your preferences.


Step 3: Notice the red highlighted text that says ".../dvdrip-data not found: NOT OK"? Well, you need create this directory. The quickest would be jump back in to your command-line prompt and type the following:

$ mkdir ~/dvdrip-data

Restart your dvdrip app and you should now get the following window image:


There's a number of settings you can fine-tuned but for now stick with the default. It works fine.

Step 4: Now you need to create a new project.
  • In menu, click File->New Project. Type your project name, in my case it's skydiving. The rest of text field (ie. VOB directory, AVI directory, etc) will be automatically filled up.

You should now get this window:


Don't forget to click on the "+ Create project" button.

Step 5: In the section "Choose a ripping mode", make sure that you check "Copy data from DVD to hard disk before encoding".


Step 6: You should now go to the tab "RIP Title".
  • In this tab, there's a button called "Read DVD Table of Contents", click this button to scan the files in your DVD.
  • Once it finished scanning, below that, there should be a button called "RIP Selected Titles(s)/Chapter(s)". Click that button.

Step 7: Rip 'em boy!
  • Click on the "Transcode" Tab
  • Now, there's probably hundred of buttons and settings here that you can tuned and play around with. But only one setting is of really practical use to us. That's the "Container Options" which is already set to AVI container which is almost always what you want since this probably the de-facto video format in computers.
  • Find the 'Operate' section and then click on the "Transcode" button. And off you go!

That's it. Now wait and sit back as this might take a while depending on how large DVD movie is and how fast your computer is.

Step 7: The avi file that you rip from your DVD should be in your ~/dvdrip-data/project-name/avi/ directory. Where the 'project-name' is that name you used during the initial setup.

Success!!

Use your VLC, Mplayer, Totem Movie Player, or even Xine to watch your newly ripped avi file.