Log in

View Full Version : Codec for capture


nonoitall
10th September 2008, 23:11
I'm capturing a lot of video using an analog capture card. Because I need to retain hours of the content before I begin editing it, using a lossless video codec is somewhat impractical given the shear amount of space that it takes up. I've read that MJPEG at 100% quality tends to be good for captures such as these. (Still lossy, but barely so, and ideal for an analog source that's going to be a tad noisy anyway.)

So I was planning on using ffdshow's MJPEG encoder using the 100% quality setting. But, being the curious fellow that I am, I tried out several of ffdshow's other encoders, just to see how they compared. I found that when I used ffdshow's MPEG-4 (not XviD) without B-frames, I could capture at roughly half the data rate that MJPEG did, and while it required heavier CPU usage, it still was not beyond what my system could handle.

So, what I'm wondering is whether there should be a quality difference between 100% quality MJPEG and 100% quality MPEG-4? (Overall, I've pretty much kept the default settings for both codecs.) I know they both compress material differently, so the results of their compression won't be identical, but is there anything that would make one particularly better than the other in terms of quality?

VonOben
11th September 2008, 12:47
is there anything that would make one particularly better than the other in terms of quality?

Quality-wise I don't really know. Depends on alot of things. However, the MJPG can be cut in any frame. MPEG4 can not.

FlimsyFeet
11th September 2008, 15:34
But if it's I-frame only MPEG4, it should be?

Blue_MiSfit
11th September 2008, 20:03
Yes, seeking should not be an issue with intra-frame only mode.

However - you might want to look into alternatives. libavcodec's MPEG-4 isn't particularly impressive :)

Xvid or even x264 might be better options.

~MiSfit

nonoitall
12th September 2008, 06:23
Actually, I don't mind having P-frames, since I won't be editing the captured video itself, per se. (I'm only editing once with an AviSynth script to remove noise and deinterlace, and in the process I'll be transcoding to a lower rate H.264.)

Yesterday I decided to do some testing, so I recorded a clip losslessly and transcoded it using several codecs (MJPEG, ffdshow's MPEG-4, and XviD) so I could compare quality, data rates and speed.

MJPEG was obviously the fastest, and had the highest data rate.

ffdshow's MPEG-4 had very comparable quality. In fact, while its average PSNR was slightly lower than MJPEG's, its overall PSNR was slightly higher, and its minimum PSNR was much higher. It seems to manage to capture smoothly, regardless of scene complexity. (It clearly is multithreaded since CPU usage got up to around 120-130% during capture, with no dropped frames or jerkiness.)

For some reason I got poor results with ffdshow's XviD. It seemed to use almost as much data as MJPEG. I also tried the standalone XviD codec, but I think I need to experiment with it a bit more to find good settings for a fair comparison. (For some reason, it didn't seem like it was able to utilize multiple processors, since hitting 100% CPU usage during capture would cause dropped frames.) Incidentally, if anyone happens to know what good capture settings would be for XviD, that'd be helpful. I just told it to use 2 as a quantizer and adjusted the other settings to try and get it fast enough for real-time capture.

I'd give more detail on the results of my experimentation, but my desktop PC on which I conducted it is out of commission for the moment for unrelated reasons.

Blue_MiSfit
13th September 2008, 00:09
What about intra-only MPEG-2?

~MiSfit

JoeShrubbery
13th September 2008, 00:33
I don't really do much analog capping anymore, but way back when I was I had used FFDShow's mpeg4 (I-Frame only, constant quant 2) for a fair good chunk of time. It always worked great for me, I found it a lot better trade off in quality vs file size than the mjpeg I had been using previously.