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. |
22nd June 2013, 04:11 | #1 | Link |
Registered User
Join Date: Aug 2005
Posts: 128
|
Megui/x264 rendering DVDRip overly red
I've been comparing identical frames between DVD VOB files and the MKV videos rendered with x264 & MeGUI recently, and have been finding them overly red. For comparison I rendered a section of the same DVD VOB file as an Xvid file. The color in the Xvid file matches the color in original VOB pretty well.
Here's an example frame of an x254 rendered video: Here's the same frame rendered as an Xvid video: And here's a screenshot of the same frame from the original VOB: From a different DVD, here's a frame from an x264 rendering: And this is a screenshot of the same frame from the source VOB: I've previewed the videos with Potplayer, mpc-hc, smplayer and VLC using a number of different video renderers, each producing pretty much the same results. I just ripped the scene from the DVD in the second 2 screenshots above with a older copies of MeGUI and x264 on another PC, and got the same results. I also spent an entire evening learning how to modify the Avisynth files to adjust brightness, saturation, contrast and hue. But I wasn't able to come close to the original color balance of the source that Xvid managed to match from the same avs script that x264 rendered overly red. I've recently updated my copy of MeGUI which included the current version of x264, and my Avisynth seems to be up to date. I'd certainly appreciate any thoughts on all this.
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] Last edited by TakuSkan; 26th June 2013 at 08:36. |
22nd June 2013, 06:27 | #3 | Link | ||
Registered User
Join Date: Aug 2005
Posts: 128
|
Quote:
fds Last rip: Original VOB: Quote:
EDIT: Nope... same old problem: "Your signature cannot be longer than 400 characters including BB code markup." Board rules have changed since I joined.
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] Last edited by TakuSkan; 26th June 2013 at 08:42. |
||
22nd June 2013, 14:00 | #4 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
TinyURL FTW
In your AviSynth script, try Code:
ColorMatrix(mode="Rec.601->Rec.709") Last edited by raffriff42; 22nd June 2013 at 14:11. Reason: linkage |
23rd June 2013, 00:35 | #5 | Link | |
Registered User
Join Date: Aug 2005
Posts: 128
|
Thanks... Did that, then got this from the board: "Your signature cannot be longer than 200 characters excluding BB code markup." 1st 400, now 200.
Quote:
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] Last edited by TakuSkan; 23rd June 2013 at 00:40. |
|
23rd June 2013, 12:51 | #6 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
Oh man, just TELL me then, what is this Dali painting you speak of?
Same results again? Well I never. Try this and tell me you don't see any change: Code:
#avisynth ## original = face (2nd image from top) O=ImageSource("35cndps.jpg").ConvertToYV12().Crop(320, 80, 176, 240) G=O.ColorMatrix(mode="Rec.601->Rec.709") GG=G.ColorMatrix(mode="Rec.601->Rec.709") R=O.ColorMatrix(mode="Rec.709->Rec.601") RR=R.ColorMatrix(mode="Rec.709->Rec.601") return StackHorizontal( \ GG.SubTitle("GG").AddBorders(0, 0, 8, 0), \ G.SubTitle( "G").AddBorders(0, 0, 8, 0), \ O.SubTitle( "O").AddBorders(0, 0, 8, 0), \ R.SubTitle( "R").AddBorders(0, 0, 8, 0), \ RR.SubTitle("RR")) #return GG.Trim(0,-1)+G.Trim(0,-1)+O.Trim(0,-1)+R.Trim(0,-1)+RR.Trim(0,-1) Last edited by raffriff42; 18th March 2017 at 01:43. Reason: (fixed image links) |
23rd June 2013, 23:59 | #7 | Link | |||
Registered User
Join Date: Aug 2005
Posts: 128
|
Quote:
Friends with Sigmund Freud, he was quite a thinker. Quote:
I've read through the links you provided above, but I have to admit I'm way over my head here. I have an extremely limited understanding of Avisynth scripting. Reading the abstract on the ColoMatrix filter though, it would seem that since my source is an MPEG-2 VOB, I should be using 709->Rec.601. The info on that ColoMatrix abstract seems to indicate 601->Rec.709 would be used to convert an XVid/DivX file to MPEG-2: Quote:
Another thing I've been wondering about is why the same Avisynth script used by MeGUI produces an Xvid video that matches the color balance of the original VOB, and produces an x264 video overly red. ColorMatrix wasn't necessary to produce a good Xvid file. Is it possible the problem isn't with Avisynth/ColorMatrix, but is something more directly related to the x264 encoder? Here's one of the MeGUI avi synth scripts I've modified that is using the DGDecode d2v file as the source: Code:
LoadPlugin("C:\Temp\MeGUI\tools\dgindex\DGDecode.dll") DGDecode_mpeg2source("C:\Temp\VIDEO_TS\VTS_02_1.d2v", info=3) LoadPlugin("C:\Temp\MeGUI\tools\avisynth_plugin\ColorMatrix.dll") ColorMatrix(mode="Rec.601->Rec.709") #deinterlace #crop LanczosResize(720,528) # Lanczos (Sharp) #denoise trim(7000,8000) EDIT: Looking closer I now see you ran ColorMatrix on both G an R creating GG and RR. So they're not duplicates. But the differences, if any, are more subtle than I can make out. Certainly nothing like the differences between my Xvid and x264 rips from the same avs file.
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] Last edited by TakuSkan; 24th June 2013 at 09:53. |
|||
24th June 2013, 14:03 | #8 | Link | |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
>Geopoliticus Child Watching the Birth of the New Man
Thank you! I can see how that would be controversial, especially in [1940s] Europe. >It appears you've created 2 sets of identical images. The difference is hard to see for sure, but sample GG is twice as green as sample G, since it's been passed through ColorMatrix twice; in the same way, sample RR is twice as red as sample R. I'm doing an exaggerated, double correction to help show the subtle effect of ColorMatrix. >MeGUI produces an Xvid video that matches the color balance of the original VOB, and produces an x264 video overly red. Xvid and related codecs support BT.601 only, and that simplifies things a whole lot. >since my source is an MPEG-2 VOB, I should be using 709->Rec.601 Note the ColorMatrix page says "many" MPEG-2 streams use Rec.709, not "all" - this means, to me, that if the encoded version is coming out red, then action is called for. I suggested two possible corrections, but there is a third: the "matrix" argument to ConvertToYV12 etc. Here all all 3 options, in "pipeline" order:
Finally, this sums it up really well: Quote:
Last edited by raffriff42; 24th June 2013 at 14:15. |
|
25th June 2013, 00:14 | #9 | Link | ||||
Registered User
Join Date: Aug 2005
Posts: 128
|
Quote:
Quote:
Quote:
Code:
LoadPlugin("C:\Temp\VIDEO_TS\VTS_02_1.d2v", info=3) LoadPlugin("C:\Temp\MeGUI\tools\avisynth_plugin\ColorMatrix.dll") ColorMatrix(hints=true, threads=0) #deinterlace #crop LanczosResize(720,528) # Lanczos (Sharp) #denoise trim(7000,8000) EDIT: I went back and reviewed all the tests I've done in the past 10 days, and found the results consistent with what I've posted. Plus, I just started from scratch with rendering a clip from the DVD in the 1st screenshots above. 1st doing nothing but resizing the video (script above). 2nd running that same script, but with --colormatrix bt709 configured in the x264 profile as you suggested. Then 3rd replacing 'ColorMatrix(hints=true, threads=0)' with 'ColorMatrix(mode="Rec.601->Rec.709")'. Still no luck.. How do you use --colormatrix bt709 in VDub? When I modify ColorMatrix options in the avs scripts, I'm not seeing any change in colors when I reload the video preview in MeGUI. Same if I load the avs file in VDub. And I'm not seeing any changes of color in the rendered clips. When I modify values like 'ColorYUV(gain_u=-7, gain_v=-0)' and 'Tweak(sat=.78,bright=5,hue=-3,cont=.8)', I can reopen the video preview in MeGUI and see the changes which are confirmed in the rendered clips. Quote:
Looking at the images you produced with ColorMatrix, I'm not seeing the radical red shifts I've been getting in my x264 renderings. Is it possible something else is going on?
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] Last edited by TakuSkan; 25th June 2013 at 04:49. Reason: Confirming previous test resuts. |
||||
25th June 2013, 07:43 | #10 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
>Is it possible something else is going on?
I think so; maybe something to do with the "hints" feature of DGDecode, I don't know. I tried to duplicate your work using MeGUI+DGDecode, and (1) I don't get a red shift after encoding -- although that may be due to my choice of DVD and/or my media player (MPC-HC w/ Haali) (2) Like you, I don't see any change using the "--colormatrix bt709" option (3) However, I do see a change when use ColorMatrix(mode="Rec.601->Rec.709") That is, I changed this line in my script: ColorMatrix(hints=true, interlaced=true, threads=0) to read: ColorMatrix(mode="Rec.601->Rec.709", hints=true, interlaced=true, threads=0) Output from the stock script (or with "--colormatrix bt709", it didn't matter): With "Rec.601->Rec.709": In the second picture, the red flowers are less saturated and darker; the grass is more saturated and brighter. Last edited by raffriff42; 18th March 2017 at 01:42. Reason: (fixed image links) |
26th June 2013, 00:08 | #11 | Link |
Registered User
Join Date: Aug 2005
Posts: 128
|
Much Ado About Nothing
Problem solved. Seems the title of Shakespeare's play would be pretty applicable here. A lot of noting for nothing.
When I 1st tested these video clips in the 5 software video players (left out WMP above) I use most of the time, in the back of my mind I was thinking about some point in the past when most were configured with different renderers. Can't believe I failed to actually check that, did the tests, and never looked back 'till now. Turns out the renderers for 3 out of 5 are now set to 'System Default' or 'Select Automatically'. Potplayer has my default ever since I discovered it and found I could customize the interface via compressed XML files. When I started working on this today, it hit me you wrote you have Haali configured in MPC-HC raffriff42. I was realized I was fuzzy about just how carefully I'd checked the renderers. I found Potplayer set to 'Select Automatically', I changed that to Haali and bam... the right color balance. Oddly tho', I switched to each of those renderers and none gave me that overly red hue. So I don't know what renderer Potplayer was using. Rereading my initial post, I was reminded of a test teachers gave my class in high school. It was 2-3 pages of questions and instructions for things to do. The 1st item said to read through the entire test before doing anything. The last said not to do anything. It took 10-15 minutes for most of us to catch on, and that pretty much because of a gradual rise in muffled laughter. Where's the animated GIF emoticon with the head banging against the wall? This was the 1st time I've seen this with a MeGUI rip tho'. Not working directly with video on a day to day basis, I'm obviously way behind the curve around here.
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] Last edited by TakuSkan; 26th June 2013 at 08:44. |
27th June 2013, 04:43 | #13 | Link |
Registered User
Join Date: Aug 2005
Posts: 128
|
I'd still like to figure out just what it was about these 2 DVDs that caused the player renderers to display the re-encoded x264 video with too much red. Why the Xvid rip wasn't affected by the default renderers. And I'm wondering if that's just what's going to happen from time to time with nothing to prevent it other then switching the media player's video renderer. These were relatively significant shifts in color balance.
__________________
[Taku Skan doesn't represent me, but is recogition of a Lakota sense of the sacred.] [My TakuSkan avatar is a detail from a Dali painting that's provoked a few philoshopic questions.] [I do Zen on a K75S] |
Thread Tools | Search this Thread |
Display Modes | |
|
|