Log in

View Full Version : Using mpeg4 flavors for live capture.


DDogg
23rd November 2003, 03:46
I was curious if somebody has done the background research to be able to offer a reasonably strong opinion as to which flavor of mpeg4 seems to be the fastest with the most-est for the express purpose of live capture.

My machine is pretty decent, about equivalent to a XP 2800-3200 depending on how I set it. I was able to use the new version of Divx 5.1.1 at 640x480. CPU usage was about 65%. As to settings...I don't use mpeg4 much so I don't even really know what the hell I set it far. At that experimentation stage all I was concerned about was if it would be less than 100 CPU usage. Recommendations on proper settings would be welcome and save me some time.

I tried the internal mpeg4 in ffvfw but I guess I did not get something set correctly and it clobbered my CPU. Any feedback welcome as I am pretty well a mpeg4 noob. The last time I did anything serious with it was using the old 3.11alpha.

communist
23rd November 2003, 11:36
Setting your I-Frame interval to 1 and thus letting every frame to be encoded as an I-Frame is a good start (disable P / B-Frames).
Things that you should disable too : qpel / VHQ (XviD) /GMC.

You can also capture with const. quant 2 in XviD or even quant 1.

DDogg
23rd November 2003, 22:25
communist, thanks for the tip. It helped me get it sorted out. Now doing 720x480 with XVid, ffVFW-mpeg4 and Divx. It pushed the processor, but always seems to stay under 90% so it is doable and leaves a tad of headroom.

I found it interesting that mpeg4 using a constant quant of 2 seems to be nearly lossless to the eye. Subsequent mpeg2 encodings made from it seem equivalent to those made from Huffy source. Note I said "seem". I have not run any advanced tests. It does seem to be a viable alternative to Huffy under some circumstances where you need to conserve disk space.

Btw, source was high quality digital cable via s-video to my winfast deluxe. I don't know how it would work with nasty/noisy source.

Mole
23rd November 2003, 22:34
Is your source interlaced and are you capturing as interlaced or de-interlaced?

DDogg
24th November 2003, 04:19
Source:
NTSC 29.97 video from capture

Target:
Xvid 1pass quantizer (quant 2)
Motion search precision 3 (H.263)
VHQ 1
Max/Min I frame both 1
Enable interlacing checked
b-frame -1

Audio set as PCM CD Quality

Mole
24th November 2003, 06:50
I primary capture from noisy antenna source and when I tried using XviD with quantizer 1, the file size is so big, I might as well use huffyuv. If I use quantizer 2, the picture tends to be very blocky.

I don't think XviD handles noisy captures very well.

DivX is much better suited for noisy images. I found the built in pre-processing functions very useful also. Looks like it's some kind of temporal filter.

I always set key frames to be 25 though and I capture only at 352x288.
If keyframe is set at 1, wouldn't using an MJPEG codec give better results? I forgot, MJPEG doesn't handle interlaced material well, does it?

How much better compression ratio are you getting between XviD and huffyuv?

jggimi
24th November 2003, 15:19
...Looks like it's some kind of temporal filter.... The new 116-page DivX 5.1 manual (http://www.divx.com/support/guides/DivXGuide51.pdf) describes it as both spatial and temporal.

DDogg, if you wanted to try capture to DivX 5.1.1, this manual does indicate settings to use for the purpose. I haven't tried it, as my capture platform is only a 950MHz Athlon T-bird.

DDogg
24th November 2003, 19:50
Thanks for the replies. You guys pointed me to something that I think is going to work well for me. The pre processing in Divx, it seems to me, works particularly good on interlaced capture. It really cleans it up. Anybody else feel this is true also?

Reducing the res to 480x480 allows me to cap at 60-70% CPU with pre-processing on. The resulting AVI can be fed directly to CCE 2.50 (see note) or 2.67.x for SVCD as it is already resized, or VDub/in to remove commercials and such and then back out via Frame-serving as CCE will read the VDR. It seems a very convenient way to do it.

Whether it be the pre-processing, or that, plus a combination of >divx>mpeg2 re-encode, the final mpeg2 SVCD encoded seems very clean. It seems nearly cleaner, in regards to mosquito noise, than the live source, nor did I see any contour noise. Darn sure good enough to watch without being distracted by the perception of poor quality. Of course, I don't know much about capturing so anybody reading this should take anything I say with a grain of salt and check it yourself.

Using Divx 5.1.1.
General Tab Settings
Res to 480x480 (SVCD is my delivery media)
1 pass Quality based Quant 2
Performance quality to the leftmost position (fastest)

Video Tab Settings (gets interesting)
Pre Processing Source set to normal
Encode as interlaced
Top field first - checked
Max keyframe interval - 1

This gave me a 3.4 gig file for 45 minutes of video capture.

Note: CCE 2.50 complained about not having a DX50 interpreter when I fed it the raw avi, so I added a reg entry in Drivers32 vidc.DX50=Divx.dll and cce 2.5 worked ok. This was probably because I bypassed divx5 in fdshow. This may cause problems with other software so beware. So far I have not seen any. Its an ugly way to do it, but CCE 2.5 is a PITA when it comes to this type of thing.

communist
26th November 2003, 09:14
Originally posted by DDogg
Source:
NTSC 29.97 video from capture

Target:
Xvid 1pass quantizer (quant 2)
Motion search precision 3 (H.263)
VHQ 1
Max/Min I frame both 1
Enable interlacing checked
b-frame -1

Audio set as PCM CD Quality
With a system like yours (equivalent to 2800+...) you could even try following settings:
1 pass quant 2
Motion search precision 5 (even 6 worked for me)
MPEG Quantinization
I frames only
VHQ 0 / No chroma motion, qpel, gmc

I did this for short clips I captured with my XP 2000+ and I rarely got dropped frames. And if I remember quickly - Interlacing is broken in some XviD builds - you might turn it off aswell and check if there is any difference.

Kb_cruncher
2nd December 2003, 08:09
You may like to try using software that captures mpeg2 which would save you reencoding altogether.I use WinDVR and the quality is very good.It can capture to any resolution an bitrate you like upto 9000 Kbits\sec.I reencode to xvid anyway for playback on my xbox using the new xvid :-)and cannot fault the quality.
I capture from Sat tv to my Hauppauge wintv radio s-video input.

ppera2
2nd December 2003, 17:15
Originally posted by Mole
...I don't think XviD handles noisy captures very well...
I I forgot, MJPEG doesn't handle interlaced material well, does it?


Capturing noisy, dark scenes with DivX will give very awful picture.

Mjpeg is good for interlaced video too.
Why using DivX without keyframes? - Mjpeg is better for that, less CPU load etc.