H.264 (MPEG-4) editing

Status
Not open for further replies.

rrg

New member
Bottom line: start your testing NOW to see if you may want to migrate away from capping to MPEG2.
Well, I still haven't gotten myself an H.264 capture device, preferring to wait until the new VRD is a reality. But I have experimented with Handbrake (which uses x264) to convert MPEG2 captures to H.264, and I don't like the results at all. The additional artifacting is noticeable enough even with this low-res content that I prefer to keep the MPEG2 originals even at the cost of the extra storage space.

There are certainly knobs and configurations that I could experiment with to see whether I could produce something more watchable, but I don't have the patience for it. I think I'll have to get a capture device like the Elgato, see how it performs, and hope that I can return it if I don't like it.
 

bits

New member
Well, I still haven't gotten myself an H.264 capture device, preferring to wait until the new VRD is a reality. But I have experimented with Handbrake (which uses x264) to convert MPEG2 captures to H.264, and I don't like the results at all. The additional artifacting is noticeable enough even with this low-res content that I prefer to keep the MPEG2 originals even at the cost of the extra storage space.

There are certainly knobs and configurations that I could experiment with to see whether I could produce something more watchable, but I don't have the patience for it. I think I'll have to get a capture device like the Elgato, see how it performs, and hope that I can return it if I don't like it.
To bad the Elgato is for Mac!

I have used Handbrake to convert OTA HD (1080i and 720p) to h264 and it has done a very good job. Converting low res anything to anything is problematic. All conversions lose PQ and the lower the starting PQ the worse the loss is...and h264 is not different.
 

rrg

New member
Too bad the Elgato is for Mac!
Yes, and that would be fine for me. A Windows-compatible (or even Windows-only) device is not out of the question; with VMware it would be usable even on a Mac.

Is there any S-video-to-H.264 capture device that you, or anyone else here, would recommend for the purpose? Given that my main application will be capturing S-VHS playback, which will then be directly edited with VRD?
 

bits

New member
Yes, and that would be fine for me. A Windows-compatible (or even Windows-only) device is not out of the question; with VMware it would be usable even on a Mac.

Is there any S-video-to-H.264 capture device that you, or anyone else here, would recommend for the purpose? Given that my main application will be capturing S-VHS playback, which will then be directly edited with VRD?
I think the HD PVR 1212 from Hauppauge may do what you are looking for.
 

rrg

New member
I think the HD PVR 1212 from Hauppauge may do what you are looking for.
An interesting suggestion. I haven't paid much attention to the Hauppauge HD PVR because when I started recording HD almost ten years ago analog capture of HD was impractical. All the HD recording I've ever done has been digital capture (D-VHS, MyHD, Nextcom, various HD DVRs) and I've long had that problem well-covered.

But I see that this device will record SD as well (from S-video or composite). I have no need for all the PVR features, nor for HD component recording, so it seems like overkill. On the other hand, though it's a bit more expensive than some other SD-only devices ($200 versus $100 or $150) it's not outrageously so.

The main question I have is: is its encoder of high quality? I've been capturing S-VHS to MPEG2 at 4500 kbps; is it plausible that I could crank that down a fair bit for H.264 (say, to 1500 kbps) and get comparable image quality?

Some documentation says that this is Windows-only, but elsewhere I read that Elgato's EyeTV will now support it (at the cost of an additional $80) so I would still have the choice of platforms.

Here's a thought: this thing records from component. I still have some D-VHS VCRs with component output. I think the component output works with analog as well as with digital tapes. Might it be the case that by using component playback with S-VHS tapes I could get even higher-quality capture than with S-video?

This content is of low enough resolution that worrying about this is kind of silly, but still, if I could make it a little better merely by using a different set of cables, it might be worth doing.
 

JonW

New member
The HD PVR is capable of very high quality captures, but I wouldn't recommend it for low bit rates. In the past I had captured S-Video in MPEG2 format and then converted it to MPEG4 using WINFF and was able to tailor the quality and size very well while keeping the bit rate way down, but I haven't been able to reproduce anything close to that with the HD PVR.

I suppose you could capture at say 8MBPS and then re-encode it down to 1.5MPBS but that's going to be pretty slow.
 

SamuriHL

Member
I actually do that with my tv recordings. I capture around 8mbps and then use Cyberlink's MediaShow Esspresso to convert it to a 1MBPS mp4 for iPhone playback for my wife. It's not ultra QUICK by any means but it's not terribly slow, either. On my quad core it does it in half time...meaning twice real time.
 

rrg

New member
The HD PVR is capable of very high quality captures, but I wouldn't recommend it for low bit rates. In the past I had captured S-Video in MPEG2 format and then converted it to MPEG4 using WINFF and was able to tailor the quality and size very well while keeping the bit rate way down, but I haven't been able to reproduce anything close to that with the HD PVR.

I suppose you could capture at say 8MBPS and then re-encode it down to 1.5MPBS but that's going to be pretty slow.
I don't want to re-encode anything if I can avoid it (that's one of the reasons I'm using VRD). I want to capture, trim, edit out commercials, and save the result.

The quality I'm getting with MPEG2 capture is "okay"; the main reason I want to capture directly to H.264 is to get smaller captures, or improved image quality, or both.

It sounds like I won't be able to get that with the HD PVR (i.e. that I'll have to use high bit rates anyway in order to get good results). That's surprising.

Is there any other device worth checking out in this context, then?
 

SamuriHL

Member
H.264 can give you higher quality and smaller files, but, you need to remember something. At the same bitrate, h.264 will give you better image quality than MPEG2. If you want the same quality that your MPEG2 captures are giving you, you can lower the bitrate on the h.264 capture and it will give you smaller file sizes. There's no reason you couldn't capture a 1.5mpbs or 2mbps h.264 file with an HD PVR.

The real issue here is your source material. When you start with a less than perfect source, it's going to get progressively worse as you capture it with a lower bitrate. Even the "magic" of h.264 isn't going to solve this problem. The lower the bitrate, the more information you lose, and when you have an unclean source to begin with, it starts to rapidly degrade the PQ. Hence, what we're saying is capture it using h.264 on an HD PVR using the same bitrate as your MPEG2 encodings and this will give you a higher PQ than what MPEG2 gives you. And the files will be roughly the same size.
 

seetheviz

New member
H.264 conversion is most valuable when your source is already high-rez/high-bitrate. Think 720 lines or higher, at 10+ mbps. Converting an MPG2 with those stats to half the bitrate is doable with H264, and may introduce no visible artifacts at all, depending on source. If you're talking 480 line caps (SVideo) in mpg2, cutting the bitrate in half while converting to H.264 may very well introduce artifacts. H.264 isn't a wonder cure-all. At a given low-res and low bit-rate, XVid/MPEG4 may very well give you cleaner results than H.264.

Plus there's always the issue of double-encoding when you do a conversion. That's an issue that's magnified when you're working with low-rez caps and trying to squeeze them down as much as possible.
 

SamuriHL

Member
That's quite correct. This is why I start with a high bit rate recording and then convert it down rather than trying to record it at the lower bit rate. It takes a bit more time but the results I get are far better. But I'm also staying in the h.264 family. :) I've not a lot of experience with mpeg2->h.264 encoding, especially at low bit rates.
 

rrg

New member
Again, I don't intend to convert MPEG2 captures to H.264--I didn't like the results when I tried it. My only interest in H.264 (in the context of S-video capture) is if it either significantly reduces the file sizes or significantly improves the image quality.

I understand that (assuming a good encoder) the HD PVR should produce better results at the same bit rate.

The S-video-to-MPEG2 captures that I'm getting with my current equipment mix are good enough (barely) but each 25-minute program approaches a gigabyte in size, and that seems excessive given that the same shows, when re-broadcast now in MPEG2 and directly captured, are perhaps a third that size. My S-VHS recordings were made years ago from C-band broadcasts using a high-end satellite receiver, and are about as good as a consumer could do at the time. But I'm still far enough removed from the original kinescopes that I incur a big loss.

Anyway, it sounds like I would need to get this device and experiment with it in order to determine whether it can improve things for me. If in practice I end up needing to capture at the same bit rate, then it may not be worth the additional cost unless there's a big image quality improvement.

When the new VRD comes out, I'll probably try this.
 

JonW

New member
It's tricky business compressing video down to lower bit rates and maintaining decent motion response, avoiding macro blocking, and decent resolution. I had to fiddle with WINFF/FFMPEG quite a bit to find settings I liked when converting from MPEG2.

I just don't think the HD PVR's compressor has enough knobs to do the job, and I doubt any hardware solution will compare to a well tweaked software configuration.

Heck, I don't even remember where I came up with these WINFF settings:

-r 29.97 -vcodec h264 -s 720x480 -aspect 16:9 -flags +loop -cmp +chroma -deblockalpha 0 -deblockbeta 0 -b 1250k -maxrate 1500k -bufsize 4M -bt 256k -refs 1 -bf 3 -coder 1 -me umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec aac -ab 96k -ar 48000 -ac 2

So, if you want to capture it in one shot with the best quality it's going to cost you disk space. If you want to compress it down and maintain as much of that quality as possible, you're probably going to have to go with a second pass.

btw, I don't use the "PVR" features of the HD-PVR. I just use it as a capture device, and there's even a third party capture utility (RcCap) that can make captures on even low-end hardware - albeit it's non-trivial to configure.
 

seetheviz

New member
Again, I don't intend to convert MPEG2 captures to H.264--I didn't like the results when I tried it. My only interest in H.264 (in the context of S-video capture) is if it either significantly reduces the file sizes or significantly improves the image quality.

I understand that (assuming a good encoder) the HD PVR should produce better results at the same bit rate.

The S-video-to-MPEG2 captures that I'm getting with my current equipment mix are good enough (barely) but each 25-minute program approaches a gigabyte in size, and that seems excessive given that the same shows, when re-broadcast now in MPEG2 and directly captured, are perhaps a third that size. My S-VHS recordings were made years ago from C-band broadcasts using a high-end satellite receiver, and are about as good as a consumer could do at the time. But I'm still far enough removed from the original kinescopes that I incur a big loss.

Anyway, it sounds like I would need to get this device and experiment with it in order to determine whether it can improve things for me. If in practice I end up needing to capture at the same bit rate, then it may not be worth the additional cost unless there's a big image quality improvement.

When the new VRD comes out, I'll probably try this.
I was trying to suggest why you might have been unhappy with your H.264 tests due to low rez, not some problem with the conversion process. Working with SD and lower rez in H.264 can be frustrating/fruitless. You can get very good results going from SD MPEG2 to MPEG4, though. MPEG4 is more geared towards good results at low bitrates. H.264 is geared towards making HD video a manageable size.

Personally I like MPEG2 caps for ease/accuracy of editing, then conversion to MPEG4/H.264 depending on the rez. I err on the side of higher capture bitrates, because big caps only take up space temporarily. Also, hardware MPEG2 capture devices are less forgiving at low bitrates than a good 2-pass software encode. Video is always about tradeoffs. Disk space vs rez vs quality vs re-encode time vs edit time, etc. You have to decide what your priorities are and work around them. There's no one right solution.

If your source is SD caps via SVideo, try encoding to XVID/MPEG4 after editing. Depending on the source material/bitrate, you may be able to squeeze your caps down to 2/3 or 1/2 the size with no noticeable degradation. Ex. 2600 avg bitrate down to 1600 avg with similar quality. There are also some benefits to the MKV/MP4 containers (chapters, thumbnail, subtitles, etc.) that may be beneficial on some playback devices.
 

Maccara

New member
MPEG4 is more geared towards good results at low bitrates. H.264 is geared towards making HD video a manageable size.
That's not true. (but in case it is for some specific encoder manufacturer, please provide references)

MPEG4-ASP & MPEG4-AVC (H.264) are both general purpose and are "geared towards" whatever resolution you want them to depending completely on your abilities to use them.

With "defaults" MPEG4-ASP tends to result in a little bit softer picture which helps the encoder, but there's nothing preventing MPEG4-AVC achieving the same (with encoding settings/pre-filtering).

For comparable image quality MPEG4-AVC will (almost?) always be more efficient than MPEG4-ASP for any given resolution.

However, MPEG4-AVC will also require significantly more resources during encoding which may be prohibitive for real-time capture to achieve the best quality/efficiency.

For s-video analogue captures I personally would always capture losslessly (Huffyuv & Lagarith are good choices for codecs for that) and then edit/filter to my liking and only in the final stage convert to H264 (or whatever).
 

seetheviz

New member
That's not true. (but in case it is for some specific encoder manufacturer, please provide references)

MPEG4-ASP & MPEG4-AVC (H.264) are both general purpose and are "geared towards" whatever resolution you want them to depending completely on your abilities to use them.
You're right, that was inaccurate as phrased. The MPEG4 standard was originally aimed at lower bitrates, and ASP did a fair job of it before AVC was fully functional/established and the range of usefulness for all flavors of MPEG4 got expanded. Measured purely on a quality per bit level, AVC obviously kicks ASP butt now, but in the low-rez/low-bitrate realm, especially when cpu utilization is taken into consideration, ASP still has uses.

With "defaults" MPEG4-ASP tends to result in a little bit softer picture which helps the encoder, but there's nothing preventing MPEG4-AVC achieving the same (with encoding settings/pre-filtering).

For comparable image quality MPEG4-AVC will (almost?) always be more efficient than MPEG4-ASP for any given resolution.

However, MPEG4-AVC will also require significantly more resources during encoding which may be prohibitive for real-time capture to achieve the best quality/efficiency.

For s-video analogue captures I personally would always capture losslessly (Huffyuv & Lagarith are good choices for codecs for that) and then edit/filter to my liking and only in the final stage convert to H264 (or whatever).
Efficiency isn't just quality per bit. It's also encode and decode power/time required. If your editing PC isn't high-end, H.264 encodes may not even be an option due to time constraints. If your playback machine is a handheld device or a lower-spec pc (or unknown system), ASP playback is a simpler task than AVC. In the end, there's only so much you can do with an SD source. If you're getting it from a satellite or cable provider, it's probably already been excessively compressed and/or downsampled. Lossless is useful if you plan to do a lot of processing, or salvage some unique clip, but probably overkill for the majority of users/situations out there.
 

Dan203

Senior Developer
Staff member
For s-video analogue captures I personally would always capture losslessly (Huffyuv & Lagarith are good choices for codecs for that) and then edit/filter to my liking and only in the final stage convert to H264 (or whatever).
Have you tried DV or MJPG? Both take up considerably less space then Huffyuv/Lagarith, are still easily editable and for most people look indistinguishable from the source. (MJPG can be bad if you over compress, but looks fine at lower compression levels)

Dan
 

Maccara

New member
Have you tried DV or MJPG? Both take up considerably less space then Huffyuv/Lagarith, are still easily editable and for most people look indistinguishable from the source. (MJPG can be bad if you over compress, but looks fine at lower compression levels)
Sure, I use those all the time too, but I actually use them for _speed_ foremost (especially Lagarith has slow decoding speed making it somewhat impractical for HD editing on my hardware).

Depends on situation - if I can muster with single (or few) edit sessions where generational degradation is not a big issue, I use DV usually (if resolution permits). If I know I will be doing multiple edits (or if I have no idea how much I'm going to edit :)) I usually select something lossless just to be safe (DV starts to show chroma artifacts already after only 5-10 generations).

If space is an issue, I could try h.264 in lossless mode, but I would need to verify first that editing software is compatible with that (not even many decoders support lossless h.264 yet - I think CoreAVC does, but f.e. ffdshow does not) and that it would really benefit me in some way.

Space has not really been a consideration for me so far, as my edit array has ab 1.5TB and I can clear up older stuff (i.e. finish them by encoding to final format and storing to archive) before I have to store new, but I also do not edit much HD (with that space probably would be an issue at some point).
 

robena

New member
Dan (Rosen),

Many European broadcasters, and in particular Sky UK, set the video_full_range_flag incorrectly, leading to a washed out image with most network players.

It would be extremely useful if VRD H.264 had an option to change this flag.

Thanks!
 
Last edited:

SamuriHL

Member
Are you guys any closer to releasing it? It's been a few days now. I'd really like to give it a proper shake down and run through some videos.
 
Status
Not open for further replies.
Top Bottom