Log in

View Full Version : After making a DVD backup with x264, the output looks darker.


orion44
20th May 2015, 15:24
I'm creating a backup of my DVD with x264, and the resulting output looks darker than the original DVD.
What should I do to make the output have the same brightness as the original DVD?

Here are the screenshots:

KMPlayer DVD: http://i.cubeupload.com/HPOGjA.png
KMPlayer x264: http://i.cubeupload.com/fFd6WB.png

Potplayer DVD: http://i.cubeupload.com/6liJW1.png
PotPlayer x264: http://i.cubeupload.com/uZwjIR.png

DGIndex colorimetry reports: BT.470-2 B, G

My x264 script: x264.exe --preset slow --deblock -2:-2 --psy-rd 1.2:0.0 --crf 20 --keyint 240 --min-keyint 24 -o D:\Project\Output.mkv D:\Project\DVD-NoDeint.avs

foxyshadis
20th May 2015, 22:57
The x264 is correct, the DVD screenshots are being decoding incorrectly to limited-range RGB. I don't use KMPlayer or Potplayer, but that's a serious decoding bug. Have you tried MPC-HC?

orion44
21st May 2015, 03:31
Have you tried MPC-HC?

I haven't.

KMPlayer and Potplayer are two of my favorite software players.

Anyway, I solved the problem. I've used the ColorYUV filter in my AVISynth script to convert from PC to TV range,
and now the brightness is exactly the same.

The only question that's bugging me is should I encode the video like that, so it will be brighter, or should I leave the PC range?

Ghitulescu
21st May 2015, 10:53
As you have noticed yourself, if you want to play them on a computer (PC) use the PC-range, if you're intending to play on "normal" players (and displays) use TV-range.

You should also use the TV range if any of the playback chain comprises a television-standard-device.

hello_hello
21st May 2015, 11:15
The only question that's bugging me is should I encode the video like that, so it will be brighter, or should I leave the PC range?

Definitely don't encode it that way. As foxyshadis pointed out, it's probably the original video displaying incorrectly. It's not PC range.

Contrary to the (maybe) odd advice in the previous post, you should always encode video using TV/limited range. DVD/Bluray video will always be limited range, so you should never touch the levels when re-encoding it (well sometimes it makes it to disc with the wrong levels, but that's another story). Hopefully Ghitulescu was referring to playback levels and not the encoding levels and just failed to make that clear, although my PC is connected to my TV and it's set for full range levels just like a PC monitor so I don't know what he's referring to there.

When the video is decoded using a normal hardware player and TV etc they'll expect limited levels and the video will display correctly. PC monitors use full range levels. If the limited levels aren't expanded to full range on playback the video can look washed out, or a bit lighter. In your case it appears the limited levels are being expanded for the encoded video, but not when playing the original DVD video. If you convert the levels from PC range to limited range when encoding to compensate, what you're kind of doing is converting the limited range levels to an even more limited range. It'll look the same as the original using your PC at the moment, but I think you'll find when you use a hardware player it'll look brighter.

If the problem's occurring when playing DVD video, but not the encoded video, and it's happening with two different players (very different players) have a look at your video card settings. The player can do the job of expanding the levels on playback but if not, your video card can do it. Maybe it's a problem with your video card drivers or setup.

For me, when it comes to displaying video there's only one option, to expand the levels for video or not. If you don't set the video card to do it, it relies on the player getting it right. If you get the video card to expand the levels they should always be correct, regardless of the player used (if the player is expanding the levels the video card shouldn't expand them again). The Nvidia control panel looks like this when running XP:

http://s22.postimg.org/68eexq2fx/nvidia.jpg (http://postimg.org/image/68eexq2fx/)

Report back with the video card you have and the version of Windows you're running if you can't fix the problem.

PS I just noticed from your screen shots, KMPlayer is displaying the video differently to Potplayer regardless of whether it's the original or the encode. Both are brighter using KMPlayer. I suspect that's because one of the players is being used to adjust the brightness or contrast differently to the other (or it's being adjusted by the video card and effecting one player but not the other). It's nothing to do with the levels problem as such, but a separate possible issue you might want to look at.

Ghitulescu
24th May 2015, 09:18
The only question that's bugging me is should I encode the video like that, so it will be brighter, or should I leave the PC range?
These are two different things, depending on the software one uses. Since it's not clear what software you intend to use, there are no proper answers, but be warned that, at least in the past, some encoders performed themselves the correction PC<->TV - in other words, only the experience and testing may help you here.

orion44
24th May 2015, 18:10
I've decided to leave the x264 encoded movies in PC range, since I'll be watching it on my PC.

Thanks everyone for helping.

hello_hello
25th May 2015, 14:01
These are two different things, depending on the software one uses. Since it's not clear what software you intend to use, there are no proper answers, but be warned that, at least in the past, some encoders performed themselves the correction PC<->TV - in other words, only the experience and testing may help you here.

Which encoders perform a PC<->TV "correction"?
The only time I'm aware of encoders or filters changing the luminance levels if there's a conversion to/from RGB taking place, and from the information given that appears not to be happening here.
Which encoders in the past have been given YV12 video and decided "I think I'll change the levels"? The levels of the encoded video should be the same as the levels of the source video. Why would they change?

I've decided to leave the x264 encoded movies in PC range, since I'll be watching it on my PC.

Thanks everyone for helping.

As has been previously explained, the encoded movies probably aren't in the PC range. Is there any conversion to/from RGB in your script?
When you said you're using ColorYUV to convert the video from PC to TV range I assume you're doing this:
ColorYUV(Levels="PC->TV")
which is converting in the opposite direction. Whether you're doing that or not, "leaving the x264 encoded movies in PC range" makes no sense.

Oh well, they're your encodes. You can do whatever you want to. If it was me and you have a Bluray/DVD player capable of playing your encoded files, I'd use it to compare the encoded version to the original DVD and If they look the same, which I imagine they will (assuming you haven't messed with the levels in the script), then I'd fix the PC playback problem instead.

Ghitulescu
25th May 2015, 17:10
Which encoders perform a PC<->TV "correction"?
Last time when I used eg CCE I remember it had this option.
I do not use that much SW encoders I prefer for speed HW ones, so I am not that familiar with latest encoders. But I conseidered necessary to add this.

orion44
26th May 2015, 04:17
For me, when it comes to displaying video there's only one option, to expand the levels for video or not. If you don't set the video card to do it, it relies on the player getting it right. If you get the video card to expand the levels they should always be correct, regardless of the player used (if the player is expanding the levels the video card shouldn't expand them again). The Nvidia control panel looks like this when running XP:

http://s22.postimg.org/68eexq2fx/nvidia.jpg (http://postimg.org/image/68eexq2fx/)

Report back with the video card you have and the version of Windows you're running if you can't fix the problem.


My video card is Nvidia GeForce 9500GT 1GB RAM, and the OS is Windows 7 64-bit.

And these are the default settings in Nvidia control panel on my PC:

http://i.cubeupload.com/7xNH7y.jpg

As has been previously explained, the encoded movies probably aren't in the PC range. Is there any conversion to/from RGB in your script?
When you said you're using ColorYUV to convert the video from PC to TV range I assume you're doing this:
ColorYUV(Levels="PC->TV")
which is converting in the opposite direction. Whether you're doing that or not, "leaving the x264 encoded movies in PC range" makes no sense.

Oh well, they're your encodes. You can do whatever you want to. If it was me and you have a Bluray/DVD player capable of playing your encoded files, I'd use it to compare the encoded version to the original DVD and If they look the same, which I imagine they will (assuming you haven't messed with the levels in the script), then I'd fix the PC playback problem instead.
I removed the ColorYUV filter.

These are my final AviSynth settings before starting to encode:

LoadPlugin("C:\Program Files (x86)\DGMPGDec\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Decomb.dll")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\yadifmod.dll")
MPEG2Source("D:\Project\MPV.d2v")
AssumeTFF()
Telecide(guide=1,post=0)
Decimate()
#interp=nnedi3(field=1)
#yadifmod(order=1, field=-1, mode=0, edeint=interp)
#Trim(1300,3435)
#Crop(4,6,712,462)
#LanczosResize(720,540)
Spline36Resize(720,540)

orion44
26th May 2015, 04:51
Here are KMPlayer video options:

http://i.cubeupload.com/PUS18P.jpg

I have no idea which option should I check.

Should I change the levels via Nvidia control panel?

hello_hello
26th May 2015, 06:48
Last time when I used eg CCE I remember it had this option.

No doubt some encoders have the option, but you implied some encoders take it upon themselves to change the levels without being told to.

hello_hello
26th May 2015, 07:52
I have no idea which option should I check.

Should I change the levels via Nvidia control panel?

I'd change the levels in the Control Panel, but just to be clear, you are connected to a standard PC monitor? It's not a TV?

There's nothing in your script that should cause a change in levels, so logically, it's got to be a playback problem.

I've used Nvidia drivers in the past that have messed with the levels, so if all else fails you might want to try different video card drivers.

If you set the video card to expand the levels it should expand them for most video types and if the player is already expanding the levels it should leave them alone. I say "should" but Potplayer doesn't work that way for me. It's setting is under Video/Levels Offset, but when it's enabled if you set the video card to expand the levels, the do get expanded twice and the picture ends up really dark.

The video card's levels setting doesn't effect all video players. I'm not 100% sure why. It might depend on the renderer or how they go about displaying video. VLC is unaffected by the video card setting. Potplayer & MPC-HC are. I don't know about KMPlayer. I tried KNPlayer once. Never again, but I think the video card settings should effect the way it displays video. You'll need to check that one yourself.

The way the level controls are set in KMPlayer look correct according to your screenshot. 16-235 (TV) input, 0-255 (PC) output. The Level Control appears as though it only needs to be enabled.

Based on the assumption the encode and the original video levels are the same, which I'm 99.99% sure they would be, I don't know why they're displaying differently. Given it's something that's effecting both players, it does point to the video card drivers though.

orion44
26th May 2015, 09:57
I'd change the levels in the Control Panel, but just to be clear, you are connected to a standard PC monitor? It's not a TV?

Yes, I'm connected to a PC monitor.