Log in

View Full Version : HOWTO: Capture Digital TV Using DVB-C/S/T card and convert to Divx


inuyasha
18th December 2002, 14:24
Preface: I am going to outline here the process I use to capture PAL Digital cable using my Hauppauge WinTV DVB-C card. This is not really a question, but I am open to comments. Hopefully this might also help someone using a Technotrend derivative DVB card trying to find out how to capture.

I assume you have allready installed the card, drivers and applications for your card and can see TV programs with it.

The quick way:

1. Set up your TV application ie. HighendTV.exe to capture in PVA format and start capturing.

The reason I decided to use PVA instead the other option mpeg-2 is that PVA seems to be the closest thing to the real transport stream you can get out of this hardware http://www.technotrend.de/download/av_format_v1.pdf.
Second reason was that there was 2 very nice utilities for PVA (PVACut, PVAstrumento) and I failed to find programs that would do similar operations to MPEG-2 format properly.

I personally use progDVB (http://www.progdvb.com) to capture. It's supposed to work better than other programs in capturing and not produce too many frame drops. If a program is badly written the memory overflows will result in frame drops in long sessions. There's also a setting where you can easily define the priority of the program. I set it Above normal. The newest versions are kind of beta's and might not even work with DVB-C cards and it's not too easy to set up. Refer to http://www.tforums.com/viewforum.php?f=12 if you have problems.

2. We use PVACut (http://www.tirtanium.de/extra.html) to cut out the addvertisements and PVAStrumento (http://www.offeryn.de/dv.htm) to convert and demux the PVA file to MPEG-2 video and audio files.

In PVACut the only setting I have changed is "Audio time pvaassemble endoffset in ms" to 0 (They say to put this to 0 for PVAStrumento so I obey ;)

If you do not feel the need to demux you can also save the file to MPEG-2 PS file and continue to convert it to proper SVCD or author DVD off it.

3. Convert the mpeg-2 files to divx using Doom9's conversion guide (http://www.doom9.org/index.html?/svcd2divx.htm). I use Divx5 so you need also this guide (http://www.doom9.org/index.html?/gknot-main3.htm).

In this guide is provided step by step instructions how to convert
SVCD ie. MPEG-2 to divx and since we have mpeg-2 files to convert we can use it from the DVD2AVI step.

Since I capture PAL I just check Field DEinterlace and neutral bi-cubic resize that pops when you click "Save & Encode".

There is also another software than supposedly can help a lot and is also designed for DVB converting ie. DVX (http://www.planetdvb.net/dvx/), but it's a bit alien to me so I use Gordian Knot which I have learned.

4. After completing the Doom9 guides for converting SVCD with the codec you choose you're done and you have succeeded in creating a divx (or whatever) conversion of your captured material.

This is a very quick procedure and if the source quality is good you also will get good results.

But as we know MPEG-2 compression has macroblocks which become visible occasionally in fast moving scenes. Also MPEG compression is sensitive to noise and for example in cartoon and anime you can see Chrome? noise in areas that should be clear and also near clear lines.

In order to battle this you can use filters (http://shelob.mordor.net/dgraft/) in step 3.

For example I am now converting cartoon which had some noise in it. I used Gordian Knot to produce Avisynth script (avs where I deinterlaced and cropped it), which I then loaded to virtualdub and used several virtualdub filters from Donald Graft (http://shelob.mordor.net/dgraft/) to reduce the noice. I followed Poopity Poop's (http://web.syr.edu/~tjmyers/animefilters.html) setup adding temporal smoother filter right after resize and fidled with the settings until I was happy enough with the result.

I know all the virtualdub part could be also done directly using Avisynth (I understand it can use virtualdub filters too.), but I think Virtualdub provided a nice tool to see the source deinterlaced on 1 window and the result of the filters I am using to clear the picture in the other.

Happy capturing, Inuyasha

inuyasha
18th December 2002, 16:46
Here are the scripts for the example mentioned in the fist message.

Avisynth script:

#
# Created with Gordian Knot
#
# http://thewef.nav.to
#
# PLUGINS
# get them from http://users.win.be/dividee
LoadPlugin("d:\PROGRA~2\GORDIA~1\mpeg2dec.dll")
LoadPlugin("d:\PROGRA~2\GORDIA~1\decomb.dll")
#
# SOURCE
mpeg2source("F:\YLE TV2 D - December 17 16 54 56.pvacut.DVD2AVI.d2v")
#
# DEINTERLACING
FieldDeinterlace()
#
# CROPPING
crop(24,8,688,568)

Virtualdub filters:

VirtualDub.video.filters.Add("smart resize (1.1)");
VirtualDub.video.filters.instance[0].Config(640,480,0,4,0,0,0x000000,"0 1 1 4 320 240 100 0 0 0 0 4 4 2 2");
VirtualDub.video.filters.Add("temporal smoother");
VirtualDub.video.filters.instance[1].Config(4);
VirtualDub.video.filters.Add("smart smoother (1.1)");
VirtualDub.video.filters.instance[2].Config(5, 40, 0);
VirtualDub.video.filters.Add("warp sharp");
VirtualDub.video.filters.instance[3].Config(78);

Zhnujm
18th December 2002, 18:31
my suggestion is to use virtualdub for the cutting. saves one step. and you can capture to mpeg-2 directly (you can skip pvacut and pvastrumento works also with mpeg-2 files).
if you capture pal movies you can also skip the Deinterlacer most times, usually pal movies are not interlaced.

bye

inuyasha
18th December 2002, 19:13
Originally posted by Zhnujm
my suggestion is to use virtualdub for the cutting. saves one step. and you can capture to mpeg-2 directly (you can skip pvacut and pvastrumento works also with mpeg-2 files).
if you capture pal movies you can also skip the Deinterlacer most times, usually pal movies are not interlaced.

bye

I did that, but when there is frame drops audio and video goes out of sync. I need something to fix the GOP timecodes or whatever they are and virtualdub alone cannot do it.

That is where pvacut and pvastrumento comes in.

At least this is the case when I separate video and audio of course.
I'm not exactly sure how I can make my avisynth script also put forward the audio to virtualdub. Perhaps you can correct the above avisynth script to include the audio too.


Inuyasha

Zhnujm
18th December 2002, 21:41
you are right, there is no way around pvastrumento (except a 100% correct encoding, and only way to check this is pvastrumento again :) ).
i just meant you can skip the pvacut step and instead edit the file with audio in vdub.
i usually demux and correct the mpeg files with pvastrumento, encode the sound seperatly with besweet and load it together with the video (avs file) in vdub. i just use a mpeg2source in the avs file because im using vdub for the filtering. your way with avisynth filtering should of course be the faster way but i like the easy use of vdub.

im really looking forward for a vdub with full mpeg-2 support.

inuyasha
19th December 2002, 03:46
Originally posted by Zhnujm
i just meant you can skip the pvacut step and instead edit the file with audio in vdub.
i usually demux and correct the mpeg files with pvastrumento, encode the sound seperatly with besweet and load it together with the video (avs file) in vdub. i just use a mpeg2source in the avs file because im using vdub for the filtering. your way with avisynth filtering should of course be the faster way but i like the easy use of vdub.

Yes. This seems a nice way to do it too and this time I understood exactly what you mean ;) Though I am not quite sure Virtualdub alone can handle the sound correctly since I use VBR sound encoded with lame. The best part in your way is that you do not need to worry about if there is enough mpeg-2 I-frames to cut from.

Originally posted by Zhnujm
im really looking forward for a vdub with full mpeg-2 support.

Perhaps you can try virtualdubmod (http://sourceforge.net/projects/virtualdubmod)

Project Virtualdubmod
VirtualDubMod is a unification of several popular modifications of the famous video editing software VirtualDub by Avery Lee. The first step will be to unite VirtualDubMPeg2, VirtualDubOGM and VirtualDubAVS.

I have only used the original Virtualdub and Nandub so I don't know how this works and how full the mpeg-2 support actually is.

Inuyasha

cweb
19th December 2002, 11:03
I tried to use Virtualdubmod to read DVB-S mpeg2 files directly and it did not work. It seems that they want vob files. I still use avisynth to process them.

I don't record in PVA, but in MPEG2 using the hauppage program. I don't use PVASTRUMENTO except for damaged files.
In most cases the files are ok (unless I'm doing some simultaneous processing while recording which is a no-no if
I want the highest quality) and well I use DVD2AVI - avisynth2 with FieldDeinterlace, Convolution3D filter (to remove some of the MPEG2 noise) at movieLQ setting. The result is either a KVCD encoded with TMPGENC or an XviD using Virtualdubmod. If you record a music video, remember that you get a quality mp3 or ogg with the resulting mpa file (created by DVD2AVI). I get some clicks and pops which I need to replace with silence. I used to use cooledit to replace them. Yesterday I installed that essential mpeg plugin for Winamp 2 and now I can remove clicks automatically. Clicks in my KVCD used to make the dvd player change sound level abruptly, so that's why I remove them. It entails converting the mpa file to wav 48khz but the result is very good and I am happy.

Zhnujm
19th December 2002, 21:35
you can just rename the mpeg file to .vob to open them with vdubmod. its more a vdub with dvd2avi plugin, and the sound did not work for me.
but it should be save to use vdubmod for editing files with vbr mp3. dont know exactly , i only use cbr files.

@cweb: click and pops with a dvb capture are VERY unlikely if the capturing works correct. have you checked such a file with pvastrumento ? i only have errors in picture or sound if pvastrumento reports missing audio/video frames.