Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th February 2011, 20:21   #1  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
Converting Fraps footage with x264, output file's colors become brighter?

I have some 720p footage taken with Fraps that I'm trying to compress with x264 using MeGUI. The problem is, the output file's colors do not look anything like the original video nor the preview in MeGUI. The original file and the preview in MeGUI look identical. They are too bright. How can I fix this? I've tried using the 4 different matrices with ConvertToYV12, the colors look a little better, but not how I would like them to be. Here are some comparative screenshots.

Original, uncompressed:
http://imgur.com/wdP5a.jpg

Compressed with x264:
http://imgur.com/gQa7u.jpg

Will I have to correct this in a editing program?

Encoded with these settings: program --preset slow --pass 2 --bitrate 6000 --stats ".stats" --deblock 0:-2 --bframes 0 --ref 3 --output "output" "input".

Last edited by Gfer; 5th February 2011 at 20:25.
Gfer is offline   Reply With Quote
Old 5th February 2011, 20:44   #2  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,033
-> FAQ: How to correct luminance levels
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Old 5th February 2011, 22:45   #3  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
Interesting, by default, MPC-HC sets the range to 0-255, but if I switch it to 16-255 the video looks like it should.
Gfer is offline   Reply With Quote
Old 5th February 2011, 22:52   #4  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,872
What source filter / decoder are you using for the avs script?

AVISource() using the fraps decoder will be RGB (0-255), if you use converttoyv12() it will default to rec601 (Y' 16-235)

FFVideoSource() will decode using full range YUV (Y' 0-255)

Also , The method in which you take screenshots will affect the appearance (ie. which matrix did you use to convert YUV data to RGB for the screenshot)

See
http://forum.doom9.org/showthread.php?t=157941

Last edited by poisondeathray; 6th February 2011 at 04:58.
poisondeathray is offline   Reply With Quote
Old 5th February 2011, 23:15   #5  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
I'm using AVISource(). I didn't do anything to the fraps video. So how do I use FFVideoSource()? What about audio? I don't have a lot of experience encoding. I used whatever matrix is the default for MPC-HC.
Gfer is offline   Reply With Quote
Old 5th February 2011, 23:28   #6  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
x264 by default encodes as TV range.

You must either convert to TV range in your script, or use --fullrange. We have a patch under development to make x264 automatically do --fullrange, but this will not work for Avisynth scripts (it's impossible to judge reliably from an Avisynth script whether the output is fullrange or not).
Dark Shikari is offline   Reply With Quote
Old 5th February 2011, 23:34   #7  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
How would I go about converting to TV range in my script? I'll try encoding the video with --fullrange on meanwhile.

Edit: --fullrange on didn't do anything, it still doesn't look right.

Last edited by Gfer; 5th February 2011 at 23:39.
Gfer is offline   Reply With Quote
Old 5th February 2011, 23:56   #8  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,033
Quote:
Originally Posted by Gfer View Post
How would I go about converting to TV range in my script?
http://avisynth.org/mediawiki/Convert#Options
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.


LoRd_MuldeR is offline   Reply With Quote
Old 5th February 2011, 23:59   #9  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,872
I read your first post incorrectly. If the original and megui preview correlate, then it is likely a playback problem . Read Lord Mulder's post again. (or are you saying they correlate, but are both wrong?)

If you're using overlay mixer in mpchc, then you can calibrate your graphics card overlay settings (this is different than desktop graphics card settings . )

Some players disregard whatever you flag in x264 (the flag doesn't change the actual video data anyway, it's just a suggestion to the player to display as full range or limited range)

Last edited by poisondeathray; 6th February 2011 at 00:02.
poisondeathray is offline   Reply With Quote
Old 6th February 2011, 00:01   #10  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
Already tried ConvertToYV12(matrix="Rec601") and ConvertToYV12(matrix="Rec709"). Still not working. All I want to do is to compress the fraps footage with x264 into a .mp4 file that can be uploaded to Youtube or viewed in MPC-HC without altering any settings in MPC-HC.

The original and preview correlate. They represent exactly how I want the video.

Last edited by Gfer; 6th February 2011 at 00:09.
Gfer is offline   Reply With Quote
Old 6th February 2011, 00:12   #11  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,872
Quote:
The original and preview correlate. They represent exactly how I want the video.
If your script for that used ConvertToYV12() (converttoyv12 defaults to rec601) and the original and preview look exactly how you want, then it's likely a playback configuration issue. (ie. you have MPCHC setup incorrectly. )

x264 doesn't change levels when fed YV12 input . i.e. input=output

And youtube always displays as Rec709 (even SD content) - ie. YUV=>RGB conversion for display uses Rec709 matrix, so you will never get it looking 100% identical on youtube.
poisondeathray is offline   Reply With Quote
Old 6th February 2011, 00:21   #12  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
Is there no way to make the video play correctly out of the box in MPC-HC?
Gfer is offline   Reply With Quote
Old 6th February 2011, 00:24   #13  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,033
Quote:
Originally Posted by Gfer View Post
Then, how do I set up MPC-HC correctly? Is there no way to make the video play correctly out of the box?
Depending on whether the individual player/renderer assumes TV-Levels or PC-Levels by default, the configuration that produces correct display "out-of-the-box" is different

If, for example, you use choose Haali's Renderer or MadVR as your renderer in MPC-HC, you can simply switch the Luminance Levels in the renderer options...

__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 6th February 2011 at 00:28.
LoRd_MuldeR is offline   Reply With Quote
Old 6th February 2011, 00:26   #14  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,872
If you're taking screenshots in MPCHC, that means you have the renderer set to VRM9 renderless or VRM7 renderless - this changes how the file looks

As Lord Mulder suggests, change the renderer to overlay mixer, or haali, or mad vr and it will look less "washed out"

There is no perfect "out of the box" settings, because your graphics card settings can alter how it looks if you use certain renderers

When you make changes, make sure you exit the player and restart before checking again
poisondeathray is offline   Reply With Quote
Old 6th February 2011, 00:40   #15  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
Haali's renderer and MadVR are greyed out in my settings. Are they plugins? I took the screenshots with the EVR presets renderer. The video looks like it should in overlay mixer. It's sort of annoying though, when a video plays, Windows Aero is turned off. It's turned on again when I close MPC-HC. Should I try a ffdshow + MPC combo? Seems like it's easier to configure.

I've kept MPC-HC mostly because it plays DXVA very well for me. Does ffdshow have support for that?

Last edited by Gfer; 6th February 2011 at 00:43.
Gfer is offline   Reply With Quote
Old 6th February 2011, 00:46   #16  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,033
Quote:
Originally Posted by Gfer View Post
Haali's renderer and MadVR are greyed out in my settings. Are they plugins? I took the screenshots with the EVR presets renderer. The video looks like it should in overlay mixer. It's sort of annoying though, when a video plays, Windows Aero is turned off. It's turned on again when I close MPC-HC. Should I try a ffdshow + MPC combo? Seems like it's easier to configure.
Both, Haali's Renderer and MadVR are implemented as DirectShow filters. You need to install/register them separately.

Then you should be able to use them in any DirectShow-based player, at least if the player exposes an option to choose a "custom" renderer (MPC-HC does).

The "overlay renderer" naturally causes Aero Glass to be temporarily disabled, as overlays can't work with desktop composition enabled...

See also:
http://forum.doom9.org/showpost.php?...14&postcount=1


Quote:
I've kept MPC-HC mostly because it plays DXVA very well for me. Does ffdshow have support for that?
Yes. But neither Haali's Render nor MadVR currently supports DXVA. So you'll have to use EVR for DVXA decoding to work, I guess.

Nontehelss any half-way decent machine should be able to decode 1080p H.264 with pure software decoding...
__________________
There was of course no way of knowing whether you were being watched at any given moment.
How often, or on what system, the Thought Police plugged in on any individual wire was guesswork.



Last edited by LoRd_MuldeR; 6th February 2011 at 00:50.
LoRd_MuldeR is offline   Reply With Quote
Old 6th February 2011, 01:05   #17  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
Any modern half-way decent machine, yeah. I utilise DXVA on a old Intel Pentium 4 processor. Plays 1080p just fine. I'd rather spend $20 on a new graphics card and be able to play HD videos rather than buying a new motherboard + cpu. Anyway, I tried both Haali's Renderer and MadVR. The video plays just as expected. Problem solved, I guess. Just worried about if I share the .mp4 with other people and the colors are off. Minecraft and other colorful games are so vivid and creates a drastic change in color.
Gfer is offline   Reply With Quote
Old 6th February 2011, 01:40   #18  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by Gfer View Post
Already tried ConvertToYV12(matrix="Rec601") and ConvertToYV12(matrix="Rec709"). Still not working. All I want to do is to compress the fraps footage with x264 into a .mp4 file that can be uploaded to Youtube or viewed in MPC-HC without altering any settings in MPC-HC.

The original and preview correlate. They represent exactly how I want the video.
That doesn't work. FRAPS decodes as PC-range YV12. Those commands exist to convert RGB to TV-range YV12. But your video is already YV12, so those commands do nothing.
Dark Shikari is offline   Reply With Quote
Old 6th February 2011, 01:51   #19  |  Link
Gfer
Registered User
 
Join Date: Mar 2006
Posts: 12
How would I convert it to TV-range? I did .Info() on the fraps video, it's color space was RGB32.
Gfer is offline   Reply With Quote
Old 6th February 2011, 05:01   #20  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 3,872
Quote:
Originally Posted by Gfer View Post
How would I convert it to TV-range? I did .Info() on the fraps video, it's color space was RGB32.

If you're using the fraps decoder with AVISource, it will be RGB

RGB is 0,0,0 - 255,255,255 (ie. 0,0,0 is black, 255,255,255 is white)

When you convert to Y'CbCr (e.g. ConvertToYV12() ), that converts RGB [0-255] to Y' 16-235, CbCr 16-240 which is "TV range". Y' 16 is black, Y'235 is white

(i.e. when you don't specify a matrix for converttoyv12() it uses rec601, which is TV range)
poisondeathray is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.