Friday, July 29, 2005
SageTV Example
Here's a specific example of what I was talking about last time. I have 3 1-hour episodes to pack on a single DVD. The first one was recorded at 4Mbps MPEG2 w/ 384Kbps AC3. The second two episodes are done at 6Mbps MPEG2 w/ 384Kbps AC3. Episode durations are 42m39s + 41m21s + 42m13s. According to TMPGEnc DVD Author, this will result in a DVD that is 5502MB (over the max of 4438MB).
That's 24% over the limit for a 4.35GB DVD, but I expect that since it's a trio of letterboxed source material that it might pack down tight enough to fit. (If not, I'll break out DVD Shrink and make it fit.) Creating the DVD takes around 16 minutes on my Opteron 246 system (pair of Opterons). CPU utilization is only 38% (76% of one of the CPUs). The disks are pulling 20MB/s around (I'm disk-bound).
The final size was 4.06GB (4157MB), smaller then the limit on a 4.35GB DVD.Labels: 2005, VideoCapture
posted by Wuphon's at
10:43 AM
(0 comments)
Friday, July 22, 2005
SageTV Results at 6Mbps
Like I talked about in "Video capture with SageTV", I switched to a 6Mbps MPEG2 capture rate on the Hauppauge card. My goal is to only fit a pair of 1-hour episodes on each 4.35GB DVD rather then my previous method of fitting (3) 1-hour episodes.
What's interesting is that I'm seeing much larger compression values then expected. The nightly files are of the expected size, but when I create the DVD, I'm getting much smaller DVDs then expected. The raw MPEG2 footage off of the PVR card is 9.83GB for 3.5 hours (up from 6.87GB for 4Mbps). That's the correct growth amount.
However, the output to DVD (conversion to AC3, no re-encoding of the MPEG2 stream) is smaller then expected. For a ~43min episode, my VOBs are anywhere between 1.65GB and 1.79GB. Some of the VOBs have come out as small as 1.33GB. The super-small VOBs are probably because those were letter-boxed shows over NTSC. Since I'm not re-encoding the MPEG2 stream, I'm not 100% sure why these files are shrinking so much. Maybe TMPGEnc DVD Author has some smarts when it packs the stream into VOBs.
So, assuming that 1.85GB is an expected maximum size for the VOBs for a 43min episode and my target is actually 2.10GB to fit better onto a DVD. That gives me another 13% or so. So I can probably boost my PVR bitrate up to 6800Kbps on the video stream, getting a bit more clarity out of the image.Labels: 2005, VideoCapture
posted by Wuphon's at
9:25 AM
(0 comments)
Wednesday, October 27, 2004
Canopus ADVC
Well, looks like my old Hauppauge WinTV capture card gave up and died this week. It still pulls a picture in, but there's a horrid crackling noise on the one channel that I haven't been able to fix. So I'm going to give up on analog capture cards and get what I originally wanted, the Canopus ADVC converter. It takes the analog output from the S-VHS VCR and converts it straight to a DV stream (720x480, roughly 2.5mbps or 13.5GB/hr). Plus, since it converts the audio on the fly at the same time, I don't have to worry about audio drift in my captures.
The only thing I have to figure out now is what software I'll need to be able to do filtering and cropping on the DV stream, prior to handing it off to TMPGEnc for MPEG2 encoding.
I did consider just getting a MPEG2 capture card like the Hauppauge PVR 250, but I still have some older VHS tapes that I need to capture and filter prior to conversion. Plus, the Hauppauge PVR only outputs in MPEG2 so I'd be stuck with CBR encoding.
Moo's video editing tips - Has a handy link to the Canopus DV (decode only) codec download. Since I don't plan on exporting back to DV (my target is MPEG2), I can just use the Canopus codec.
WinDV is a nice little tool for capturing the DV file from the Canopus. I'm still exploring the interface and I don't know exactly what settings to use yet. (It's best to capture as a type2 AVI file.)
At the moment, I'm not even using VirtualDub to do filtering. Instead, I'm relying on the filtering capabilities built into TMPGEnc v3 (even though they're 3x slower then the ones in VDub). Still haven't produced a DVD yet, so I'm not sure whether I'm right or wrong yet.Labels: VideoCapture
posted by Wuphon's at
1:45 PM
(0 comments)
Wednesday, March 17, 2004
TMPGEnc Plus FAQs
I'm trying to "graduate" from using the TMPGEnc Plus wizard to mucking with the encoding settings directly.
FAQs and other helpful links: TMPGEnc Plus 2.5 Original Frequently Asked Questions VirtualDub to TMPGEnc frameserving FAQ DVDRHelp.com - Converting to DVD MPEG2 Configuring TMPGEnc for high-quality, DVD-compliant MPEG-2
Trial and error isn't too bad, but with a 3:1 encode time (3 min to encode 1 min of source), it's not trivial either. My first few attempts resulted in non-compliant MPEG2 files, so I've had to go back to square one and figure out what I did wrong (re-starting with the provided DVD (NTSC) template.Labels: VideoCapture, VideoEncoding
posted by Wuphon's at
6:29 AM
Monday, February 16, 2004
VHS2DVD Process Streamlining
Slowly streamlining the process. Currently, I'm using a 4-head VHS VCR to capture an analog OTA signal of Law and Order and ER every week (6 hrs/week) with the goal of putting 2 episodes on a single DVD to play in my set-top player. (The Sony, not the Toshiba SD-2109 which won't read recordable media...) Playback for capture is done on a S-VHS VCR (yes, I should probably use a S-VHS VCR upstairs to do the intial recording... but hey, what I'm taping is more about the story then the video quality, audio is clean which is worth more then a slight amount of video noise). I have a 4x6 card stuck to the front of the VCR upstairs to remind me what is taping when so that I change tapes on the proper days.
Playback and capture is easy enough, I don't listen/watch the episode as I'm capturing except for spot-checking to make sure audio sounds clean and audio levels are proper. I start a new capture AVI at every commercial break, and even sometimes grab commercials into short 40-second AVIs. Law and Order shows typically have a 2-3 minute intro, 4 main segments of 9-15 minutes each, then the credits segment which is a minute or two. Since I'm going to DVD, it's just as easy to leave them as seperate files and just combine them into a single track when I author the DVD. In fact, that gives me the option when I encode to do the credits segment at a low bit-rate to save space (usually encode those at 4000 or 5000 kbps instead of the 6000 kbps that I use for the rest of the show). I usually read a book, catch up on SlashDot or other e-mail while I'm doing the capturing, keeping a quick-eye on the progress to make sure no frames get dropped and to see when commercial breaks show up.
Cropping out the commercials (or extra lead-in / lead-out) is done in VirtualDub using the Direct Processing Mode. I've found that this is a good bit faster and less frustrating then trying to set the edit points in TMPGEnc (VDub is much more responsive when scrolling through the video). Since I'm not doing any filtering or re-compression of the AVI, speeds are on the order of 60-90fps (2x-3x normal speed). A faster hard drive would speed up this process. Again, pretty much a hands-off process, it takes maybe a minute per segment to find the scene-breaks, mark my start/end points and start the conversion.
Right now, I'm not doing any filtering / clean-up of the video signal. And unless I get a super-fast encoding machine, I definitely won't be using TMPGEnc's noise reduction (which seems to be extremely slow). As it is, my P4 1.6GHz laptop takes about 6 hours to encode 1 hour of material. With noise-reduction, that figure jumped to 12-18 hours per hour. Since I'm only able to encode using the laptop atm (the capture box isn't stable again...) trying to do TMPGEnc noise-reduction could quickly put me behind if I have more then 8 or 10 hours of source material per week to encode. These captured episodes aren't worth that amount of time to clean them up.
Once I've converted to M2V+WAV, I open up TMPGEnc DVD Author (TDA), create two tracks (one for each episode), add and rearrange the segments in each track, edit the menu text and then start the processing (which creates the VIDEO_TS folder contents). Authoring time takes maybe 5-10 minutes, and processing time takes 30 minutes (pulling the M2V+WAV files across the LAN).
Open up the VIDEO_TS folder, figure out how much of the disc space is in use (usually 3.7-4.0 Gb), and then I create PAR2 recovery data for all of the files in the folder. Either a 16Mb or 8Mb block size works well, with enough recovery blocks to fill the DVD up to around 4.3Gb. Some folks move their PAR2 files to another folder on the DVD, but I've just been leaving the PAR2 files in the VIDEO_TS folder. Makes it easier to verify the disc later and my Sony DVD player doesn't seem to mind that those files are in the VIDEO_TS folder.
Fire up ImgTools Classic to create an ISO of the proper UDF type, which gets written to my machine with the DVD recorder on it (different box then the one that I author the DVD on). That takes another 30 minutes (maybe 2 minutes to setup, then runs on its own). But while that runs I can be authoring another DVD, or capturing more video or doing cutting. I tried just putting the AUDIO_TS and VIDEO_TS folders on a data DVD using Roxio 6, but my copy doesn't create UDF DVDs that the Sony DVD player will recognize. (I suspect, according to what I've read elsewhere, that Roxio 6 is creating UDF 1.05 DVDs, but the standard requires UDF 1.02.) Not a big deal, using ImgTools is about as easy as copying the files over to the other machine directly. Burning the ISO at 2x in Roxio 6 takes around 30 minutes.
All told, I'm not spending an inordinate amount of time actively managing the process (there's a lot of "bulk processing" time involved), and I usually have the DVD ready the day after I do the capture. I'm still exploring various filters in VirtualDub to see if I can clean up the video signal in a reasonable amount of time. e.g. I'm currently trying out the vxVHS filter, but on my AthlonXP 2600+ I'm only seeing 3.5fps throughput which is way too long if I want to run 6-8 hrs/week of video through it. I may go back to using the "Smoother" filter at a setting of 10 or 20. I had stopped using it because it made things look muddy on the TV upstairs (looks okay on the computer), but that might have been a mis-configured TV (contrast was set to maximum). "Smoother" was a fairly quick filter (15-18fps) and I'd have the option to do my border fills again to get rid of tracking noise at the bottom of the frame.Labels: VideoCapture
posted by Wuphon's at
12:56 AM
Saturday, February 07, 2004
Rough Guide to VideoCap
Okay, definitely have the Hauppauge WinTV working properly, with no sound issues or sync issues (yay!). So now I need to figure out the steps required to cap a VHS tape and create a DVD. (For example purposes, I captured (3) MASH episodes.) Gonna write this as I go today, maybe clean it up later and create a permanent page, so there might be some errors here as it's a rough draft.
A. Capture: Capture off tape to MJPEG (Q19) and uncompressed WAV audio (48kHz, 16bit stereo). Eats up around 10Gb per hour (as a planning number), and I'm capturing at 720x480, 29.97fps using VirtualVCR. At least, I think I'm supposed to do 720x480 (other option for DVD is 704x480). Will figure that out once I finally get to the DVD output. Time required to capture and save is around 1.05:1 (close enough to 1:1, extra time is stuff like naming the files, re-arranging things on disk, making sure audio levels are set properly). It's important to make sure that your audio levels aren't clipping (overly loud, which loses the top part of the signal, sounds like frying something in a frying pan). You can almost always fix the audio later to be louder (normalizing the audio), so shoot for around 75-80% peak volumes (roughly 3-10db below maximum).
When capturing video, you should always capture a minute or two prior and after what you're planning on cutting as the final result. So if you want a 50 minute segment in the middle of the tape, start capturing 2 minutes before that segment and let the capture run for a minute or two after that segment. While it takes a little more space later, it's much easier to do cutting/editing in the computer rather then trying to manually time it with the record/stop buttons. For short segments, you may only want to capture 30-60 seconds before and after.
The exception to that rule is that a single capture file should not span across any breaks in the source tape (e.g. if you stopped the recording and then started recording something else). Recording across pauses/breaks in the VCR tape usually results in dropped frames, which might lead to audio-sync issues later. If you have no choice but to capture across a break/pause because there's only a second or two between the break/pause and what you want to capture, then try to minimize the effects by recording as short a period after the break/pause as possible. Such as stopping the capture during the next commercial break or scene change (if the audio goes completely quiet). The longer the clip, the more noticable any audio-sync issues would become.
The MASH episodes resulted in (4) seperate capture files as I stopped/started recording during each commercial break. Sometimes I collect the commercial breaks for later if I see a commercial that might be fun to see 10-20 years from now to remember how things were. With a DVD, I can put the commercials in a seperate menu so that you won't have to watch them unless you want to.
Key points: - check audio levels, don't compress audio, 48kHz, 16bit, stereo - video capture resolution of 720x480, saving as MJPEG Q19 (PicVideo codec) - check disk spaces, 10Gb/hr planning - 1 hour to capture 1 hour of video - target is zero dropped frames - capture more then you need
B. Clean-up Audio: Time to clean up the audio signal. The MASH episodes that I captured were extremely bad. Lots of hiss along with a 60hz hum. Since the non-MASH sections of the captures did not have these artifacts, it's apparent that the fault lies in the original TV transmission and not my capture setup. In addition, I want to make sure that the audio levels are the same (normalized to 90-90%).
First, we need to demux the audio stream which means outputing the audio portion of the captured clips to .WAV files so they can be edited with an audio/wave editor. Open up the AVI files using a fresh instance VirtualDub. Under the Audio menu, verify that Source Audio is selected along with Direct stream copy. Then do File, Save WAV, giving the WAV file the same name as the AVI clip, except with a WAV filename extension. (So if your clip is named "s02e20-capture.avi", call the audio file "s02e20-capture.wav".) This is a fairly quick process, maybe 10 seconds per minute of video, file size is roughly 11Mb/min or 660Mb/hr. Go ahead and export all parts of the episode at the same time.
Open up your audio WAVs in a wave/audio editing program (personally, I use Cool Edit 2000, but Adobe bought them out and I don't know what else is available). The main features that you need is the ability to normalize the audio (or make it louder/softer by a set amount) and noise reduction capabilities. I always to do noise-reduction on the audio signal first. My reasoning is that I'd rather get rid of any noise artifacts prior to making those artifacts louder/softer with normalization.
Cool Edit 2000 has the nice feature where you can build a noise reduction profile from a selected segment of the audio clip. So first I look for a quiet section, where there is no background music, foley effects or dialogue. Zoom in on that section, highlight what looks like a quiet spot and listen to it a few times. You'll need about 0.25-0.50 seconds worth of information for the filter to work properly. Sometimes you can't find a section in one clip, so you'll have to use a profile from another clip; which is why it's a good idea to edit all of your audio clips from a single episode at the same time. Once you have your noise sample selected, go into the Noise Reduction dialog and create the profile from the selected sample. I'd suggest saving out the noise reduction profile to an FFT file in case you ever need to use it again (or with a different clip). To apply the filter to the entire clip, close the dialog, select all (Ctrl-A), re-open the dialog and apply it. Noise reduction will take a bit of time, on my AthlonXP 2600+, it takes around 15-20 seconds to do NR on a 1 minute sample.
Next, if your audio isn't loud enough (it should peak around -3 to -10 dB on the meter), you'll need to do normalization. The tricky part is making sure that you use the same amplification on all of the clips from the same episode. If one of your clips is only quiet bits with no loud noises, and you normalize it, it will end up sounding louder then the other parts of the episode. This is another reason to capture more then you need as hopefully the lead or tail of the captured clip will have full volume dialog/music. If not, you'll have to take a guess and do some trial-n-error. Another alternative is to capture the entire episode as a single clip and then cut it into segments later (downside is increased risk of audio-sync issues when dealing with longer clips). Also be aware that you may need to apply different amplifications to the left vs right audio tracks (sometimes one is louder then the other). Normalization/amplification should go quick, takes around 5-10 seconds per minute of audio on my AthlonXP 2600+.
Once you've cleaned out the noise and fixed the volume levels, take a few minutes to spot check the quality. It should sound remarkably better then the raw source audio did.
Save the WAV files out to new filenames, e.g. "s02e20-capture-cleanedaudio.wav". Save it out as uncompressed PCM (should be the default). Again, count on another 660Mb/hr of disk space for the new audio files (you did buy the really really really big disk, right?).
C. Re-Muxing, Video Clean-up, Cutting: Before you can cut, you need to re-mux the cleaned up audio track back into the AVI file. You may also want to clean up the video a bit to get rid of any artifacts or fix brightness / contrast / color levels. Typically, I only get rid of any top/bottom edge artifacts which result from tracking errors. This can be seen as noise in the top/bottom lines of the frames where the colors are messed up. To remove these errors, I use a "fill" filter where I overlay a black rectangle over the offending lines. If the signal is really noisy, I may attempt to use a smoothing filter to make it easier on the encoder later. Now, for the quick list of steps in VirtualDub:
- open up your AVI, "s02e20-capture.avi" - Video, Filters, add/remove what you need - Set your video copy mode, use Normal recompress if you're not using any filters or Full processing mode if you are using filters - Set your video compression to MJPEG Q19 - Under the audio menu, choose WAV Audio and select your cleaned up WAV file - Set the audio mode to direct stream copy - select the portion of the clip that you wish to export - F7 to save as AVI, make the output name "s02e20-cropped.avi" - Save your processing settings, including your selection and edit list (checkbox at the bottom of the save dialog), e.g. "s02e20-capture2cropped.vcf"
And there goes another large chunk of disk space (10Gb/hr)! Processing speed on my AthlonXP 2600+ is around 20-30fps. Process all of your clips from a single episode during the same session, making sure to re-select the proper WAV file for each clip, so that your video filters are identical for all of the clips.
Optionally, you can choose to crop as a seperate step, but it's just as easy to do it now.
D. Final Audio Edit (optional): This is somewhat of an optional step, depending on how good you were at cutting and whether the audio in each cropped clip sounds okay at the start/end of the clip. Sometimes I find that the audio track starts too abruptly or gets cut off abruptly. When this happens, I export the audio to WAV again (de-muxing), load it up in Cool Edit 2000, adjust the fade-in / fade-out of the clip, and then save the new audio track in a seperate WAV file ("s02e20-cropped-faded"). I don't need to re-mux the audio back into the AVI, because TMPGEnc will allow me to do the re-muxing during the conversion to MPEG2.
E. Convert to MPEG2: This will take a while, so plan on setting this up to run overnight, or when you're going to do something else on the computer that doesn't take a lot of CPU power (checking e-mail, web browsing). TMPGEnc can be set to run at "idle" mode, which means that it will play nicely in the background, only using CPU cycles that you didn't use to run whatever other application you're using now. Note that playing a high-CPU requirement game like a FPS or other 3D-type game will eat up a lot of CPU and pretty much starve the TMPGEnc process.
Word of warning: I've just started using TMPGEnc today so I may not be doing things properly or best, but at least it's a starting point. I'll fine-tune the process later.
Encoding time for a 720x480 clip (8 megabits/sec output, with variable bit rate or VBR): - AthlonXP 2600+ - 4 hrs per 1 hour of video - Athlon 1Ghz - 12 hours per 1 hour of video - Pentium 1.4Ghz laptop - 6 hours per 1 hour of video
Bit-rate vs disc capacity (using 256kbps AC3 audio and a 4.7Gb recordable DVD): - 8000kbps Video, 70 minutes - 6000kbps Video, 95 minutes - 5000kbps Video, 115 minutes - 4500kbps Video, 125 minutes
The MPEG2 encoding is really slowing me down, which means I'm probably going to leave off here and try finishing up my guide later. I have produced a DVD that plays in a regular DVD player, mostly by using the wizard in TMPGEnc to encode at 8000kbps. Burning to DVD-RW did not work however, but DVD+RW media worked in the particular DVD player that I'm using to test. (My older DVD player will not read any recordable media.)Labels: VideoCapture
posted by Wuphon's at
9:55 AM
|
|