Log in

View Full Version : H.264 Encoding, How to convert older video files to same quality lower file size?


Jarun
18th March 2011, 08:20
I have a basic understanding of encoding. But I need help.

I have many movies encoded with many different formats, some as old as the internet lol. This ranges from Xvid, divix, rm, mov. and every generation of them. I would like to convert all of my movies so I don't need k-light codec megapack, to play them all.

But more importantly, I would like to save space. However, I am running into an issue.

Converting relatively new formats such as xvid and divix (in the scope of mpeg2 as being old), I have to sometimes exceed the original file size to maintain the same visual quality when converting to say the latest wmv standard. And even then detail is lost.

I have seen very high resolution, very crips, very clear wmvs that are about 100mb per 10 min. But with the encoders I use I cannot get anywhere near those results. I have tried microsoft expressions studio and carbon coder (the latter of which I am not too versed with).

What do I need to do, what programs/encoders do you recommend?

kypec
18th March 2011, 09:19
Recommended tools:
Encoder = x264
However, in order to achieve brilliant output quality you need same (at least but preferably even higher) input quality. One can hardly expect to gain excellent quality x264 encode when fed from low-quality Xvid/WMV source.

yetanotherid
18th March 2011, 15:53
WMV???? No...........

Different types of video compress differently. Some are easy to compress some are harder. For instance an image with a lot of action will be harder. A video with a lot of "noise" will be harder than one which is nice and clean. Harder means a larger file size.

Generally, the idea is to pick an acceptable quality relative to the original (which can mean picking a quality where the encode is virtually indistinguishable from the original). More often than not, when going from an older format (mpeg, XviD etc.) to a newer one (h264 etc.) the file size also reduces, partly because the newer encoder is more efficient. However in some cases if the original quality is poor the file size will remain the same or even grow a little to keep the visual quality the same when converting.

Personally, I wouldn't convert the newer formats such as XviD unless the files are particularly cumbersome. They'll still be widely compatible with standalone players and any decent media player will play them without an additional codec pack. http://mpc-hc.sourceforge.net/ The other files types are probably worth converting.

HDConvertToX might be a good place to start... while you have the necessary codec pack installed to play the files you're wanting to convert. It's fairly straightforward to use.

Video: x264 in MKV, 1 pass quality, CRF value 20 (it's the quality setting, lower is better, 20 is a good file size/quality ratio), Speed Medium.
Audio is really up to you. Depending on the original audio format, you may just be able to copy it rather than convert it.

Let it rip and see what sort of file sizes you end up with.

Keep in mind the resolution plays a big part. Ideally you'd not want to change it. Have you been resizing the video when you convert it? If so, up or down?

Unfortunately HDConvertToX doesn't support RM video. Do you have many rm video files? You could also try converters such as AnyVideoConverter or FormatFactory. They'll both convert just about any format. Once again though I'd be converting using the x264 encoder and to an MKV container.

You'll find all those programs with Google and they're all free.

PS HDConvertToX also requires AVISynth to be installed. http://sourceforge.net/projects/avisynth2/
Once you've installed HDConvertToX run it's updater and let it update itself.

Jarun
19th March 2011, 01:47
I keep the resolution the same as the original file. My goal is to have a file the same quality as the original, but hopefully a bit smaller and in the newest, most efficient codec. But as I have said, the resulting file always has noticeably loss of detail when the files played side by side. Unless I increase the bitrate so much that the resulting file is larger than the original. Sometimes much larger before they seem to play back identically.

I always thought 2 pass quality was greater than one? Also I don't care how long it takes to convert, I just want quality. So, I usually set speed to best quality, but that doesn't seem to help enough.

CWR03
19th March 2011, 02:16
My goal is to have a file the same quality as the original, but hopefully a bit smaller and in the newest, most efficient codec.
The first thing to come to grips with is that you will not be able to achieve this goal. Re-encoding always results in a loss of quality, as you have already seen. The only way you'll be able to create a new file that has a smaller file size than your old one and has the same or similar quality is to use the original source material to encode a new file. Otherwise you'll have to do some trial and error to come up with a level of quality loss you feel is acceptable to save some file space.

I always thought 2 pass quality was greater than one?
2-pass is to allow you to achieve a predetermined file size. It gives you no real control over the quality of the file, short of actually running the encode and seeing how it looks.

manono
19th March 2011, 13:16
Also I don't care how long it takes to convert, I just want quality.
You're starting with already overly compressed low quality downloaded sources, and you're planning on compressing them yet again? You have no quality to start with and you'll have even less when you get done. You don't care about quality; you just want a smaller size.
I have seen very high resolution, very crips, very clear wmvs that are about 100mb per 10 min.
I don't guess they started with downloaded garbage.

Anyway, this discussion violates rule 6 of the Forum Rules. Thread closed:

http://forum.doom9.org/forum-rules.htm