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. |
![]() |
#1 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
Strange color problem
Hi,
I have a video that has a strange problem with colors, it's especially visible on parts in movement. But when I play this mpg with MPC-HC, this problem is not really visible. IIRC, I recorded it a few years ago on TV with my Set-top box. Its HDD was crypted and the only way I had to transfer recordings was to capture by its analog output (Scart with S-video adaptator) with my Hauppauge card. Thus I wonder if the problem comes from a bad encoding by the TV channel or if it was created when I captured it and was caused by the Set-top box or by my capture card. I recorded in mpeg-2 @ 12Mbps in PAL system. That's supposed to be anamorphic 16/9 but I exported these jpeg in 720.576 with Virtual Dub. Here is how it looks like without any filter (I tried FFVideoSource and LWLibavVideoSource, both give the same result, except the field order), click to see the real size ; ![]() It's originally progressive but encoded interlaced. It seems 2 fields of 2 successive frames are blended. If I use tfm(), that's better, but another problem appears (the main problem actually) ; ![]() I get the same result than tfm() if I remove the first field like this ; Code:
separatefields().trim(1,0).weave() ![]() ![]() ![]() The chroma and luma move separately ![]() How to fix this ? |
![]() |
![]() |
![]() |
#2 | Link |
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
On first image both fields have exactly same chroma, which is blended from 2 frames. Last 3 images seem to have normal chroma, but it's not synced to luma.
It's really hard to say if it's fixable without an actual sample. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
Here is a sample ;
https://www.sendspace.com/file/2eermu |
![]() |
![]() |
![]() |
#6 | Link | |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
Quote:
Do you know what could be the origin of this problem ? And can you explain a little bit your script ? There are still little problems ; add separatefields() at the end and look at frames 393, 395, 397, 399 and 401 (196 to 200 without separatefields) : the top of the wall becomes green. |
|
![]() |
![]() |
![]() |
#8 | Link |
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
I can see what the problem is (chroma fields are out of order, maybe they are BFF while luma TFF), but I have no idea how this could have happened.
In my script I change order of chroma fields by using SelectEvery and then remove one field, that matches all fields and makes video progressive. |
![]() |
![]() |
![]() |
#9 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,601
|
vivan's looks correct.
It's a chroma phase delay. I don't know the exact "engineering-speak" mechanism, but I think it's related to PAL hannover bars https://en.wikipedia.org/wiki/Hanover_bars Last edited by poisondeathray; 26th September 2015 at 23:42. |
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
Thanks, I had never heard of this.
If I get it with really interlaced videos (Tv shows, documentary ...), will vivan's script work too ? By the way, with other videos (recorded with my new Set-top box that does not crypt its HDD) transfered as is on my pc, I see sometimes the same problem than on first frame (blending) but without chroma phase delay. In this case, can I simply remove first field (which seems to work) or there is something better to do ? When these videos are movies (originally progressive), tfm() also works. Same question ; is there anything better to do ? Last edited by Music Fan; 27th September 2015 at 12:01. |
![]() |
![]() |
![]() |
#11 | Link | |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
By the way, how to compare with and without effect with this kind of script ?
Quote:
Code:
v1=LWLibavVideoSource("P:\Dji ext.mpg") v2=v1.greyscale() stackhorizontal(v1,v2) |
|
![]() |
![]() |
![]() |
#12 | Link |
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
For visual comparisons Interleave function is much better.
In Avisynth each function writes into a variable named "last" unless you explicitly assign it to another variable. For example my code is equal to Code:
last = LWLibavVideoSource("Dji ext.mpg") luma = last.SeparateFields().Trim(1, 0).Weave() chroma = last.SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() last = luma.MergeChroma(chroma) return last Code:
LWLibavVideoSource("Dji ext.mpg") luma = SeparateFields().Trim(1, 0).Weave() chroma = SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() v1 = luma.MergeChroma(chroma) Interleave (v1, last) Last edited by vivan; 5th October 2015 at 11:00. |
![]() |
![]() |
![]() |
#13 | Link | |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
Thanks.
Quote:
But if I really need to see both together, how tu use stack ? |
|
![]() |
![]() |
![]() |
#14 | Link |
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
After some tests I found how to make it ;
Code:
LWLibavVideoSource("P:\Dji ext.mpg") v2=LWLibavVideoSource("P:\Dji ext.mpg")#without effect luma = SeparateFields().Trim(1, 0).Weave() chroma = SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() luma.MergeChroma(chroma) stackhorizontal(last,v2) edit : actually there is a strange problem : if I add SeparateFields() after this script to get ; Code:
LWLibavVideoSource("P:\Dji ext.mpg") v2=LWLibavVideoSource("P:\Dji ext.mpg")#without effect luma = SeparateFields().Trim(1, 0).Weave() chroma = SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() luma.MergeChroma(chroma) stackhorizontal(last,v2) SeparateFields() ![]() I believed that v2 would act as this script ; Code:
LWLibavVideoSource("P:\Dji ext.mpg")#tff SeparateFields() ![]() I guess it's because last became BFF [with Trim(1, 0).Weave()] and last prevails over v2 which is thus forced to become bff. edit 2 : the field inversion on v2 disappears when I simply reverse last and v2 in the stackhorizontal line ; stackhorizontal(v2,last) instead of stackhorizontal(last,v2) Last edited by Music Fan; 5th October 2015 at 10:22. |
![]() |
![]() |
![]() |
#15 | Link | |||
/人 ◕ ‿‿ ◕ 人\
Join Date: May 2011
Location: Russia
Posts: 643
|
I meant "unless" not "until", sorry. Yeah, that typo changed my explanation into a complete wrong one.
But no, you assign values to variables... Well, they will be objects in C#/Java, but still not functions. They have "clip" type, so lets simly call them clips. You don't assign functions to anything, you assign their result. But that result is calculated "lazily", only when it's needed. Just think about it as if clip was just a number. Another thing to note is that every function uses "last" as first input if no input is specified. Or uses specified clip, if you write it like this: "clip.function()", which is equal to "function(clip)". So this code Code:
LWLibavVideoSource("Dji ext.mpg") luma = SeparateFields().Trim(1, 0).Weave() chroma = SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() luma.MergeChroma(chroma) Code:
last = LWLibavVideoSource("Dji ext.mpg") luma = SeparateFields(last) luma = Trim(luma, 1, 0) luma = Weave(luma) chroma = SeparateFields(last) chroma = SelectEvery(chroma, 2, 1, 0) chroma = Trim(chroma, 1, 0) chroma = Weave(chroma) last = MergeChroma(luma, chroma) return last UPD:While this works opening video twice is not a "clean" solution. Probably this way it will be easier to modify: Code:
source = LWLibavVideoSource("P:\Dji ext.mpg") luma = source.SeparateFields().Trim(1, 0).Weave() chroma = source.SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() result = luma.MergeChroma(chroma) StackHorizontal(source, result) Quote:
Quote:
Quote:
Last edited by vivan; 5th October 2015 at 11:34. |
|||
![]() |
![]() |
![]() |
#16 | Link | ||||
Registered User
Join Date: May 2009
Location: Belgium
Posts: 1,748
|
Quote:
Quote:
Is there a way to open only 1 time the video and make a script a simple as mine, without result = and without typing source. each time a new line is added ? Edit : I believe I have found, tell me if it's ok or if it has disadvantages ; Code:
v1=LWLibavVideoSource("P:\Dji ext.mpg") v2=v1 last=v1 luma = SeparateFields().Trim(1, 0).Weave() chroma = SeparateFields().SelectEvery(2, 1, 0).Trim(1, 0).Weave() luma.MergeChroma(chroma) greyscale()#just to show that functions can be added this way stackhorizontal(last,v2)#last is black and white, v2 is untouched (except its field order) Quote:
Here is the explanation, that's what I guessed ; http://avisynth.nl/index.php/StackHorizontal Quote:
Last edited by Music Fan; 5th October 2015 at 21:32. |
||||
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|