PDA

View Full Version : Capturing AVIs w/ PVR-150


joemadeus
26th November 2005, 18:24
I bought one of Hauppauge's PVR-150 capture cards, not realizing I couldn't capture raw frames, run them through Huffyuv and save the resulting AVI. I've been trying to work around this, and I actually have a filter graph put together that'll do what I want (I attached it to this post) but I don't know how to take that graph and make the equivalent work in, say, VirtualDub. I assume that building a graph in GraphEdit is just a way to make sure that a combination of filters, etc., works before coding something (in other words, before creating your own capture app or something.)

I can run GraphEdit with the loaded graph, but the audio goes out of sync really quickly and I'd like to have at least some PVR/VCR-like support (GE doesn't have this, of course.)

Where do I go from here? I don't want to buy another video cap card (though the idea of capturing digital video appeals to me.) I've been through the guides, the faqs and the forums on this, VCDHelp.com and shspvr.com -- no luck.

I've tried:
* DScaler: Captures avi frames, but doesn't allow me to compress using Huffyuv and there's no audio
* VirtualDub: Captures AVI with a 4cc of HCW2 (Hauppauge's) and I can't load Hauppauge's color format converter (it's a .ax file?)
* VirtualVCR: I can load the color format converter, but it doesn't capture, failing with 'E_FAIL: 80004005' error. No idea what that means.
* MPEG captures: well, this works, of course, but even on high bitrates I wind up with artefacts. I'd rather process the raw frames myself and get better quality.

Thanks!


-j

joemadeus
28th November 2005, 16:30
An update:

I managed to get video going in VirtualVCR (it couldn't handle a 'custom' video format that happened to be identical to the default :rolleyes: ), but there's still no audio. A thread on shspvr.com ( http://www.shspvr.com/smf/index.php?topic=6403.0 ) says that I should be able to select the capture card as the audio device, but all I see in VVCR's Settings...Devices tab is the motherboard's audio line-in. Is there any way to add the capture card as an audio line-in? Is this a bug in Hauppauge's installer?

Thanks.


-j

TakuSkan
15th December 2005, 02:27
An update:

I managed to get video going in VirtualVCR (it couldn't handle a 'custom' video format that happened to be identical to the default :rolleyes: ), but there's still no audio. A thread on shspvr.com ( http://www.shspvr.com/smf/index.php?topic=6403.0 ) says that I should be able to select the capture card as the audio device, but all I see in VVCR's Settings...Devices tab is the motherboard's audio line-in. Is there any way to add the capture card as an audio line-in? Is this a bug in Hauppauge's installer?
I just purchased the same Hauppauge WinTV PVR-150 card, and am having the same problem in VirtualDub. I get video, but no matter how I set the audio settings, no audio.

The VirtualDub audio menus are:

Audio Input > "No Input, Stero Mix, Microphone, CD, AUX, Line In, or WAV"

Audio Source> "Now Source, Tuner, Line In 1, or Line in 2"

Capture Device> "0 Capture device, or 1 C-Media WAV Device

No matter what combination I set, I get no sound through VD.

Have you had any more luck joemadeus?

I'm still not sure if I ought to keep this card, or return it for a better one. I'm having problems with GSpot showing the test file I made in VD being encoded with a proprietary Hauppauge codec: HCW2. And VD can't open the file due to lack of a proper decompression codec.

If the files created with this WinTV PVR-150 is going to be fussy about compatibility with most other video programs, that's not a good sign.

TS

DrP
15th December 2005, 10:22
Why on earth are you using a hardware encoding MPEG/2 card to capture AVI? Just crank the MPEG/2 bitrate up to something like 15Mbit/sec and the audio up to 384k and capture that way. You can even push the encoder further if you don't mind it producing out of spec video. Then recode the resulting file to something that suits you better.

The HCW2 codec is not a lossless format anyway.

joemadeus, don't imagine that by going to a consumer grade (even pro-sumer grade) DV capture solution that you are going to do away with all artifacting. Odds on you'll get less nasties via your PVR card at 15Mbit/sec than you would with the typical DV device (and that includes the canopus ADVC1x0). By nasties I mean ringing on the edges of high contrast edges and visible quantiser blocks in overly complex images. Having said that, the PVR150 doesn't appear to be capable of producing video with a quantiser of less than 2 in any given frame, but thats no loss as the raw sampling on the card doesn't appear to push past what that can reproduce anyway.

idigvb
15th December 2005, 17:44
Can I ask you some questions:
What is the source of capture (broadcast or vhs for example)?
Have you tried using S-video?
Is the source NTSC or PAL?
Have you experienced any audio clipping or distortion problems?

TakuSkan
15th December 2005, 19:25
Why on earth are you using a hardware encoding MPEG/2 card to capture AVI? Just crank the MPEG/2 bitrate up to something like 15Mbit/sec and the audio up to 384k and capture that way. You can even push the encoder further if you don't mind it producing out of spec video. Then recode the resulting file to something that suits you better.
Well... I guess it's easy to tell I'm new at this... huh :eek:

I was experimenting to see if I VDub or VDubMod could be used to encode an MPEG-2 encoded file. But I gather that's not going to happen... right?

But yeah... from that test I see it made an AVI with the HCW2 codec that the PVR-150 must have installed. I'm not quite sure why that happpened at all if HCW2 is a codec from capturing to an AVI container, and this card only does MPEG captures. Maybe someone can straighten me out there.

So from your reponse, I take it that there is no chance in h*** that this card is ever going to capture in a lossless AVI container. I was beginning to suspect that just the other night.

Are there no capture cards out there with a MPEG-2 hardware encoder that will also provide capturing in a lossless AVI format too?

Thx,

TS

DrP
15th December 2005, 19:43
virtualdub and virtualdubmod can't output mpeg/2. virtualdubmod can read it and then frameserve to another program such as tmpgenc to encode to mpeg/2.

It wouldn't at all suprise me if the HCW2 codec is taking the MPEG/2 output of the card and decoding it back to individual frames or just wrappering the MPEG/2 so it can be put into an avi container. I don't know enough about it to say either way though.

Read the SHS PVR forum mentioned above, it might give you some info about what cards can do what.

TakuSkan
15th December 2005, 23:21
virtualdub and virtualdubmod can't output mpeg/2. virtualdubmod can read it and then frameserve to another program such as tmpgenc to encode to mpeg/2.Okay... I have tmpgenc installed... so that's an option. I've just read about frameserving in passing at this point. I'll do a litle more research on it.

Read the SHS PVR forum mentioned above, it might give you some info about what cards can do what.Ah... with a base URL of http://www.shspvr.com/smf/ ... Okay

Haven't yet found what SHS stands for yet amongst the seemingly endless stream of information I need to digest. :)

Thx,

TS

tal.aloni
19th March 2009, 15:00
sorry for bumping an old topic,
I have succesfully written an HCW2 to YV12 Converter (the conversion itself is lossless, it just modifies the order of the bytes),

detailed information about the HCW2 colorspace:

FOURCC: HCW2
Used by: Hauppauge WinTV-PVR-150 (I think that WinTV-PVR-500 uses it as well)

it's a YUV format created by the card when capturing AVI,
it's a bit hard to explain it's structure, so bear with me:

Format Description:
The format itself is a YUV with 4:2:0 chroma subsampling (and can be easily translated to YV12)
Each frame is starting with a Y Plane, followed by interleaved U / V Planes,
The Y Plane is constructed using a 16 x 16 (width x height) pixels macroblocks,
the pixels, as ordered in the stream, should be drawn vertically inside each macroblock, starting top left. (e.g. the second pixel should be drawn below the first pixel, and not to the right of it), the second line (pixel 17), should be drawn to the right of the first line, at the top of the macro block. (and so on)

the second macroblock should be drawn to the right of the first macroblock. after the frame width is filled with macroblocks,
we continue at the left side of the next row (below the first row). (and so on)

The U plane, and the V plane, are using the same technique, but with a 8 x 16 (width x height) macroblocks.


Notes:
the above information is a result of reverse engineering, it could be inaccurate, or different for different resolutions.
I have emailed Hauppauge, but they did not provide any informations about this colorspace.

Tal Aloni

Download: (Application + Source)
The application and source provided as-is, the application is very simple, does not contain much error-handling code, and have been only tested with PAL materials so far.

Application (Dot-Net Framework 2.0 is required):
http://vm1.duckdns.org/public/hcw2/HCW2%20Video%20Decoder%201.0.2.exe

Source (C# 2.0 - Visual Studio 2005):
http://vm1.duckdns.org/public/hcw2/HCW2%20Video%20Decoder%201.0.2.zip

Revision History:
1.0.2:
+ improved logging (Null frames detection)

1.0.1:
+ Added support for Files > 2GB (OpenDML)
+ Added an option to write log file.

1.0.0:
Initial Release

Aktan
18th January 2012, 22:28
Very nice application tal.aloni. I was curious, could this be made into a DirectShow filter? I know the card comes with a filter that converts from HCW2 to YUY2, but as you already know, it is really YV12. I was wondering if you could write such a filter to go to the correct YV12.