Log in

View Full Version : Getting a random color line at bottom when cropping


samaron
2nd June 2017, 11:27
Hi!

This might become a lot of text, but I'm trying to describe my issue as detailed as possible. Please bear with me!

I'm experiencing random appearing colored lines at the bottom of the image after cropping in avisynth. This only occur if I crop a different amount between top and bottom. If I crop the same amount, it doesn't happen. Of course, this would in most cases result in overcropping one way or the other. I don't want that.

At first I thought this was because of me using an old version of avisynth and/or plugins. It didn't do this before, and I'm not sure when the problem started. Because of this, I simply deleted everything and started from scratch. I installed the latest version of avisynth, avspmod and plugins I use. Everything is the 32-bit versions of the software (though, I'm using 64-bit Win7 Pro). The required plugins for MCTDmod were from a bundle pack posted in the same thread (updated the Dither plugin as stated in the thread).

The color lines appear at random and last only one frame, though, it might appear again after 4 frames without, or maybe 2000 frames later. It is random. I assume this has to be avisynth related, as I can (if I'm lucky) find frames with color lines at the bottom in the preview window in avspmod. When encoding, I'm using x264 and the color lines are very obvious when looking at the end result.

Here is the script I'm currently using:
LoadCPlugin("C:\Program Files (x86)\AviSynth\plugins\yadif.dll")
DirectShowSource("E:\Daicon-3-&-4-OP-+-making-of-short.avi")
ConvertToYV12()
LanczosResize(720, 480)
MCTD(settings="low")
Levels(14, 1.075, 255, 0, 255, coring=true)
Crop(2, 6, -22, -8)
#yadif()
tfm()
tdecimate()
vinverse()
tweak(sat=1.2)
Toon(1.0)
LanczosResize(632,464)

The strange thing is that if a friend of mine encodes with the same cropping that gives me colored lines, he does not.

Does anyone have any idea to why this happens?

Here is a video file (http://www.togstad.net:90/filer/flicker.mkv) to illustrate the issue (38 second sample with no audio).

Here is also a couple of screenshots showing a line in the preview (were lucky and found one). If I overcrop in the top to match the amount of cropping in the bottom, the line disappears.

http://www.togstad.net:90/filer/bilder/daicon/fargelinje-preview.jpg
http://www.togstad.net:90/filer/bilder/daicon/fargelinje-preview2.jpg

raffriff42
2nd June 2017, 15:24
Does it help if you do this:...
ConvertToYV24
Crop(2, 6, -22, -8)
ConvertToYV12
...

Taurus
2nd June 2017, 16:59
mmh, maybe an old mvtools2.dll?
Got the same symptom just a month ago.
Updating to the latest version fixed it for me.
Read this post: https://forum.doom9.org/showthread.php?p=1805161#post1805161

samaron
2nd June 2017, 17:01
Did not help, I'm afraid. If I used ConvertToYV24 after the crop command, I got this result as pictured below. Not sure if it helps indicate something.

http://www.togstad.net:90/filer/bilder/daicon/fargelinje-preview3.jpg

EDIT:
mmh, maybe an old mvtools2.dll?
Got the same symptom just a month ago.
Updating to the latest version fixed it for me.
Read this post: https://forum.doom9.org/showthread.php?p=1805161#post1805161

That seems to have done the trick! Still haven't fully tested it, will do so tomorrow as I don't have more time today. The green line disappeared from the preview window after copying over the version you described in your post.

raffriff42
2nd June 2017, 17:49
ConvertTo24 before Crop please.

(I've seen this before; I wonder if its a chroma placement thing; but the easiest thing to do is convert to YV24)

spoRv
2nd June 2017, 18:32
Maybe there was something about the fact cropped size was not mod4 - I had the same problems, and solved doing the crop as the last step.

Thanks to Taurus to have pointed me too in the right direction!

StainlessS
2nd June 2017, 21:46
Did not help, I'm afraid. If I used ConvertToYV24 after the crop command, I got this result as pictured below.

Are all of your plugins v2.6 compatible ?, looks like chroma in weird 3 of the 4 quarters are zero(Green). (ie for chroma, uses luma dimensions / 2, same as if YV12, when its actually YV24).

EDIT: v2.5 plugin sees ALL planar colorspaces as YV12 (so when copying chroma, only copies dimensions W/2 and H/2, as if YV12,
remainder of frame chroma is dependent upon previous contents of the memory buffer, which early on during frame serving, will likely be zeros).

EDIT: (Green) Problem will be somewhere AFTER ConvertToYV24. (Can just comment out all following lines, an enable them one by one until prob appears).


EDIT:
That seems to have done the trick! Still haven't fully tested it
The updated MvTools fixed, EVERYTHING ? [random line, and Green quarters], (if so then might account for all written above).

samaron
3rd June 2017, 12:37
I apologize for the slight confusion. I did try with ConvertToYV24 before crop, and then ConvertToYV12 after crop. It did not change anything. If I only used ConvertToYV24 after crop, that was the only time I got a noticable change. Only posted that result in case it would help indicate what the problem might be.

The specific video file I'm working with now is 720x486, which some plugins did not like. That is why I have the resize command at the very beginning, to work around that awkward resolution. However, this problem is not specific to this awkward video file. It does happen on normal 720x480 files too.

I did some more testing now, but it seems the problem moved to other frames instead. I only noticed yesterday that the phenomenon could not be recreated on the specific frame I used for testing. Thought it had been fixed, but apparently not.

I'm now going to encode a test with the crop command at the bottom, to see if that makes any difference.

I would assume all my plugins are 2.6 compatible. What you see in my script is what I use. The MCTDmod uses the plugin pack posted in the thread, those are basically the only ones I don't have full overview of. I'll look further into the specific ones it uses and see if there is one that isn't compatible with 2.6.

samaron
6th June 2017, 15:33
I wrote a lengthy reply a couple of days ago, but I see it for some reason didn't actually post.

Long story short:
Updating the mvtools2 dll didn't work after all. I moved crop down to the bottom, as the 2nd last, and that did the trick. Didn't get weird colored lines in the bottom of the picture after encoding.