CodecPage
 video encoding&cleaning


Codecpage News

How to turn your Computer into a VCR

Anything abount analog capturing now becomes more and more obsolete, as direct digital transmission takes over. See the DVB page.

Still running a Pentium1 ? - Read
Poor mans's capture.

You have a large harddisk and want best quality, this is for you:
MJPEG capture

DV capture
Dscaler 4

For historic reference, here is also the text on
Windows Media Tools (MS MPEG4)

 

MJPEG capturing

With a large harddisk, PIC MJPEG codec can do some magic. Use any program that can handle codecs, like AVI_IO, Virtualdub (see Links for downloads) or just your Videocard's software .

AVI_IO can set TV channels (!) and has multiple timers, so it comes next to a real VCR. Recommended. Get the free trial, it can already record up to 3 hrs of MJPEG.
VirtualDub got quite reliable meanwhile but cannot set channels. Sometimes you can just start your TV card software after it , if it complains that it doesn't get the overlay but lets you set channels it's OK. I have made a little
Timer utility for it (see Links).

Terratec have made a new software for their cards that also runs under Windows2000, and even though it has some oddities, beats all the other apps hands down at capturing stability.
I already did several TV recordings of many hours each without any problem. I have also made a little
Timer utility for this (see Links). Stopping however does not always work. Fortunately the video comes out intact even if the disk gets out of space.
What sets me up with it as a PAL user ist that the newer versions refuse to do other resolutions than 640x480 or fractions of it. This reduces the 576 lines of PAL in a way that you get terrible interlacing artifacts and makes the whole thing completely useless. Beta .52 even tried to introduce 720x540 as a video format
:-/. Seems some programmers should first read about TV standards.
I still use beta 0.3 and beware of upgrading.

My favorite MJPEG capture settings: Frame size 704x576, color quality 25, B/W quality 30, (20/25 for 16:9 material) one field, 4:1:1 (4:2:2 for 16:9). This is at the edge of good quality for the 4:3 settings (a little compromise for processor speed) but still better than VHS (DVD like for 16:9) and takes only approx. 60 MB/min, e.g. smaller than DVD. About 16 hours fitting on a 60 GB drive, that's quite OK and with the right software it can really replace a VCR. Windows2000 recommended because it allows virtually unlimited file size.
A quality setting of 40/25 will also be acceptable if your processor is slow.
Do not use settings that result in more than 60% average processor load, or capturing will eventually abort at difficult parts.

While being too large for storage on CDs, the MJPEG files can easily be stripped from commercials with VirtualDub and then converted to MPEG4 (takes about 4x the actual playing time, or 5x if you add a Temporal Cleaner filter which is advisable for most TV sources). Temporal Smoother and Smart Smoother are also very good to faciliate the work for any MPEG codec.

DV Capture

If you have a Digital8 Camcorder with analog/DV feed through, or a dedicated DV converter (from about $250), you may use any VCR or other receiver, convert its output to DV and capture with ScenalyzerLive. Sclive meanwhile has multiple timers and an option to capture without starting the camcorder tape. All one needs. It's the best and most reliable way to capture, although about 14 GB/hour of harddrive space are required.
This is what I use.
With a fast CPU, I could even minimize Scenalyzer's window during capture and work on, even watch TV with Dscaler, encode an MPEG or burn a DVD, and lose no frames. Not guaranteed that this will always work, but try that with any other capture solution...

Be cautious about the timer function however, I found that letting the timer wait overnight would not always reliably start recording. I guess it has to do with firewire network I once tried out on one machine. Don't use that if you want to do DV capturing.

 

 

Dscaler 4

Since v 4.16, Dscaler has a working timeshift feature (althoug the software is still claimed to be in alpha state.
Momentarily, only half height capturing (720x288) is supported. However this eliminates any need for deinterlacing, and if blown up to full size with bilinear resizing (VirtualDub or other), the quality loss is far smaller than suspected.
The capture codec used (PIC MJPEG at best) has to be set to a decent quality because artifacts are also blown up with resizing. Too much is however not recommendable, because Dscaler doesn't yet appear much optimized, so it's sensible to frame drops.
Asynchronous sound however does not happen.
The setup is a bit tricky when it comes to sound:
You cannot use audio codcs (plain PCM is best anyway), you might be forced to use the CD input of your soundcard and select it with Dscaler's audio mixer function (I use digital playback for CD so it doesn't bother me), and you might not be able to set stereo manually (use automatic stereo setup then it should work).
In order to avoid frame drops, use Scaler BOB or Even Scanlines Only as deinterlace mode for the viewer.
On the good side:
Dscaler supports almost any TV card and tuner. You can start and stop recording as often as you want, watch TV while recording, even work on something else meanwhile (set priority in advanced settigs to "low" and expect occasional frame drops), and you can play back your clips directly with Dscaler.
I wrote a timer program for Dscaler 4.16 that can also set the TV channel at atstart of recording. You may pre program multiple TV recordings by starting multiple instances of it. Use PTFB to click away Dscaler's "experimental feature" warning.
What does not work is recording TV while playing back clips.

 

 

Poor man's capture

A Pentium 133 or better can also capture video: Take AVI_IO, set 1/4 frame size (192x144 or 160x120), color format YUY2, video compression w. PIC MJPEG at quality '10' and uncompressed PCM sound of 11025 Hz at 16 bit. The quality is just slightly better than web TV (no movement artifacts though) but it's anyway good enough for news or soaps, and the data rate is low enough to fit 90...>130 min on one CD. Again, AVI_IO's timed capture allows to schedule recordings in advance.
AVI_IO Version 3.1 now supports channel setting on most TV cards and makes up a nice complete VCR w. only 2 drawbacks:
- Some channels may be missing depending on the TV card drivers.
- You may perhaps have to enter the video compression method anew every time you start the program.

 

 

Windows Media Tools (MS-MPEG4)

MPEG4 can record half frame size video in real time and squeeze complete movies one one CD in VCD (e.g. half resolution) quality. This is quite useful as a replacement for a simple video recorder because the capture process is easy to start, the result is already good for burning a CD, and capturing is very stable provided there's enough processing power.

The quality/compression ratio and especially the encoding speed is far better than MPEG1 with the tools available for PCs. Decoding however needs more CPU power than MPEG1.

You can easily fit 2 hours and more on one CD without sacrificing much quality.
You'll need a >=450 MHz CPU for NTSC and >=550 MHz for PAL to really have fun with this (encoding). Otherwise you have to reduce bitrate or frame size (which is still useful for web videos however).


Here is a description of the first steps to go:


-Download and install Windows Media Tools from Microsoft.
Get version 4.1 as long as you can. The new version 7 is more difficult to use and installs no codecs that can be used by other programs.


I would like to put some sample templates here, but this would not work so well because everybody has different devices and if anything doesn't fit, Media Tools start with the initial dialog anyway. So here is what to do:


-Start Media Tools

 


-Click on New to make a new profile

 

 

-Select Custom Settings

 

 

-Select Live Source

 

 

-Select your capture devices

 

 

-Select that data should be sent to a local asf file

 

 

-Give the file a name

 

 

-Select a data rate. 660000 will fit >130 min on a CD, 960000 >90 min.

 

 

-Select single bit rate

 

 

-Select the codecs. Use Windows Media Audio V2, 44 kHz, stereo, anything from 64 k to 160 k bps. 48 k is also acceptable but not good for music. Best rate for movies is 64, for music clips 160.
Select MPEG4 V2 for video.

 

 

-Click on Advanced to fine tune the video codec.
Give it 320x240 for NTSC (US) or 352x288 for PAL (Europe).
Set Frames/Second to 30 for NTSC (US) or 25 for PAL (Europe).
Second/IFrame should be up to 8 for very low bit rates and down to 1 for about 1 Mbps.
Set the image quality slider to 50 (this does not really affect crispness but movement artifacts; the actual influence is marginal, but 100 for example will let CPU usage explode at flickering images and may cause capture to abort).

 

 

-Chose File-Save to save your new profile (as TV.asd in this case). Next time you just click on the profile file and Media Tools start up ready to record.
-Hit the > button to start recording.

 

You can now easily change all settings with the encode tab, for example to convert a local file instead of online recording, and save those settings as a new profile. Create as many profiles as you want.

 

Remarks:

Capturing will abort with a "no audio received" error if the CPU can't keep up. Chose a lower bitrate (not below 600) or a smaller frame size if your machine is too slow ( Frame size can be anything anything you like as long as horizontal and vertical are multiples of 16 and the 4:3 ratio is about maintained). If you have to reduce, first try 352x288, 352x272 or 320x240 if your base format is PAL, or 304x240, 288x224 or 272x208 if you already have problems with NTSC. The encoder reduces quite OK and with very little overhead, so every pixel saved is CPU speed saved.
I
f you have a player or TV out that can deal with odd aspect ratios, setting vertical to 1/2 frame (240 or 288, that is) and only reducing horizontal will give the best results.


Example (6 sec., 720 kB)
ASF realtime captured, converted to AVI when cutting.
Settings: 320x288x25fps,4s/Keyfr.,Q=50%,900.000bps (95 min. on one CD), MSaudio 64kbps / 44k stereo.
This format also works great at 660.000bps (130 min. on one CD).

If this is still too much, got to 1/4 format, e.g. 176x144 resp. 160x120. This should even work on a Pentium I but isn't good of course (In this case 1/2 format later converted to MPEG1 would be better, it also plays well on many Pentium I processors).

Heavy movements or flickering images might need twice the CPU power than normal scenes, especially if you turn the "quality" setting up, so give it a lot of safety margin.

Better don't set Quality to 100% when capturing, it might increase CPU usage and has only marginal advantage (reduced blockiness w. very fast movements). 50% is OK in most cases.

Turning down the frame rate does not help very much because MPEG stores only differences between frames most of the time. Only going to 15 instead of 30 in NTSC might be an acceptable option.

If you have an mp3 pro codec (search for l3codecx.exe which is the installer file), you can use that for the audio. It eats up more CPU power but at least it doesn't abort. Instead it drops frames (and the audio might get out of sync if this persists). Maybe this is better than aborting at least. It will not help with a really slow CPU, because it needs about 200 MHz itself.

 

My favorite compression settings

130 min per CD:

Bandwith : Custom (bps) 660.000


Microsoft Audio Codec, 64 kbps, 44 kHz, stereo
Microsoft MPEG-4 Video Codec V2.

Image Size Custom 320x288, Frames/Second 25, Image Quality 50

This is for PAL. Horizontal resolution has been reduced to free some bandwith, this gives fewer block artifacts in moving scenes. For NTSC, vertical resolution should be set to 240 and frames/second to 30.


90 min per CD, higher quality PAL:

Bandwith : Custom (bps) 950.000
Image Size Custom 384x288, Frames/Second 25, Image Quality 75

For NTSC, again 320x240 and 30 Frames/Second. There it's only useful for videos w. lots of fast moving scenes.

 

 

Postprocessing

You can easily trim your recordings with the asf Indexer. I'd recommend to determine the exact cutting times with Media Player expanded to full screen, then load the file into the asf Indexer, directly edit the timeline markers and save the portion between the markers to a new file. Video can only be cut at I-frames, so the actual cuts may be some seconds off. Audio-only files can be cut precisely.

If you want to keep your recordings, a good idea might be to convert the asf file to avi. Media Player tends to stagger a bit at every I-frame when playing asf, but not when playing the same stream in avi format.

To do this, open the asf file with VirtualDub, set audio and video to direct stream copy and chose 'save avi'. The process is a mere copy that runs at 20...30 x the original speed, e.g. extremely fast. You might also change the audio to mp3 if you want, but that's not necessary. You need Virtualdub <= 1.3c to do this. From 1.3d, ASF support was removed due to objections by Microsoft. Hopefully Virtualdub 2.xx will have it again by a different approach.

What you get is and avi file that plays smoothly and can even contain MSaudio sound (MSaudio refuses to run when you directly capture to avi format, but this way it works). The avi file will also react very quickly if you jump on Media Players's time line. So it's also very quick and easy to edit with VirtualDub's cut and merge features, at least from I-frame to I-frame.

Only disadvantage: If the asf file has dropped frames (which happens if the CPU load was so high that the capture was very short of aborting), you get a slight sound desynchronization (only in the avi format). In principle, you can correct this with VirtualDub's editing features (e.g. copying again with a slightly changed frame rate), but it's a bit of work.

 

Higher quality capture

You can also use AVI_IO with MPEG4. No audio compression is supported, so this is useful if you want to set higher bit rates anyway. In the Range 1500...3000, this is the best option because this would not work in Media Tools due to CPU load. You have to compress the sound later with this method. The author plans to add sound compression capability BTW.
A definite advantage is that AVI_IO has a timer !

 

Using newer MPEG4-codecs

You may use DivX5 with VirtualDub or AVI_IO, but mot with MediaTools. Be aware that this needs high CPU power and the results are not really better than with MS MPEG4. Full frame capturing is not recommendable. I woul not bother with this but get directly to MJPEG or DV capturing.

 

 

 

 

 


 



Copyright (C) 1998-2011; all rights reserved. All materials in these pages are presented for scientific evaluation of video technologies only. They may not be copied from here and used for entertainment or commercial activities of any kind.
We do not have any relation to and do not take any responsibility for any software and links mentioned on this site. This website does not contain any illegal software for download. If we, at all, take up any 3rd party software here, it's with the explicit permission of the author(s) and regarding all possible licensing and copyright issues, as to our best knowledge. All external download links go to the legal providers of the software concerned, as to our best knowledge.
Any trademarks mentioned here are the property of their owners. To our knowledge no trademark or patent infringement exists in these documents; any such infringement would be purely unintentional.
If you have any questions or objections about materials posted here, please
e-mail us immediately.
You may use the information presented herein at your own risk and responsibility only. We do also not guarantee the correctness of any information on this site or others and do not encourage or recommend any use of it.
One further remark: These pages are covering only some aspects of PC video and are not intended to be a complete overview or an introduction for beginners.