Saturday, February 25, 2006

From Google Video To SVCD & DVD

Most of the time viewing Google or YouTube video on-line on your computer is enough. For those times when it would be more fun to watch them the old fashioned way on the television, there is hope. This brief article will present some ideas for moving on-line video to DVD or SVCD using freeware & opensource software on Windows 2000 & Ubuntu Linux. This is not a comprehensive How-To, instead it will present details on how I accomplished my recent media-shifting quests using the software available to me.

Software Used

Windows 2000
SUPER Simplified Universal Player Encoder & Renderer
Description: This freeware windows application can convert just about any AV formats!

FLV Player 1.3.2
Description: A freeware FLV player by Martijn de Visser

Nero Express 6
Description: A CD/DVD writing application bundled with my DVD±RW drive. Burns VCD & SVCD discs but won't do Video DVDs.

FireFox 1.5
Description: Opensource web browser

Greasemonkey
Description: A powerful extension for the FireFox browser.

Greasemonkey Scripts
Description: "Greasemonkey is a Firefox extension which lets you to add bits of DHTML ("user scripts") to any web page to change its behavior. In much the same way that user CSS lets you take control of a web page's style, user scripts let you easily control any aspect of a web page's design or interaction." --mozdev.org

The particular scripts we're interested in are described at Greasemonkeying with Google Video and YouTube. They are:
Get them and install them! :-)

Ubuntu Linux
dvdauthor
Description: An opensource command line utility for preparing a video DVD

K3b
Description: A very useful opensource CD/DVD writing application.

Saving Google & YouTube Video Locally
You can save Google Video locally in three (or four?) different flavors:
  • GVP (some kind of Google format that isn't useful for our purposes here)
  • FLV (Flash)
  • MP4 for Video iPod or Sony PSP
  • AVI? I thought you had an an option to save the files as AVI at one time but I guess it's gone or limited to only certain videos? Well, I cannot find it if it's available or not at any rate.
Saving Google Video in FLV format:
  1. With the Google Video Getter Greasemonkey script installed in FireFox, find the video you would like to save locally.
  2. Click on the Download Flash Video link (blue background, white font) in the upper-right of your window near the title of the video.
  3. Select Save To Disk
  4. Click OK
  5. The video filename doesn't need to be changed, but you can if you wish. Just remember to leave the .flv extension at the end.

Saving Google Video in MP4 format:
  1. Find the video you want
  2. In the Download for dropdown field, select Sony PSP
  3. Click the Download button
  4. Select Save To Disk
  5. Click OK
  6. You can change the filename but leave the .mp4 extension.
Note: I am guessing that the Sony PSP MP4 option is higher quality than the iPod version but I have not checked. It does appear that it is better quality or at least converts better then the FLV version.

Saving YouTube Video Locally
  1. With the YouTube to me Greasemonkey script installed in FireFox, find the video you would like to save locally.
  2. Right-Click the "Save As" to download Flash video link at the top of the page (red background, white font)
  3. Select Save Link As in the menu that opens
  4. In the Filename field, enter a descriptive filename of your choice in place of “get_video.php”. Save it with the .flv extension. For example, change the filename from get_video.php to bball.flv
  5. Click Save
Viewing FLV files
If you have FLV Player installed, you can double click on the YouTube FLV video you just saved and it should open and start playing the video for you.

Converting The Video Files To SVCD Or DVD

This is where the Windows application SUPER (Simplified Universal Player Encoder & Renderer) really shines. This thing is so simple to use and it seems to be able to handle anything. I don't know of any other free converters for FLV files, but this one does it. It's pretty self-explanatory but here's a couple of examples:

SVCD
I am going to convert two really cool videos to put them on SVCD for this demo, an MP4 from Google & an FLV from YouTube:

Simplified Universal Player Encoder & Renderer
(Click image to view settings)

SVCD Conversion
  1. In Windows, open SUPER
  2. In the Select the Output Container choose mpg SVCD Compliant
  3. If you have DirectX installed place a check in the Use DirectShow checkbox (Faster. Better?)
  4. In the VIDEO section choose:
    • 480x480 for NTSC (US TV)
    • 480x576 for PAL (Rest of the world)
  5. Leave all the other options as they default
  6. Drag & Drop the MP4 file into the SUPER window
  7. Click Encode now
  8. If it finished almost immediately, and the line An ERROR has occurred. Click to read info.. has gone from gray to red, try taking the check mark out of Use DirectShow at the top in the internal encoders section.
  9. Put a check mark in the box by the filename you are attempting to convert and click Encode now. NOW PROCESSING FILE 1/1 should appear along with a progress meter. Of course the encoding process speed is dependent upon your PC specs.
When the processing is completed I find a file of the same name as my MP4 but it has the .mpg extension at the end. I follow the same procedure above to convert the FLV file for use on SVCD. The MP4 came out better then the FLV but they were of differing quality to begin with. Now I am ready to put them on CD as a Super Video Compact Disc (SVCD). Since I am in Windows using SUPER I will use Nero for the CD writing. If I were in Ubuntu Linux (as I will need to be for the DVD section) I would use K3b. Both are quite straight-forward in their respective procedures and you probably won't have any difficulties with either.

Writing The SVCD
  1. In Windows, open Nero Express
  2. Choose Video/Pictures --> Super Video CD
  3. Drag & Drop the .mpg files into the the Nero Window in the order you want them to play
  4. Click Next
  5. Enter the Disc Name (i.e. TEST_SVCD)
  6. Select your Writing Speed & Number of Copies
  7. Click Burn
Note: There is an Enable SVCD Menu option in Nero but it's gray out in my version for some reason. It worked before. Maybe it “timed out” or some such nonsense... I don't recall such an option in K3b.

DVD
Making a DVD was a little more involved. I had a lengthy bit of concert footage from Google Video downloaded in FLV, MP4, and AVI formats—the MP4 converted nicely to SVCD compliant mpeg format. The quality was excellent but unfortunately it was too much for one CD, coming in at over 1GB! (Interestingly enough, neither the AVI nor the FLV contained the whole concert. Only viewing the video online or via the MP4 download did I get the whole thing.) At any rate, I wanted it all on one disc. It would have to be DVD. Unfortunately for me, getting that done was a real battle. It was a long night of Googling and experimenting before I got it working properly. Fortunately though, once you know the process, it's quite easy... so enjoy!

This is where we bring our friend Ubuntu Linux into the picture. The bundled version of Nero Express 6 won't even write Video DVDs. I'm sure they want you to buy the "real" version for such things--which in hindsight probably would have saved me a ton of aggravation last night, but that is for another time. For now I will simply outline the procedure that worked for me. So here we go...

DVD Conversion
We are going to prepare a DVD compliant VOB file from a Google MP4 with the Windows SUPER application. Next, we will boot into Ubuntu Linux, add the necessary applications, use dvdauthor to prepare the the DVD files for burning, and write the video DVD with K3b. The first part of the process is similar to converting MP4 for SVCD as you will see:
  1. In Windows, open SUPER
  2. In the Select the Output Container choose vob DVD Compliant
  3. If you have DirectX installed place a check in the Use DirectShow checkbox (Faster. Better?)
  4. In the VIDEO section choose
    • 720x480 for NTSC (US TV). Aspect 4:3 (Standard TV ratio)
    • 720x576 for PAL (Rest of the world) Note: Your guess is as good as mine on choosing the Video Scale Size & Aspect Ratio for PAL.
  5. Leave all the other options as they default
  6. Drag & Drop the MP4 file into the SUPER window
  7. Click Encode now
  8. If it finished almost immediately, and the line An ERROR has occurred. Click to read info.. has gone from gray to red, try taking the check mark out of Use DirectShow at the top in the internal encoders section.
  9. Put a check mark in the box by the filename you are attempting to convert and click Encode now. NOW PROCESSING FILE 1/1 should appear along with a progress meter. Once again, the encoding process speed is dependent upon your PC specs.
DVD Authoring
This is where I had all my fun. You can't simply write the VOB file to DVD and expect it to work in your stand-alone DVD player. You have to have IFO files, one in particular is quite important, the VIDEO_TS.IFO file. So where do we get these files? We will generate them, and the DVD TOC with the almost totally undocumented but otherwise very useful dvdauthor Linux command line utility. First, we should add some needed applications to our Ubuntu system. With Synaptic & a broadband connection you will be ready to roll your own Video DVD in no time:

Expand Your Ubuntu Application Universe
  1. In Ubuntu, open Synaptic (System --> Administration --> Synaptic Package Manager)
  2. Update your repositories. (Synaptic Package Manager --> Settings --> Repositories)
  3. Click ADD
  4. Place Check Marks in Community Maintained (Universe) and Non-Free (Multiverse)
  5. Do the same for Updates & Security Updates

Install Needed Applications
  1. Click Reload to make sure you are all up to date
  2. Use the Search function to find & install the following (and their dependencies):
    dvdauthor
    k3b

    You might as well add these also, you may need them (among others) at some point:
    qdvdauthor
    mplayer
    mencoder
    ffmpeg
Prepare The Video DVD Files
Note: I will try to explain this as simply as possible as this is the part that gave me such a headache. The commands are shown in Monospace/Courier Font. All of the dots & slashes are important, as is where & when you execute them!
  1. Open a shell (Applications --> Accessories --> Terminal)
  2. Create a working directory (i.e. movie)
    mkdir /home/your_username/movie
  3. Copy or Move your VOB file(s) (i.e. concert.VOB) into the working directory
  4. cd /path/to/your/working/directory
    (i.e. cd /home/your_username/movie)
  5. dvdauthor -o ./ -T
    This will generate the Table of Contents (which is basically two new directories under your working directory called AUDIO_TS & VIDEO_TS and it will also give you an ERR message which you can safely ignore.)
  6. mv *.VOB ./VIDEO_TS
  7. dvdauthor -v ntsc+720x480+4:3 -o ./ ./VIDEO_TS/concert.VOB
    If you have more then one VOB file (i.e. concert1.VOB, concert2.VOB, etc.) simply list them all in order in the command above like this (all one line):
    dvdauthor -v ntsc+720x480+4:3 -o ./ ./VIDEO_TS/concert1.VOB ./VIDEO_TS/concert2.VOB
  8. dvdauthor -o ./ -T
  9. Move the original file out of the DVD folders with this command:
    mv ./VIDEO_TS/concert.VOB ./
Writing the Video DVD
  1. In Ubuntu, open K3b (Applications --> Sound & Video --> K3b)
  2. Select File --> New Project --> New Video DVD Project
  3. Use the navigation pane in the top portion of K3b to go to your working directory
  4. Select, Drag & Drop the AUDIO_TS & VIDEO_TS directories from the upper-left pane of the K3b window and drop those folders into the bottom-left pane.
  5. Press CTRL+B or select Project --> Burn
  6. Modify settings as needed and click Burn
K3b writing a Video DVD
(Click on image for a full view)

Well, that's it for now. Hopefully this helps someone along their way. I'm sure there are a lot of different, easier or slicker ways of doing the same thing. This should get you going if all you want is to move some A/V from your PC to your TV fairly painlessly.

Useful Links & Apps:

Tags:

Updated 18 March 2006: Added links to MediaCoder & Google Video to AVI information.

No comments: