This post is of a high geekitude factor, so be warned. One major reason for writing it is to record what I did so that in future if I need to refresh my memory I can do so quickly. I decided to work on converting all my vhs tapes into digital format. I have quite a number of these tapes lying around, and having them all in digital format should free up plenty of space. The tapes can then go into storage.
To do this, you need the VCR, and a computer with a tv-input card. The input card I use is the AverMedia AverTV Studio. I got this a while back so as to play around with MythTV. This is software that enables you to set up your PC into a Tivo-like device. You might be asking why I did this, seeing that I don't watch any tv. I did it for the challenge. Just so that I could say that I did it and it worked. And work it did. But after sometime, I got tired and uninstalled everything.
Another good thing about the tv tuner card I have is that it can receive FM radio signals, so with the appropriate software I can listen to radio direct from my PC. I haven't done that in a while, since radio has nothing much to offer. So the card had been laying idle in my computer until I came upon the idea of digitizing my vhs tapes.
Apart from the hardware, you will need the software to do the actual processing. Like I keep mentioning, I run Linux, and so the software I use is for this platform, though you can get binaries for Windows. The workhorse software is called MEncoder, which is installed as part of mplayer. Mplayer is a powerful commandline based media player. You can get a graphical user interface (GUI) wrapper for it (such as gmplayer) if you are commandlinephobic.
Before getting things off to a start, you need to set up your sound card to ensure the audio will be captured properly. The settings needed depend on what card you have. Personally, I have the SoundBlaster Live!. The volume settings needed can either be done on the commandline, or using the Alsamixer utility. Either way, make sure the following items are set as shown:
Once this is done, you are good to go. Set the tape rolling in the VCR, then type the following command on the computer to begin capturing. mencoder -tv driver=v4l2:width=640:height=480:channel=3:norm=ntsc tv:// -o file.avi -ovc raw -oac pcm
Note that during capture you will not get any video output. You will only get sound (thus the importance of setting the AC97 to 75% for effective feedback).
I now give an explanation of the components of the command typed up above:
-tv signifies options that tune the TV capture module. For this case, the options are:
tv:// means capture the video using the tv capture module. The options listed after this are:
Let this run for as long as the tape is running. Once you get to the end or to a point where you want to stop, just type Ctrl-c to stop the recording.
You will now have a file.avi file on your disk. I should point out that captured vidoe files take a huge amount of space on disk. In one capture I did, 40 minutes of video used up 30GB of space. Remember, the command above states that both the video and audio should be uncompressed, thus the huge space needs. Make sure you have enough disk space before carrying out this operation. Make sure you also have enough processor horsepower, as well as lots of memory. I have a 1.1GH AMD processor with 512MB of RAM on my PC. Ancient by the standards of computers out today, but still fast enough for my needs. I don't get any problems recording with this PC. I have 440GB of disk space, more than plenty for my storage needs.
Next you need to give the following long command:mencoder file.avi -o file.flv -of lavf -oac mp3lame -lameopts abr:br=56 -srate 22050 -ovc lavc -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames
This command basically compresses the output file down to a more manageable size. It also converts the format of the file from one type to another as detailed in the breakdown below:
Once this command is done doing it's thing, you will have the flash video file ready for use (or mpg or wmv depending on output video format selected). The reason I chose the flv format is my need to have these video files present online. I wanted to play them using the flash video player which only accepts flv files. In order to do this, you will need to have a flash video player installed on your site. That is if you want to go that route,
Alternatively, you could always just resort to youtube. In actual fact, the steps I have just described in generating the video file are similar to what youtube does. That is how they are able to get video from users processed into flash video files which they then host on their servers.
A question that might arise is, why go through this pain? Again, like for the mythtv example above, my answer is the same. So I can say I have done it, and in the process learn more about the wonderful use of computers. You might also ask why not get one of them GUI applications that lets me click buttons and make selections then click run and let it take care of everything for me. I could do that, but then again I wouldn't be able to learn the nitty gritty of what is involved in encoding. Doing it on the command line forces me to learn this. Another advantage of the commandline is, automating the process is much easier this way, since I can write up a script that does everything I have described so far and place it on a server somewhere and just feed it input files. Precisely what youtube does. This is one of those moments where you ask yourself why you never thought of it before the youtube guys did. You could have been a gabazillionare by now! Well, you live and learn.
And now I leave you with a clip from the recording I made for illustrative purposes. If you were Strong to Serve or Walked in the Light, and especially so in '94 and '95, and were in the choir to boot, you will most definitely remember this.
Monday, June 18, 2007
Digitizing VHS tapes using MEncoder in Linux
Subscribe to:
Post Comments
(Atom)

22 comments:
egm...why do you keep insinuating that you will forget things??? You have mentioned that as the reason for all your recent posts!!! Hope all is well with you!!!
He he ... were you in a choir?!!
Hmm, your blog getting to be an excellent resource, geekitude or nostalgia...archive them while they are still fresh in your mind.
Princess
I have insinuated that? Wow! That must be totally inadvertent on my part... pole if that's how it appears. Nope, nothing's the matter at all. The synapses are all firing accordingly with no reported misfirings I know of. Thanks though for the concern! Teaches me I should be more careful how I write...
M
Was I? :)
Aegeus
That I'll do my guy...
@Princess Loool...
@EGM Now u go all geeky on us...
Unyc
Si I warned folks! :) Lakini I wachad you with a micro-clip of ziki at the end to compensate...
first of all, wacha siasa...si you know I dropped phyc....
egm - yaani only you convert your own vhs to sijui what....me, I take them to Ali Baba around the corner.....
I took very long to read this post and still couldn't understand too much but I guess the end result will be worth it when I watch.
Dorothy
Siasa gani? Sijaona anything about force = mass x gravity kwa post :) Ama those electrons moving in the microprocessor during the video processing is too much Phyc? :)
Eh, lakini if I took everything to Ali Baba to do, when would I have my fun of discovery and exploration?
Kirima
Pole for the density of material presented. Unfortunately the clip is only 12 seconds long. Mostly because I had to select a part of it where no one appears, since I don't want people who recognize themselves coming to me with rungus! Next time I do a post like this I'll weka a worthwhile thing at the end for all those who found it heavy reading. Infact, I'm thinking of what to use as an example for my next such post.
2nd paragraph i was one lost dude... uko poa dadi?
Inexes
Poa is my state right now. Pole kwa kukupoteza!
Aahah! I don't have that many VHS but a friend of mine does, some that hold precious clips we'd like to save. I have about 400GB for precisely such things. I will attempt though I am not on Linux - yet. Still trying to bring out the techie in me. Still.
OMG EGM- I want! I was in that choir! Jeez...it's like you're psychic! I was just doing my 'big music edition' and mentioning Mr. Ogalo, choir (including our song about the new bicycle) etc wishing I had the footage I taped at carol service in '94 & '95 with me(which has probably since been taped over by my family)...I was in the class of '95! LOL...si you can just send me some snippets to go with my 'Music edition' post (said the woman who can't even put html tags in her comments). Kwanza...as I type this I'm like "I know who EGM is!!!!" - I had a feeling before, but the 'choir tapes' are the confirmation- only one other person than myself made tapes of our choir! Your brother was in the class of '95 wasn't he? OK sorry to ramble on...so, about the newly digitized recordings ahem...
Golly! Been a while since I was here...And from the look of things well, hehe, you're still geeking more'n ever. Not that it's a bad thing...
:-)
Magaidi
I'm sure you can find easy to use software that should enable you to convert the tapes. Any maswalis, just holla!
Wambui
BUStation! (Jadekitten '07). At the rate I was going, it was only a matter of time before someone figured it out. I suspect a few that don't comment might have done that eons ago. I just might be like Modo and do a full visage expose seeing that this has quickly transformed into a non-anonymous blog...
Ah, the bicycle song! The one that y'all were forced to sing at State House and did so rather reluctantly when all wanted to sing Niwara! Memories, memories, eh? When I did the recording, folks completely refused to come anywhere close to the bicycle song, so, unfortunately, I don't have it recorded for posterity. As for the rest of the recording, check your inbox for access to it...
JK
Been a while! The geeking continueth. This has actually been the first geeky post I've done in a while though! You just happened to come right after I'd done it... Welcome back, na usipotee sana!
like a bus packed to the door going down valley road without brakes....imenipita mbaya
NYWIIIIIIIIIII!
aegeus just had to enjoy it.
na kwani hiyo choir ni ya ghostblogger (guestblogger) haionekani? fix that camera. lesson 101 (me telling the master) point at the subject
Modo
Si Aegeus knows the good stuff! :)
Hehe, who said the grass was not the subject? Ni venye tu sikutaka kuonyeshana watu bila idhini yao, and I have no idea where some of these people are today, so I took the safe route and got a clip where no one was shown... Lakini I'll be extracting the audio, so yeyote yule anayetaka ataweza kuskiliza nyimbo zote...
I was quite anti-radar on this one!! Uliwa choir lakini?
Mwangi
Choir nilikuwa. I need to blog about my choir experiences someday! Good stuff, I tell ya. Were you?
Great resource
I am dual booting running ubuntu 6.6, Ubuntu FF and win XP on my machine
I would like to use bluetooth for more than file transfer (for headphones and sync with my smartphone)
Any idea how to do this?
Fishingnett
Welcome to mi casa. I have never really dabbled with blue tooth and the computer. But when I get around to doing it, I shall definitely note down how to approach it.
Post a Comment