Jump to content

VHS tape to video file


theYinYeti
 Share

Recommended Posts

I have a EPIA-M 1GHz Nehemiah (I've read it is roughtly equivalent to a 800MHz Duron).

My TV card (where the S-Video input is) doesn't do hardware compression.

 

What is the best way to encode an old VHS tape to a video file with the best achievable quality?

 

It doesn't have to be real-time. I mean, I can do a raw (real-time) record first, and apply slow filters next (during hours if needed).

 

Thanks,

 

Yves.

Link to comment
Share on other sites

  • 5 months later...

I finally found the time to try avidemux. It is exactly what I was looking for for the "final pass".

 

Do you know of another tool, that would be for the video, as gramofile is for the audio. I mean something that can try and remove noise (eg "red snow"), and detect and remove (or replace by pure black) the top and bottom black borders to improve compression, or maybe even try and improve the video (remove the non-moving channel logo...)?

 

Yves.

Link to comment
Share on other sites

  • 2 weeks later...

OK.

 

I'm lost. Let me start anew.

 

I want to record some old VHS tapes I own to hard disk with as good a quality as possible.

My computer is a 1GHz VIA Nehemiah (said to be roughly equivalent to an Duron 800). My capture card is a Pinnacle PCTV Stereo and I live in France (capture in PAL).

So far, I use mencoder to record, and avidemux (thanks Devries) to post-process, but I'm open to suggestions regarding alternative free software, if needed.

 

First, I'm a little lost on the basics.

 

I've read on Internet that PAL is 720x576, which has rectangle (D1) pixels. I've read further that computers should change this to 768w576, so as to get 4:3 with square pixels. Next, I'm told that TV is "overscan", in the sense that part of the picture is never displayed; indeed, when I try and record the whole recordable area, the top and bottom pixels are awfull (some data is obviously encoded there), with ever-shifting colors, and the left and right sides are sub-optimal (tinted, or just gray), so I want to get rid of those bad-looking borders.

 

So my first question is: What size should I capture in, and what size should I crop to to get rid of the "underscan effect"?

 

I've read that width and height should be multiples of 4 (or even 8 or 16), is that true?

So far, I capture at 384x288, which is a quarter of the "corrected" full size. I got those numbers from someone else's script, but I have the problem with the borders. Anyway, my aim is the full size (at least 640x480).

 

Next, I have a problem with the recording process itself.

 

My computer doesn't have enough processing power to do anything fancy while recording. It seems to be fast enough to record raw data at full size, though.

So I decided I would first record with a "raw" quality (as good or as bad as the VHS source), and post-process the result in a second pass.

Based on someone else's script (again), I tried capturing 1 minute of video at 702x576 (croped to -IIRC- 702x568). With mencoder parameters "-ao copy -vo copy", I get a perfect capture, about 840MB big (for 1 minute).

 

This kind of video is exactly what I want to obtain: no less than 640x480. Unfortunately:

- Xine has a very hard time coping with the data flow,

- a 2h movie would take some 100GB+, which is bound to lead to problems (available space, filesystem limitations, dataflow...)

- I wouldn't dare recording a 3h or 4h movie...

 

Sadly, I've tried using "-vo lavc" with either ljpeg or mpeg1video codec, and each time, the computer is too slow.

 

So my second question is: What codec and settings would be able to reduce the raw data by half at least, without introducing noticeable recording artifacts (I mean the video must be the same quality as the source), and very fast?

Most codecs seem to try and make 2 hours fit in 800MB, whereas I would only need 2 or 3 minutes to fit in such space, so hard disk space is not that much of an issue. Speed is an issue here.

 

 

Please help me. I know computing and programming very well, but I'm at a loss where it comes to audio, video, codecs... I'm a newbie here :)

Thanks,

 

Yves.

Link to comment
Share on other sites

Do you know of another tool, that would be for the video, as gramofile is for the audio. I mean something that can try and remove noise (eg "red snow"), and detect and remove (or replace by pure black) the top and bottom black borders to improve compression, or maybe even try and improve the video (remove the non-moving channel logo...)?

 

You know, TMPEGENC (I think that's the name) works. Its' a great freeware Windows program that works under WINE fine.

 

Umm... as for the importing... I know with my computer the time it took to encode was so unacceptable, that I just ended up buying a card that could do the compression. It was worth the $100 to me to just drop it in and fix it real quick, and export it to a VCD (which is all I needed... DVD burners were a dream back then).

Link to comment
Share on other sites

  • 3 weeks later...

Hello,

 

I finally managed quite well by myself, using a wonderfull URL that was given to me:

http://www.mplayerhq.hu/DOCS/HTML-single/en/MPlayer.html

This is a must-read as it contains absolutely all one needs to get started!

Here I share my results, for those interested.

 

I encode video in three steps:

 

a/ First, I record TV/VCR with almost no compression, so that the resulting file is as good (or as bad) as the original (and 2.5GB/hour).

I'm targetting the standard PAL resolution, that is 384px in width. However, TV/VCR signal is interleaved, so the 288px height of the 4:3 picture is only half the original content at 25fps, as the TV signal is at 50fps and it takes two 1/50th-second-long half-frames to make one 1/25th-second-long frame. So I record with the unusual resolution of 384x576@25fps, which is aspect ratio 2:3.

To do that I run (input from Composite1):

$ mencoder tv:// -tv driver=v4l2:device=/dev/v4l/video0:input=1:norm=SECAM:fps=25:width=384:height=576:alsa -oac copy -ovc lavc -lavcopts vcodec=mpeg1video:vqscale=2 -o bigrecord.avi

 

b/ Next I choose my filters. It seems I'll be able to always use the same :) They're so efficient! When I apply them to the record from VHS, I get as good a picture as I would have from a DVD! In real-time! No more "snow", no more noise...

$ mplayer bigrecord.avi -vf pp=lb/ha/va/dr,hqdn3d

 

c/ Finally comes the time of the final encoding. As I see it, there are only 3 video formats worth being used:

- SVCD mpeg2 for compatibility with non-computer devices at the cost of a CD;

- DVD mpeg2 for compatibility with non-computer devices at the cost of a DVD, or for a very high quality result;

- MPEG 4 if compatibility is not an issue.

Those three video formats all permit 2-pass encoding, which is the way to go; I tested the SVCD format with 1 pass and with 2 (with the same target filesize), and 1-pass encoding leads to awful results on fast-moving scenes. I didn't test DVD creation so far, but I expect it should be easy to store at least 4 movies on a 4.7GB DVD.

 

Contrary to what I had decided at first, I use mencoder for this last step instead of avidemux. I had way too many crashes with avidemux on my big 5GB (2hours) video file, whereas mencoder is rock-solid.

 

Besides, contrary to what I had read before, a SVCD is not limited to 1 hour or so; it can perfectly hold a 2-hour movie, as long as you use 2-pass encoding with good optimisations, and still retain a high-enough quality (I tested with "The return of the Jedi", that I had recorded on VCR from a TV broadcast).

 

In this step, I add the "-mc 0" option, I add the crop, scale, expand, and harddup filters, and I choose the encoding settings. The bitrate (vbitrate) is computed according to this post:

http://forum.hardware.fr/hardwarefr/VideoS...-3.htm#t1075575

Some basic rules deduced from the MPlayer documentation:

- Croping should be done with even numbers only (width, height, offsets).

- Interlaced video cropped width should be a multiple of 8 (not written, but the diagram "says" so).

- Interlaced video croping should occur at a multiple of 4 pixels.

- The cropped and rescaled video's width and height should each be a multiple of 16 pixels.

- The added black borders' width and height should each be a multiple of 16 pixels.

I took the habit of putting croping as the first filter, and scaling and expanding as the last (except harddup).

Last filter is harddup.

 

I won't put code for this 3rd step, as I get the quality I need by just taking the advices from the above linked-to MPlayer documentation (except that I do 2-pass encoding for SVCD, something this document doesn't say is possible; Internet says so, though).

 

THE problem I still have...

 

1- I find that the most difficult part of encoding is scaling, which is necessary if the video is to be viewed anywhere else than MPlayer, since MPlayer is the only player to respect the aspect tag in AVI files... As for MPG files, it must be done anyway because width and height are imposed by the SVCD/DVD spec.

 

Example: my video is 2:3 384*576, but intended to be viewed at aspect 4:3 (pixels' aspect is 2:1). I crop it in both dimensions, so the real ratio is nothing well defined anymore, though the pixels' aspect has not changed. I try and use the scale filter to just double the width (no change in the height), but MPlayer insists on changing changing the height too, thus altering the ratio I intended! But if my rescaling goes to something well defined (say: 480x576=SVCD), then my chosen aspect is not altered on screen.

However, if I use the -aspect 4/3 parameter, then it *seems* to be OK... So, what is -aspect? is this the aspect of the initial video (the command-line parameter), or the filtered video, or the output video?

 

Thanks for any help or tips and tricks on this last topic :)

 

Yves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...