Log in

View Full Version : Is better to use H.264 for upscaling or downscaling?


nitinpushpan
31st July 2009, 10:39
I've been encoding my videos using Xvid for a long time. Now I'm using x264. I mostly encode my DVDs. Please suggest whether is it good to upscale to HD resolution while encoding my DVD videos? If so what bitrate should I go for to get the optimum quality so that I don't end up wasting my disc space without any actual improvement in the video quality? I used to encode my videos to 700MB to 1.4GB using Xvid maintaining more than 800 Kbps. What is the usual common practice among you guys? I suppose Xvid is history by now...

moviefan
31st July 2009, 11:05
Upscaling costs a lot more bitrate and doesn't get you more details. It might only make sense if you watch your DVDs on a e.g. Full-HD TV where the upscaler (of your TV or the software player of your computer) does a poor job. However, I would keep the original resolution. Bitrate depends on what you want to achieve. If you have movies of length like 90 or 120 minutes and you want to store them on a CD-R or two, you have to stick to this file size and calculate the average bitrate (=> 2 pass with that bitrate). x264 will give you better quality at that same file size compared to xvid. If you don't aim at a specific file size, you could use CRF mode (which is 1 pass), which tries to give you constant quality at a certain level which you specify by the CRF value. File size is not really predictable, but you should choose a value between 20 and 26 (in my experience). Bigger value = less quality = smaller file size. Concerning "optimum quality": That is of course very subjective. It also depends very much on your DVD source's quality. If there is a lot of grain and noise, you need a higher bitrate to achieve a certain quality level while clean sources take less bitrate. If you store only on your HDD, you might be better off to stick to CRF and do some testing which value fits best in terms of quality and file size.

If you enjoy playing around a bit, you might want to try some denoising/degraining on noisy/grainy sources. MCTemporalDenoise is a powerful and easy-to-use Avisynth script.

LoRd_MuldeR
31st July 2009, 13:05
Short answers:

1. Upscaling from DVD resolution to HD (720p or 1080p) is useless! It costs more bits, but won't improve quality. Upscaling can never add detail that wasn't in the source!

2. If (and only if) you must hit a specific file size (e.g. 700 MB), then use x264 2-Pass mode. Otherwise use CRF mode with a reasonable value, such as 21.

TheImperial2004
31st July 2009, 14:23
Asking for a specific bitrate / CRF values is useless , because we don't know how much your source is complecated ...

For me , I use CRF of 15 for CG sources and 20 for Anime ones .. It depends , you should try different values until you become satisfied with the result ^_^ ..

And of course , Upscaling will make things worse , cuz encoding won't magically add any details that weren't in the source .. And unless you use the "Lossless" mode , you'll lose quality while encoding .. How much loss ? That depends on your settings ...

Sorry for kicking in ...

m3mbran3
31st July 2009, 14:51
If disk space is not an issue and you intend to watch your videos on a HD display then upscaling before encoding will give you better quality than simply letting your TV / PC do the upscaling.

You can use the nnedi2_rpow2 function from the avisynth plugin NNEDI2 to enlarge your image and get the best possible quality from an enlarge. Of course as people have said, an upscaled DVD on a HD display will still look pretty poor and not worth the increased filesize, for that reason I find it is better to avoid any resizing at all and just crop out the black borders from your source. You could always run some tests and see if you can notice the difference.

Lorax2161
31st July 2009, 15:18
I used to encode my videos to 700MB to 1.4GB using Xvid maintaining more than 800 Kbps.

Those were backup size restrictions when it was more common for people to backup their movies onto one or two CDs. If you are backing up to DVD, those size requirements may be obsolete for you.

A suggestion would be to try various CRF values on a 5 minute representative sample of your movie. You can check the bitrates for each using MediaInfo once your tests are complete.

Knowing the approximate bitrate for the corresponding CRF for your source can help you with your encoding decisions. If you have to hit a specific file size, use two-pass as LoRd_MuldeR suggested. A bitrate calculator will help you determine what bitrate you need to hit that requirement, and matching that number to the CRF test result with the closest bitrate gives you a pretty good idea of the quality you can expect in advance.

I am going through similar decisions as I try to determine how many episodes of a tv series I want to try to fit on each DVD. Some shows need a higher bitrate (lower CRF) than others, which is why tests are helpful.

Good luck.

nitinpushpan
31st July 2009, 17:13
Thanks for the suggestions guys, you all have been a great help.

benwaggoner
31st July 2009, 20:53
Bear in mind that upsampling is a form of remastering. Getting good HD out of SD isn't a checkbox kind of thing, but it's possible to do well with tuning.

You'll generally want to be optimizing your master in other ways, using a postprocessing decoder as appropriate, denoise as appropriate, and using better deinterlacing and scaling algorithms than your display device has.

It can take a significant time effort (both keyboard-and-mouse tweaking and rendering time) for this kind of remastering to outperform a good display.

iko417
1st August 2009, 18:57
@nitinpushpan

h.264 will give you better looking videos than XviD for the same bitrate. For near transparent encodes 1/3 DVD 1480MB h.264 together with 6ch AAC for audio at 160-192kbps is the way to go. If saving space is your thing then try 1/6 DVD 738MB together with 2ch AAC 96-128kbps for audio.

LoRd_MuldeR
1st August 2009, 19:51
You should be careful with bitrate (file size) suggestions, because it's HIGHLY source-dependent! Also pre-processing can make a significant difference on bitrate requirement.

I'd highly recommend to go with CRF whenever possible and only fall back to 2-Pass mode when you really must hit a specific file size.

Last but not least you should be aware that if you decide to upscale your DVD source to HD resolution before encoding, this will easily fill a complete DVD-R media...

popper
2nd August 2009, 14:15
Short answers:

1. Upscaling from DVD resolution to HD (720p or 1080p) is useless! It costs more bits, but won't improve quality. Upscaling can never add detail that wasn't in the source!

2. If (and only if) you must hit a specific file size (e.g. 700 MB), then use x264 2-Pass mode. Otherwise use CRF mode with a reasonable value, such as 21.

funny you should say that Lord Mulder, it bugs me that the current AVIDemux default setting is "2 pass", so we always need to manually go in there and change it to CRF and alter the 26 to something else if you want that to, why is that "2 pass" the default. when CRF seems to be the far better quick encode default option today.

i was cureous so i did some quick tests loading up some old Xvid 1.1 Mbit/s, 624x352 16/9, 40 minute 366 Mbyte file into the latest AVIdemux ,changed to AVC CRF=26 ,AAC=2,mp4 and got a massive reduction to 535Kbit/s,171 MByte file that looks fine (in relative terms OC), compared to the original Xvid upscaled on an xbox360 to a 32" TV, and it only took 10 minutes from the slowest core2 8200 quad...

infact it seems to produce the perfect VLC upload web streaming file for your average consumer ISP 768Kbit/s max upload connection when your away from your home ;)

popper
2nd August 2009, 15:11
If you enjoy playing around a bit, you might want to try some denoising/degraining on noisy/grainy sources. MCTemporalDenoise is a powerful and easy-to-use Avisynth script.


Bear in mind that upsampling is a form of remastering. Getting good HD out of SD isn't a checkbox kind of thing, but it's possible to do well with tuning.

You'll generally want to be optimizing your master in other ways, using a postprocessing decoder as appropriate, denoise as appropriate, and using better deinterlacing and scaling algorithms than your display device has.

It can take a significant time effort (both keyboard-and-mouse tweaking and rendering time) for this kind of remastering to outperform a good display.

OC if you really want a real challenge for your prefered algorithms then by far the hardest masters to TRY and clean up are any of the original BBC "Dr who" hartnel, through pertwee dvd's.

i dont hold up much hope your going to get very far improving these though.

http://www.bbcshop.com/bin/venda?ex=co_wizr-locayta&template=wz_locayta&pageno=1&perpage=10&collate=ivtype%3Apdxtgenre%3Abrand%3Aivprice%3Apdxtclassification%3Apdxtlevel&refine_sort_alph=ivtype%3Apdxtgenre%3Abrand%3Aivprice%3Apdxtclassification%3Apdxtlevel&fieldrtype=type&termtextrtype=invt&typertype=exact&typekeywordsearch=keyword&termtextkeywordsearch=hartnel

LoRd_MuldeR
2nd August 2009, 17:53
funny you should say that Lord Mulder, it bugs me that the current AVIDemux default setting is "2 pass", so we always need to manually go in there and change it to CRF and alter the 26 to something else if you want that to, why is that "2 pass" the default.

That's not true. CRF mode is the default. With a value of 26 ;)

(I just checked with the latest Win32 build of Avidemux 2.5, using Qt interface)

popper
2nd August 2009, 18:16
thats really odd Mulder, the last time i tryed it i could have sworn it was set as "2 pass", but now its not, but i did a few things and added in your latest x264 patchs etc recently so perhaps i replaced an old version without realising LOL,and i have been jumping around on a few different PCs of late here, but good job...

i could really do with a working "dir watch"<>'AVIDemux' settings as i please<>werever/*-fixed.mp4 script or something though , if you have time and something to think about ;) but thats OT in this thread so ill stop now.

LoRd_MuldeR
2nd August 2009, 19:12
thats really odd Mulder, the last time i tryed it i could have sworn it was set as "2 pass", but now its not

Maybe you had used the "Calculator" tool, which will set x264 to 2-Pass mode for obvious reasons.