Log in

View Full Version : When encoding, is higher resolution better?


Pages : [1] 2

Chengbin
27th January 2009, 05:00
Say if my source is 1280x720. Will a 1280x720 encode look better than a 704x400 encode? (assuming same size, same settings). I'm watching this on a 800x480 screen, is it better to watch a scaled up 704x400 video or a scaled down 1280x720 video (assume same size)

Dark Shikari
27th January 2009, 05:06
No, it's best to watch an 800x480 video... ;)

Chengbin
27th January 2009, 05:09
What if I'm watching it on a 1680x1050 monitor. If I were to encode a 1000Kbps video and watch it on that, does encoding it as close to as its original resolution better than a smaller resolution?

Guest
27th January 2009, 05:17
Try it both ways and see.

pcordes
27th January 2009, 09:38
Say if my source is 1280x720. Will a 1280x720 encode look better than a 704x400 encode? (assuming same size, same settings).

If you use a high enough bitrate, you can encode at the source resolution, which is a good thing. Then you don't have to throw away any information before you even give the data to a lossy encoder. I always prefer to encode at source resolution, and rescale at playback time to whatever screen I'm playing back on.

If you're targetting a specific display with a much lower rez than your source, you can save a lot of bitrate by downscaling before the encode. x264 does better than xvid, because H.264 has a deblocking filter as part of the standard. So x264 encodes without enough bitrate should just look blurry, not all blocky and ugly, which downscaling won't fix. In reality, you do get much better results by downscaling before encoding if x264 at source resolution was using quantizers (QP values) over 30 or something. I usually just use something like crf=20 at source resolution, with high quality settings, so x264 uses as little bitrate as possible for that quality, at the cost of slow encodes. You might have different priorities, depending on how much you want to encode, and whether you'll still have the source available to re-encode if you want to do something else with your encodes.

cogman
27th January 2009, 17:08
I would say it goes something like this. if the resolution of the device you are encoding for is lower then the sources, downscale the source and encode it at the devices resolution (or close to that).

If the device has a higher resolution then then source. DON'T SCALE THE SOURCE BEFORE ENCODING. It will only result in a higher bitrate for something the device should be able to do on the fly.

If the target has an unknown resolution, then just encode the source without any scaling.

You can always loose quality, but never create it.

imk
28th January 2009, 15:10
Depending on the device, sometimes (http://forum.doom9.org/showpost.php?p=990477&postcount=503) it is better to have a higher resolution source. :)

Comatose
29th January 2009, 14:43
Depending on the device, sometimes (http://forum.doom9.org/showpost.php?p=990477&postcount=503) it is better to have a higher resolution source. :)
:thanks: I noticed this, but didn't think there's anything I can do to solve it :P

DarkZeros
29th January 2009, 16:08
If you have QP of about 20-25 in your video, it is better to mantain the original scale. It will produce very good output, without loosing high resolution details.

If the quantizer is ~30, it should be better to downscale the video after the encoding. That eliminates details, and generates a higer quality output, but the details are lost forever :S

JohannesL
1st February 2009, 20:25
If you're going for a low bitrate, however, downscaling the video will give better results. An encode at 640x480 will need twice the bitrate of a 320x240 encode for the same quants.

Dark Shikari
1st February 2009, 20:38
If you're going for a low bitrate, however, downscaling the video will give better results. An encode at 640x480 will need four times the bitrateFixed that for you (but still not entirely accurate, as the increase in bitrate is nonlinear).

JohannesL
1st February 2009, 21:02
Stats file from 1000kbps at 320x240:
in:59 out:59 type:P q:15.68 tex:29665 mv:2916 misc:259 imb:0 pmb:257 smb:43 d:-;
in:60 out:60 type:P q:15.51 tex:30058 mv:3279 misc:215 imb:0 pmb:273 smb:27 d:-;
in:61 out:61 type:P q:15.35 tex:31635 mv:2924 misc:241 imb:0 pmb:263 smb:37 d:-;
in:62 out:62 type:P q:15.34

Stats file from 2000kbps at 640x480:
in:59 out:59 type:P q:16.41 tex:53005 mv:9773 misc:742 imb:9 pmb:773 smb:418 d:-;
in:60 out:60 type:P q:16.28 tex:55224 mv:10211 misc:741 imb:17 pmb:757 smb:426 d:-;
in:61 out:61 type:P q:16.08 tex:54188 mv:9921 misc:755 imb:8 pmb:774 smb:418 d:-;
in:62 out:62 type:P q:15.97

Stats file from 4000kbps at 640x480:
in:59 out:59 type:P q:10.00 tex:119427 mv:10877 misc:784 imb:21 pmb:820 smb:359 d:-;
in:60 out:60 type:P q:10.00 tex:116638 mv:10858 misc:776 imb:10 pmb:833 smb:357 d:-;
in:61 out:61 type:P q:10.00 tex:116926 mv:10663 misc:787 imb:11 pmb:830 smb:359 d:-;
in:62 out:62 type:P q:10.00

Chengbin
1st February 2009, 21:21
OK, you guys were right.

Yesterday I felt like wasting 24 hours encoding an episode of Prison Break from Blu Ray using the absolute highest settings of x264 (all partition, merange 32, me=tesa, 16 b and ref frames, b adapt 2, etc). I wanted to do that because I was watching some streaming video at about 340Kbps and I was really disappointed with the quality. So I did this, not only it'll confirm "is higher resolution better", also "how much quality can I get with 300Kbps".

After 13 hours for 1280x720 encode and 8 for 704x400 encode, I finally could compare. The 704x400 was MUCH better. I was also surprised how much quality I got with just 300Kbps. I can't believe I deleted them. If I get another chance to waste time, I'll encode them again and post screenshots. That depends how my report card is on Thursday. LOL, I'm getting OT.

refulgentis
3rd February 2009, 12:15
OK, you guys were right.

Yesterday I felt like wasting 24 hours encoding an episode of Prison Break from Blu Ray using the absolute highest settings of x264 (all partition, merange 32, me=tesa, 16 b and ref frames, b adapt 2, etc). I wanted to do that because I was watching some streaming video at about 340Kbps and I was really disappointed with the quality. So I did this, not only it'll confirm "is higher resolution better", also "how much quality can I get with 300Kbps".

After 13 hours for 1280x720 encode and 8 for 704x400 encode, I finally could compare. The 704x400 was MUCH better. I was also surprised how much quality I got with just 300Kbps. I can't believe I deleted them. If I get another chance to waste time, I'll encode them again and post screenshots. That depends how my report card is on Thursday. LOL, I'm getting OT.is this a joke?

Chengbin
3rd February 2009, 13:14
Of course not, why do you think it is?

hajj_3
3rd February 2009, 13:34
because 300 bitrate is incredibly low, for 704x400 you want around 1200bitrate for it to look decent. For 1280x720 you need around 3000bitrate. 300 bitrate for either is ludicrously low.

Dark Shikari
3rd February 2009, 13:35
because 300 bitrate is incredibly low, for 704x400 you want around 1200bitrate for it to look decent. For 1280x720 you need around 3000bitrate. 300 bitrate for either is ludicrously low.And I encode 1080p at 1.5 megabits. So? (http://mirror05.x264.nl/Dark/force.php?file=./x264clips/BigBuckBunny.mkv)

Chengbin
3rd February 2009, 13:57
because 300 bitrate is incredibly low, for 704x400 you want around 1200bitrate for it to look decent. For 1280x720 you need around 3000bitrate. 300 bitrate for either is ludicrously low.

Did you see the reason I encoded at 300Kbps?

I was trying to see how much quality can I get with 300Kbps, which is about the same as streaming videos and I want to see how big of a improvement with newer tech is gonna bring us.

refulgentis
3rd February 2009, 14:32
Did you see the reason I encoded at 300Kbps?

I was trying to see how much quality can I get with 300Kbps, which is about the same as streaming videos and I want to see how big of a improvement with newer tech is gonna bring us.what newer tech? i'm completely lost, it sounds like you encoded a video at 300 kbps, then downscaled it and encoded the downscale at 300 kbps, and you're seeing that the downscaled version is better, which sounds like a load of nonsense to me

Chengbin
3rd February 2009, 15:03
what newer tech? i'm completely lost, it sounds like you encoded a video at 300 kbps, then downscaled it and encoded the downscale at 300 kbps, and you're seeing that the downscaled version is better, which sounds like a load of nonsense to me

I'm going to explain it again.

I was disappointed with WMV's CBR video encoding (at about 340Kbps). I wanted to see if I have a Blu ray source, it is better to encode it at 1280x720 or 704x400. I can also test how much improvement can I get with x264 at highest settings, the newer, much more advanced codec.

Using a Blu ray source, I encoded a video at 300Kbps at 1280x720.

Using the same source, I encoded a video at 300Kbps at 704x400.

After a long wait time for encoding, the 704x400 encode is much better than the 1280x720 encode.

refulgentis
3rd February 2009, 15:35
I'm going to explain it again.

I was disappointed with WMV's CBR video encoding (at about 340Kbps). I wanted to see if I have a Blu ray source, it is better to encode it at 1280x720 or 704x400. I can also test how much improvement can I get with x264 at highest settings, the newer, much more advanced codec.

Using a Blu ray source, I encoded a video at 300Kbps at 1280x720.

Using the same source, I encoded a video at 300Kbps at 704x400.

After a long wait time for encoding, the 704x400 encode is much better than the 1280x720 encode.
of course it is, give a 281600 people $300,000 to eat for a year, and then give 921600 people $300,000 to eat for a year -- the 281600 will come out looking far healthier.

note: people = pixels, $ = bits/second, and i know this isn't *completely* correct

Sagittaire
3rd February 2009, 15:51
what newer tech? i'm completely lost, it sounds like you encoded a video at 300 kbps, then downscaled it and encoded the downscale at 300 kbps, and you're seeing that the downscaled version is better, which sounds like a load of nonsense to me

1) Well it's not always sure that 480p at 300 Kbps is better than 1080p at 300 Kbps. Really static scene without noise/texture (anime, CGI) will be really better for 1080p ... no doubt

2) It's really difficult to compare codec. If result is optimal for 480p, 2000 Kbps and XviD then result will be not optimal for 480p, 2000 Kbps and x264 but at really higher resolution.

nm
3rd February 2009, 15:53
of course it is, give a 281600 people $300,000 to eat for a year, and then give 921600 people $300,000 to eat for a year -- the 281600 will come out looking far healthier.
With such a limited budget, all of them will come out looking pretty much dead, at which point the difference is not that significant anymore (hajj_3's point) ;)

ajp_anton
3rd February 2009, 18:29
of course it is, give a 281600 people $300,000 to eat for a year, and then give 921600 people $300,000 to eat for a year -- the 281600 will come out looking far healthier.

note: people = pixels, $ = bits/second, and i know this isn't *completely* correctBut in the case with 921600 people, why not just "ignore" 640000 or them and let them die? Then we should have the same result in both cases =)

Chengbin
4th February 2009, 01:29
And I encode 1080p at 1.5 megabits. So? (http://mirror05.x264.nl/Dark/force.php?file=./x264clips/BigBuckBunny.mkv)

I'm still trying to pick up my jaws after seeing the quality of that 1.5Mbit video. (Kinda difficult to see the screen from the floor because it is a TN panel,LOL!)

How do you do that??? That is insane. I swear that's a Blu ray video if I don't look closely.

wyti
4th February 2009, 02:23
The most important thing is that this source is perfectly clear, she don't have any grain or any compression artefact (i suppose the source are the png lossless).
The settings used are high yes (--me-tesa + --merange 32) but it's still compliant @ HighProfile Level4

Chengbin
4th February 2009, 02:38
The most important thing is that this source is perfectly clear, she don't have any grain or any compression artefact (i suppose the source are the png lossless).
The settings used are high yes (--me-tesa + --merange 32) but it's still compliant @ HighProfile Level4

I saw that. I do that too, Blu-ray source, me tesa, merange 32, subme9, etc (main profile though). Maybe one day I'll waste a day trying to encode that.

Sagekilla
4th February 2009, 02:56
One of the most significant things (more so than --me tesa and --merange 32) is the nature of the content itself. There exists a -huge- amount of redundancy from one frame to the next, especially since you're dealing with the lossless master. Animated content like BBB is just a test of how well your encoder can minimize those redundancies. In this case, you can do so and still get very high quality at a low bitrate.

Shinigami-Sama
4th February 2009, 04:59
I saw that. I do that too, Blu-ray source, me tesa, merange 32, subme9, etc (main profile though). Maybe one day I'll waste a day trying to encode that.

no
png source, 11gb of pngs?
I think it took him a few days to get that finished with rdrc being so ridiculously slow

Sagekilla
4th February 2009, 05:14
Fortunately RDRC is slow independent of your settings! (Which may or may not be a good thing, depending on how you look at it) I remember Dark Shikari said you can scale down the settings a bit and achieve reasonable frame rates.

Shinigami-Sama
4th February 2009, 05:15
Fortunately RDRC is slow independent of your settings! (Which may or may not be a good thing, depending on how you look at it) I remember Dark Shikari said you can scale down the settings a bit and achieve reasonable frame rates.

or just buy an i7 and OC it hell and jack the the other settings up and watch it crunch away at reasonable speeds anyways :D

wyti
4th February 2009, 05:45
Sorry for the off topic, but anyone know where can i find a RDRC binary of x264 ?

akupenguin
4th February 2009, 18:10
But in the case with 921600 people, why not just "ignore" 640000 or them and let them die? Then we should have the same result in both cases =)

A sufficiently customizable codec, with full control over partition size and transform size and entropy coder contexts, would do just that. But MPEG-like codecs, with partitions only going up to 16x16 and dct only up to 8x8 and a small number of nonconfigurable contexts, can't exploit all the low-frequency redundancy that's left after they kill the details.

ajp_anton
4th February 2009, 23:20
A sufficiently customizable codec, with full control over partition size and transform size and entropy coder contexts, would do just that. But MPEG-like codecs, with partitions only going up to 16x16 and dct only up to 8x8 and a small number of nonconfigurable contexts, can't exploit all the low-frequency redundancy that's left after they kill the details.Yes I knew that wouldn't work with "most codecs", and I guessed it had something to do with partition sizes.
Thanks for the explanation, love ending up reading lots of wikipedia pages to fully understand it(/them) =)

JohannesL
6th February 2009, 14:19
Sorry for the off topic, but anyone know where can i find a RDRC binary of x264 ?
Seconded.

Blue_MiSfit
6th February 2009, 23:48
Impressive clip, Dark_Shikari! And you give me crap for doing 1080p at 3mbps :)

Honestly though, it's really surprising just how GOOD low bitrate HD can look on some sources! Rattatoille for example looks great at 3mbps, and so does Hulk vs.

Any pre-processing on the 1.5mbps big buck bunny test?

~MiSfit

sumawo13
7th February 2009, 04:33
And I encode 1080p at 1.5 megabits. So? (http://mirror05.x264.nl/Dark/force.php?file=./x264clips/BigBuckBunny.mkv)

You inspired me to do my own encode of the lossless 640x360 master at 500 kilobits.

http://i74.photobucket.com/albums/i258/PC3200/shot0011.png

http://i74.photobucket.com/albums/i258/PC3200/shot0014.png

Chengbin
7th February 2009, 05:28
What is RDRC? I'm assuming it is some psychovisual plugin that have better image quality but at a cost of significant encoding slowdowns?

Tomorrow you will see how far you can push with 300Kbps with x264 using the absolute highest settings. One will be an episode from Prison Break, one will be Ratatouille, both from 1080p sources.

Shinigami-Sama
7th February 2009, 05:38
What is RDRC? I'm assuming it is some psychovisual plugin that have better image quality but at a cost of significant encoding slowdowns?

Tomorrow you will see how far you can push with 300Kbps with x264 using the absolute highest settings. One will be an episode from Prison Break, one will be Ratatouille, both from 1080p sources.

rate distortion rate control
its singled threaded and very very very slow.. think tesa

its pretty much 'perfect' rate control, but has some limitations

its still experimental which is why you don't see it much

Chengbin
7th February 2009, 05:47
Thanks. Does it improve quality? How much?

tesa is not that slow actually.

Sagekilla
7th February 2009, 06:17
RDRC's speed is dependent on only the settings related specifically to RDRC, which were window size and two other parameters, I believe. If you use a huge window, it'll be slow no matter whether you use --me dia or tesa. It can provide a large boost in quality though, I don't remember the specific numbers but it's well within the range of noticeable difference.

Chengbin
7th February 2009, 13:49
Then I want it.

For some reason the difference isn't that noticeable between 1280x720 and 704x400. Maybe because I changed the deblocking value to 3 and 3 instead of -1 and -1 before. Here are two screenshots of prison break, 300kbps at full screen on my 22'' 1680x1050 monitor. This is the settings I used

cabac=1 / ref=16 / deblock=1:3:3 / analyse=0x3:0x133 / me=tesa / subme=9 / psy_rd=1.0:1.0 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-4 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=16 / b_pyramid=1 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=1 / keyint=1000 / keyint_min=25 / scenecut=40(pre) / rc=2pass / bitrate=317 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=25000 / vbv_bufsize=14000 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

704x400

http://i41.tinypic.com/fozxhd.png

1280x720

http://i44.tinypic.com/qs2qdd.png

sumawo13
7th February 2009, 19:08
The 704x400 encode looks better to me, especially around the edges of the microphone and tape recorder.

Chengbin
7th February 2009, 21:19
The 704x400 encode looks better to me, especially around the edges of the microphone and tape recorder.

The 704x400 encode should look better, but the difference wasn't as dramatic as the last encode I did to compare it. I think it has something to do that I changed deblocking to 3.

Nevertheless, it is pretty astonishing what x264 can do with just 300Kbps.

Sagekilla
7th February 2009, 23:24
Personally too low of a bitrate for my tastes ;) I generally use a little over 1 mbps (crf 18 ~= 1 - 2 mbps for me) for my videos @ 848x480 w/ some MVDegrain3 and it comes out great.

Edit: The sad thing is that @ 300 kbps on 704x400 or 1280x720, x264 looks -way- better to me than some of the crap I seen on digital television sometimes. Most of it isn't too bad, but I've seen some horrific streams that are -worse- than that.

sumawo13
7th February 2009, 23:31
Personally too low of a bitrate for my tastes ;) I generally use a little over 1 mbps (crf 18 ~= 1 - 2 mbps for me) for my videos @ 848x480 w/ some MVDegrain3 and it comes out great.

Edit: The sad thing is that @ 300 kbps on 704x400 or 1280x720, x264 looks -way- better to me than some of the crap I seen on digital television sometimes. Most of it isn't too bad, but I've seen some horrific streams that are -worse- than that.


I don't have HDTV so unfortunately I haven't seen the quality of it (or lack there of), It would be cool to see some of the worse off video streams.

Chengbin
7th February 2009, 23:44
Of course it isn't practical to use 300Kbps. I just wanted to see if streaming video websites used x264, how good can the videos look.

There is no way some digital TV streams are worse than the encoding I made. If it is by any chance, you should ask for a refund.

Sagekilla
8th February 2009, 05:35
I happen to be lucky and have good service (FiOS), but I've seen some people who had -horrible- DTV. It was extremely blocky and detail was completely shot. At least x264 @ 300 kbps still retains a reasonable image.

infoeater
11th April 2010, 16:33
I was interested in which quantizer is optimal (optimal quantizer is in this post maximum reasonable quantizer, beyond which it would be better to use downscaling) for MPEG 4/MPEG 4 AVC video encoders, my tiny amount of XVID visual tests show relatively wide range of optimal quantizer depending on taste. Then I found An Experiment in Video Encoding (http://www.normalesup.org/~george/comp/video_quality/), with similar, but narrower results.

Results are:
It’s never beneficial to upscale video before encoding.
It would be always better to downscale to square pixels, then to upscale to square pixels, unless upscaled resolution match your screen resolution, so you can avoid additional rescaling.
It’s better to keep original resolution until some quantizer, beyond which it is better to downscale to archive the same optimal quantizer. Optimal quantizer is lower for less detailed per pixel, more denoised, higher resolution, high motion (I don’t understand exactly why?) video, and is for filmed content generally between XVID Q3,5-Q6 quantizer, or between Q23-Q29 x264 quantizer (with higher theoretically optimal quantizers possible with downscaled anime), so optimal value of x264 quantizer is sometimes slightly higher (http://web.archive.org/web/20080714023506/http://fansubbers.org/index.php/KB/Quanttable). In real live it would sometimes be better for visual quality to use lower quantizer and resolution in XVID if there would be no deblocking at playback.

creamyhorror
12th April 2010, 09:05
I was interested in which quantizer is optimal (optimal quantizer is in this post maximum reasonable quantizer, beyond which it would be better to use downscaling) for MPEG 4/MPEG 4 AVC video encoders, my tiny amount of XVID visual tests show relatively wide range of optimal quantizer depending on taste. Then I found An Experiment in Video Encoding (http://www.normalesup.org/~george/comp/video_quality/), with similar, but narrower results.
That's a pretty interesting study, thanks for posting it. It's quite outdated, so I wonder how applicable its results are.


It would be always better to downscale to square pixels, then to upscale to square pixels, unless upscaled resolution match your screen resolution, so you can avoid additional rescaling.
That's a bit different from what the report found. On Amelie the upscaled version starts having better quality than the downscaled version at bitrates of around 800. On the Matrix the downscaled version is superior all the way. I guess it depends on the source.


It’s better to keep original resolution until some quantizer, beyond which it is better to downscale to archive the same optimal quantizer. Optimal quantizer is lower for less detailed per pixel, more denoised, higher resolution, high motion (I don’t understand exactly why?) video, and is for filmed content generally between XVID Q3,5-Q6 quantizer, or between Q23-Q29 x264 quantizer (with higher theoretically optimal quantizers possible with downscaled anime), so optimal value of x264 quantizer is sometimes slightly higher (http://web.archive.org/web/20080714023506/http://fansubbers.org/index.php/KB/Quanttable).
Good to know. What was your comparison methodology? Screenshots or metrics?