Genotrance

Icon

Random thoughts, ideas and experiences

Decoding the Encoder

So I bought a new DVD camcorder from Costco a few days back. I’m new to the camcorder world. I never really had a need to record anything. A digital camera was good enough for all those vacations and someone else always had a camcorder for those family occasions. However, things are going to change. My wife and I are expecting and due in a couple months. Many deem a camcorder an essential gadget in the baby toolbox and I totally agree with that philosophy.

Recently, we had a small family function so it was the perfect opportunity to buy a camcorder and test it out. The intention is that by the time the kid comes, I’ll be all prepared.

NOTE: Feel free to check out a follow-up post that automates the entire process described below.

The Camcorder

The camcorder is a Panasonic VDR-D105 which is capable of recording directly to 8cm DVD-RAM or DVD-R disks. I chose a DVD camcorder over the standard DV versions since I’ve heard of the pain involved in digitizing DV recordings to a video file. DVDs are already digitized so ripping them into files should definitely be easier than struggling with DV tapes, firewire and some average video recording software.

This camcorder allows for three levels of quality:-

  • XP – High quality, 18 minutes per DVD
  • SP – Normal, 37 minutes per DVD
  • LP – Long play, 75 minutes per DVD

Since these are home videos, I have set up the camcorder to LP mode; seventy five minutes per 1.4 GB disk seems fair. The camcorder is really nice and has all the required features. That’s all I’d like to say since this is not a review of the camcorder itself.

The Task at Hand

I needed a decent backup solution. CD-ROMs and DVDs go bad too quickly. They get finger prints, scratches and cracks, regardless of the level of care they are handled with. Even if you never ever use them, they will go bad over time. And once they go bad, you can forget your data.

Secondly, I needed to send the video to my family over the internet.

So I had to rip the DVD to my computer and convert it into a relevant video format. Going from a little DVD-R in my hand to two video files to satisfy the above needs was an ordeal that took several days before I finally came up with a solution that was some what trivial. It is nothing revolutionary but will probably save some time for someone out there.

Is Ripping Illegal?

The first step is to get the VOB files onto the hard drive. Ideally, we could skip this step but our next step requires the VOBs to be on the hard drive for some silly reason. To accomplish this, just use Windows Explorer to copy them to a directory on your hard drive. Ensure you have enough hard drive space in advance.

If your DVD is messed up, what next? I ran into this little dilemma. For some astounding reason, this newly recorded DVD-R already had some unreadable data on it! DVD players just skip those damaged sectors after a few tries but a computer application errors out instead of continuing. For this step, an application such as DVD Decrypter can save the day.

To copy a partially corrupted VOB, do the following:-

  • Select the corrupted VOB in DVD Decrypter and then click on Decrypt.
  • See how many megs get copied before the copy fails.
  • Deselect the appropriate cells from the list. If you hover your mouse over each cell, you’ll see how big that cell is. You’ll lose those cells but at least you’ll get the rest of the data.
  • Start the copy again.
  • Repeat until the entire VOB is copied.

dvddecrypter

After some time, you’ll have a partial VOB file on your hard disk that you can work with. I hope you don’t run into another messed up VOB. You’ll have to repeat the above steps for that VOB as well.

From Part To Whole

Most DVD ripping applications rip the largest VOB on the disk. This is because most movies have one large VOB for the main movie and several smaller VOBs for the extra features on the disk. However, on DVDs created by DVD camcorders, this is not the case. Every time you hit stop and then start recording again, it creates a new VOB file. It’s highly unlikely that you click record only once for an event. You end up with several smaller VOBs of variable sizes. It makes no sense to have multiple video files for a single event so you have to use a tool such as VOBMerge to combine all these little VOBs into one big VOB which you can then encode into one big video file.

VOBMerge is easy to use. Just select all the VOBs you want to combine and order them as needed.

vobmerge_select

Then click Merge and a single VOB gets created at a location you specify.

vobmerge_merge

For some reason VOBMerge is unable to load VOBs that are on the DVD. It spits out a file access denied error message. That’s why we copied the VOBs of interest to our hard drive in the previous step. If this weren’t the case, we would just copy the corrupted VOBs to our hard drive using DVD Decrypter and point VOBMerge to the good VOBs on the DVD and the partial VOBs on the hard drive. Perhaps a future version of the tool will fix this issue.

From VOB To AVI

Now that I had one big VOB file, all I needed to do is encode it into two video files. I tried all kinds of applications to perform the conversion but there were too many steps to follow and too hard to understand. I’m just going to list all the applications I tried before I settled for Mencoder which turned out to be a one stop shop.

Conversion Packages

Converters

Processors

Codecs

Don’t get me wrong, these applications are great for what they provide. They don’t crash or produce crappy output. What I’m saying is that I tried various combinations of the above but was not able to find a solution that provided the simplest steps. The settings are really hard to figure out, especially when the video has to be piped through multiple applications. Gordian Knot and DVD2WMV try to solve this problem but they are not fool proof either.

Mencoder really helped out here since it is a simple command line application which supports a variety of codecs and is very flexible. The man page was very useful to figure out how to work it. I ended up with two batch files, one that creates a backup video file and the second that creates a small file which can be sent to family over the internet. For my next home video, I’ll just have to run these two batch files on the big VOB created in the previous step and I’ll be done. I could even script the VOBMerge part if it supported command line options.

What to Store?

In order to backup the video, I wanted to ensure decent video quality. I downloaded and installed the XviD codec which is a free implementation of DivX. The audio is just voice and background music so an mp3 codec was sufficient. The batch file and its usage are as follows:-

———— vbig.bat ————

@echo off

set AUDIO_BITRATE=128
set VIDEO_BITRATE=1150

set LAME_OPTS=br=%AUDIO_BITRATE%:cbr:aq=0
set XVID_OPTS=bitrate=%VIDEO_BITRATE%:vhq=4

set LAME=-oac mp3lame -lameopts %LAME_OPTS%
set XVID=-ovc xvid -xvidencopts %XVID_OPTS%

set MSG_LEVEL=-msglevel all=5

del divx2pass.log

mencoder %1 %LAME% %XVID%:pass=1 -o nul %MSG_LEVEL%
mencoder %1 %LAME% %XVID%:pass=2 -o %2 %MSG_LEVEL%

———— Usage ————
vbig event.vob event_store.avi

I’ve selected 128 and 1150 bitrates since a 75 minute video ends up compressing to under 700 MB which would fit on a standard CD-ROM. I’ve also used two pass encoding since it produces better output than a single pass. Mencoder creates AVI files by default. This can be changed using the -of flag.

This serves as a good backup for me due to the following reasons:-

  • The size of the video is small enough without looking and sounding much different from the original video.
  • XviD can be played on a computer directly or on DVD players that support the codec (I don’t have one though).

I’m yet to find a solution to convert the XviD back to a DVD. There are several resources online to do that but I’ve not tried yet since there hasn’t been a need yet.

What to Send?

My family does not have a very fast internet connection so I wanted to keep the video file at a reasonable size. My target was under 100 MB. I didn’t want them to have to install any video codecs so I just used WMV2 which is available by default. Once again, the mp3 codec was sufficient for the audio. The batch file and its usage are as follows:-

———— vsmall.bat ————

@echo off

set AUDIO_CODEC=mp3
set AUDIO_BITRATE=24
set AUDIO_RATE=24000

set VIDEO_CODEC=wmv2
set VIDEO_BITRATE=96
set VIDEO_SCALE=264:180
set VIDEO_RATE=15

set LAVC_AUDIO=acodec=%AUDIO_CODEC%:abitrate=%AUDIO_BITRATE%
set LAVC_VIDEO=vcodec=%VIDEO_CODEC%:vbitrate=%VIDEO_BITRATE%

set LAVC=-oac lavc -ovc lavc -lavcopts %LAVC_AUDIO%:%LAVC_VIDEO%

set RESIZE=-vf scale=%VIDEO_SCALE%
set RESAMPLE=-ofps %VIDEO_RATE% -srate %AUDIO_RATE%

set MSG_LEVEL=-msglevel all=5

mencoder %1 %LAVC% %RESIZE% %RESAMPLE% -o %2 %MSG_LEVEL%

———— Usage ————
vsmall event.vob event_send.avi

The batch file above creates a video file which uses less than 1 MB per minute. For a 75 minute video, it generates a 70 MB file. The video bitrate is low but is sufficient since the video size and frame rate is also scaled down. The audio bitrate is also good enough without sounding terrible.

This solution works for me because:-

  • The file size is minimal to send over the internet.
  • The quality is still good enough to distribute.
  • It is in a format easily playable by non geeks.

Quick Setup and Usage Summary

To summarize all the above information, here’s a quick setup and usage guide.

Setup:-

  • Download Mencoder which is part of the Mplayer package
  • Extract the Mplayer package to C:\Program Files\Mplayer
  • Download VOBMerge
  • Extract VOBMerge.exe to C:\Program Files\Mplayer
  • Copy vbig.bat and vsmall.bat above to C:\Program Files\Mplayer
  • Add C:\Program Files\Mplayer to the path

Usage:-

  • Copy all relevant VOBs to the hard drive, using DVD Decrypter for any corrupted ones
  • Run VOBMerge to merge all selected VOBs into one big VOB
  • Run vbig.bat on the above VOB to create a backup video file
  • Run vsmall.bat on the above VOB to create a small video file to send over the internet

Good luck!

Advertisements

Filed under: Tips

13 Responses

  1. Rekha says:

    Very sweet!!!!!!

  2. Robby says:

    Thank you for the info

  3. Cety says:

    I recorded some videos and I did not finish the DVD-RAM but I want to copy just one video. I can do it using the computer but need the driver.
    I went to Panasonic web page but that file have a error.
    Please, Where I can download the DVD-RAM Driver for the Panasonic VDR-D105?.

  4. […] I recently shared my solution for encoding home videos I record using a DVD camcorder. While the solution helped me understand the encoding process, it was not exactly user friendly in terms of the number of steps involved. Being the automation freak that I am, I have written a Python script that takes care of the entire process in a single step. […]

  5. Dmitriy says:

    genosha, thank you for your time to post this info here. It was very useful to see what you did, though my problem is a bit different.
    I use the same camcorder with DVD-RAM disk. It stores files with extension VRO. Format of this drive is UDF2. When I place DVD-RAM in my laptop (WinXP) it plays back just fine. It does not play on my Panasonic DVD player.

    Now, it was for a number of years that I was making backups of the whole content of DVD-RAM on my external HD. As soon as I can access DVD-RAM disk when it is inside my laptop, copy files and play them pack, I WAS UNDER IMPRESSION THAT I CAN PLAY IT BACK FROM THE HARDDISK (from the folder) WITHOUT DVD-RAM PRESENT. Yesterday I realized that I was wrong. My old copies of DVD-RAMs do not
    play back on the laptop.

    Can you please, explain/advise what my strategy should be. What do I need to play this files back or to convert them to avi formats?
    Content of each folder (each DVD-RAM copy) is: VR-NAMGR.BUP, VR_MANGR.IFO, VR_MOVIE.VRO

    Greatly appreciate your time
    Dmitriy

  6. John Rolker says:

    Any suggestions for using a Mac with off-TV DVD’s or camcorded ones?
    Also, given Blu- ray is, now, the only DVD to be likely, any comments on transcribing it to computer or E-mail or anything technical to say?

  7. Azhar says:

    hi you explain very well sounds like you know how to play with this camara i have same camara and i want to copy my dvd to my computer please let me know how i can copy dvd from camara to computer when i try with the USP it is not showing any USB thanks.

  8. Azhar says:

    if any one please help me i have VDR-D105 and cant copy DVD from camara to my computer. when i try to attach via USA it did not show nay thing. thanks.

  9. genotrance says:

    Hey Azhar,
    You may need to install the USB driver that’s on the disc that came with the camcorder. Alternatively, you could finalize the discs and then play them back from a regular DVD drive.

    You can find the driver at:
    http://www2.panasonic.com/consumer-electronics/support/Cameras-Camcorders/Camcorders/DVD-Camcorders/model.VDR-D105

    Hope that helps.

  10. mm says:

    using VOBMerge… if you switch of the read only flag on the files the access denied message goes away

  11. ac3 filter says:

    thanks for this piece of info i have a blog on regarding this ones.I Should admit you managed more cooler then me

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Twitter Updates

%d bloggers like this: