View Full Version : avi (DV) to mp4, correct color and vertical green bar
cooli
10th September 2017, 19:03
Hello,
I'm trying to convert DV avi to mp4 with the best quality in mind, but I'm not very satisfied with the result.
1) I use this AviSynth+ script
----------------
LoadPlugin("C:\Software\Install\64bit\Video\AviSynth+\plugins64\ffms2.dll")
Import("C:\Software\Install\64bit\Video\AviSynth+\plugins64\FFMS2.avsi")
Import("C:\Software\Install\64bit\Video\AviSynth+\plugins64\QTGMC.avsi")
FFmpegSource2("D:\Temp\Video\DV.avi")
QTGMC( Preset="Slower")
2) I open the avs file with VirtualDub FilterMod
3) I filter the noise with NeatVideo and crop in VirtualDub
4) Save the file as mp4 with the included encoder : x264 8 bit - H.264/MPEG-4 AVC codec
Original file : https://www.fvnet.ch/tmp/test/DV.avi
Result file : https://www.fvnet.ch/tmp/test/DV.mp4
LemMotlow
10th September 2017, 23:23
I'm trying to convert DV avi to mp4 with the best quality in mind, but I'm not very satisfied with the result.Hmm. Other than the fact that NeatVideo turned some fine detail into mush, and the encoded bitrate is too low, what don't you like about it?
Color balance is another matter. It's too red. Add Green + blue (cyan) to balance red. Also, your luma levels are illegal and out of spec, highlights blown away:
https://www.mediafire.com/file/bf32katz7z7mjj8/Dv%20illegal%20levels%20and%20clipping.png
Your mp4 plays back at 5:4 aspect ratio. What's with that? Isn't PAL DV standard def a 4:3 ratio? What's with the oddball output fie size and mod2 width? Can't your gear play standard video formats? Why are you using FFMS2 with DV souce. Have you heard about AviSource()? Much more reliable with DV.
I guess that's enough questions that were bothering me.
LoadVirtualDubplugin("drive:\path\VirtualDub\plugins\ccd.vdf","CamcorderColorDenoise",1)
AviSource("DV.avi")
AssumeBFF()
Levels(16,1.0,255,16,235,dither=true,coring=false)
# ------------ chubbyrain2 - interlaced, clean up border stain ----
separatefields()
a=last
a
chubbyrain2()
SmoothTweak(Hue2=7)
crop(690,0,0,0,true)
b=last
overlay(a,b,x=690)
weave()
QTGMC(preset="super fast",border=true)
TemporalDegrain(SAD1=300, SAD2=200, Sigma=12)
GradFun2DBmod()
SMoothUV()
Santiag(3,3, type="Sangnom")
LimitedSharpenFaster()
Crop(4,0,-12,-8).AddBorders(8,4,8,4)
ConvertToRGB32(interlaced=false,matrix="Rec601")
CamCorderColorDenoise(32,1)
ConvertToYV12(interlaced=false)
return last
result: DV_00B.mp4 (https://www.mediafire.com/file/u3n32m01ttx99tp/DV_00B.mp4)
highlights blown away.png (https://www.mediafire.com/file/bf32katz7z7mjj8/Dv%20illegal%20levels%20and%20clipping.png)
lansing
11th September 2017, 02:51
Lem, neatvideo denoise scales with user defined profiles, it can be very subtle given a profile with little noise, don't spread false info when you have never used it.
TemporalDegrain is designed for video with super heavy grain, so it's not suitable for most cases either.
To OP, the green bar on the right was caused by missing information on the V plane on that area, I have the same problem before and this is the fix. My problem was horizontal green bar, so you'll need to adjust the crop to make it vertical
https://forum.doom9.org/showthread.php?p=1581717#post1581717
For the color cast on the video, you really need something like Adobe Premiere to do it, such as removing the cast by gray point with curve.
LemMotlow
11th September 2017, 03:02
Chill, lansing, I was using NeatVideo before you knew how to turn on your PC. You're making some stupid cheap assumptions about other users, and you're overrating NeatVideo.
That TemporalDegrain is turned down to almost nothing. I assume you know about things called parameters, right? (NeatVideo has over 30 of them).
You don't need Adobe Premiere to adjust color, although it can do a pretty good job. If you knew how to use Virtualdub and had a little experience with color theory and grading, you'd know that many of VDub's add-ins can mimic a lot of Adobe stuff. Adobe sucks anyway, always did, does now, always will. That grain and heavy filters are what the user gets for capping noisy analog video to lossy noisy DV in the first place.
lansing
11th September 2017, 03:44
um, talk about turning detail into mush
left: OP's encode
right: LemMotlow's temporaldegrain (frame 406)
https://i.imgur.com/99drhUX.pnghttps://i.imgur.com/c0i02Px.png
Look at the coat on the right. I guess you must had used the very first version of neatvideo and never touched it again. And OP's video is nowhere near super heavy grain, so there's no reason to use temporaldegrain.
You don't need Adobe Premiere to adjust color, although it can do a pretty good job. If you knew how to use Virtualdub and had a little experience with color theory and grading, you'd know that many of VDub's add-ins can mimic a lot of Adobe stuff
Well I don't see virtualdub having filters for rgb parade, vectorscope and the waveform monitor, which is the three essential monitors for color correction.
LemMotlow
11th September 2017, 04:06
um, talk about turning detail into mush
left: OP's encode
right: LemMotlow's temporaldegrain (frame 406)
https://i.imgur.com/99drhUX.pnghttps://i.imgur.com/c0i02Px.png
Look at the coat on the right. I guess you must had used the very first version of neatvideo and never touched it again. And OP's video is nowhere near super heavy grain, so there's no reason to use temporaldegrain.
Well I don't see virtualdub having filters for rgb parade, vectorscope and the waveform monitor, which is the three essential monitors for color correction.Ever heard of ColorTools? You never used a vectorscope anyway and don't know what it's for. Apparently you've never used VirtualDub. Why criticize a product you've never used?
Methinks he don't see so good either. And posts a still image to check as a motion noise sample. He kinda likes that buzzing noisy wall-ceiling joint, too, which NeatVideo didn't even see. OMG. A perfect sucker for Adobe's high-priced line of junkware. I mostly appreciate posting a comparison of how much of his own frame the O.P. chopped off to get that goofy picture size so he could see his display's black background more clearly. I like the blown-out highlight, too.
Time for bed.
lansing
11th September 2017, 04:44
Ever heard of ColorTools? You never used a vectorscope anyway and don't know what it's for. Apparently you've never used VirtualDub. Why criticize a product you've never used?
How am I criticizing virtualdub? There's a place for every software, and for color correction, you need a gui for better workflow, in which avisynth and virtualdub cannot do. I would like to try out colortools but it lacking an update to fix the crash on the newer virtualdub.
Methinks he don't see so good either. And posts a still image to check as a motion noise sample. He kinda likes that buzzing noisy wall-ceiling joint, too, which NeatVideo didn't even see. OMG. A perfect sucker for Adobe's high-priced line of junkware. I mostly appreciate posting a comparison of how much of his own frame the O.P. chopped off to get that goofy picture size so he could see his display's black background more clearly. I like the blown-out highlight, too.
This is so out of context, the point of the image comparison is to show that temporaldegrain will wipe out details, it has nothing to do with cropping and blown-out highlight.
poisondeathray
11th September 2017, 05:05
How am I criticizing virtualdub? There's a place for every software, and for color correction, you need a gui for better workflow, in which avisynth and virtualdub cannot do. I would like to try out colortools but it lacking an update to fix the crash on the newer virtualdub.
To be fair, vdub is a sort of GUI :)
It might not be very good compared to other GUI's used for dedicated color correction, but it can still work.
colortools.vdf is 32bit and hasn't been compiled for 64bit by anyone that I know of - so you would need virtualdubfiltermod 32bit . It works
You have "curves" with gradation curves, and color mill is very powerful too . Yes it's a bit "clunky" workflow and you can't see the monitor tools as nicely - but it can do the job
lansing
11th September 2017, 05:39
To be fair, vdub is a sort of GUI :)
It might not be very good compared to other GUI's used for dedicated color correction, but it can still work.
colortools.vdf is 32bit and hasn't been compiled for 64bit by anyone that I know of - so you would need virtualdubfiltermod 32bit . It works
Interestingly enough, the vd filtermod author actually updated a fix version on his page
https://sourceforge.net/projects/vdfiltermod/files/plugins/ColorTools/
You have "curves" with gradation curves, and color mill is very powerful too . Yes it's a bit "clunky" workflow and you can't see the monitor tools as nicely - but it can do the job
Just tested it, nah it's unusable, you need to be able to see the monitor and adjust the curve at the same time, you can't do it in vd.
poisondeathray
11th September 2017, 06:25
Just tested it, nah it's unusable, you need to be able to see the monitor and adjust the curve at the same time, you can't do it in vd.
Sure its "usable." In old vdub, you can go back and forth. It's still works - It's just hell of a lot slower and a "clunkier" workflow as I said before
But in vdubfiltermod, there is ability to open multiple windows, so you have a "live" preview with some filters. See this thread. Also master blend has some monitor capability built in
http://forum.doom9.net/showthread.php?p=1749408
eg. Whaaaat do we have here?? :D
https://youtu.be/lAIcqQA4TMs
Avspmod is a sort of "GUI" too . You can add sliders and you get semi-live updates with the various monitor tools like histogram (waveform), there are functions for rgb parade, vectorscopes etc.. . Faster than old vdub/colortools but still not as nice as something like Resolve . But there is no RGB curve GUI in avspmod, compared to gradation curves in vdub/filtermod
LemMotlow
11th September 2017, 15:27
OK, I'll concede points to both sides concerning TemporalDegrain. I've had NeatVideo on board since v1.5 if you want to go back that far, but here there was no decent noise sample. Even lansing knows you don't throw NV at anything without a good noise sample. I did try it with v3.0 on my machine, but as with the O.P.'s mp4 it blurred out and smeared the fuzzy objects on the left of the image and made an unidentifiable blob of it. The capture itself is something I'd never do --what I have against capping analog to DV is that DV adds noise and buzzing edges that aren't in the source. I gave up on analog to DV back with Win98; it's just too much noise and oddball color to fool with. Rather than chop off chunks of image I'd rather use something to try to clean the edges. There are other denoisers in Avisynth, so I could have made a better choice. The main advice I'd give to the O.P. is to stop using DV for analog sources (or at least find a way to control input source levels with DV) and save yourself some work.
I don't go for the 64-bit argument, not with standard definition, because I have projects that depend on an arsenal of 32-bit filters that I won't give up, so something like PP is practically useless for restoration except for color work. PP doesn't deinterlace, IVTC, or resize worth a dam, and there are better encoders around, so what else can you do with PP except play with color? When I need complex color work and layer/blending features I use AftertEffects CS3 and ColorFinesse, which I won't give up either.
So I guess we can stop all this and play nice. There's more than one way to slay this beast. Good points, all.
cooli
11th September 2017, 20:30
Thanks for taking the time to help :-)
Color balance is something I want to do, but how do you learn to correct that, how do you know it's too red?
Adobe premiere CC is too expensive for me
I have bought NeatVideo, installed the last version and configured it with auto profile and auto tuning.
Concerning the aspect ratio, I have just cropped the borders, what should I do after? Resize, add black borders?
I want to learn how to use these tools properly, but I have to start somewhere.
I didn't use Avisource because of this thread (but maybe I'm wrong) : https://forum.videohelp.com/threads/382528-How-to-achieve-best-results-decompressing-dv-files-before-restoring
Sorry for bothering you with my video, I'm not an expert but I'm sure this video can really look better.
There's is a longer clip, if it helps. https://www.fvnet.ch/tmp/test/DV1.avi
Hmm. Other than the fact that NeatVideo turned some fine detail into mush, and the encoded bitrate is too low, what don't you like about it?
Color balance is another matter. It's too red. Add Green + blue (cyan) to balance red. Also, your luma levels are illegal and out of spec, highlights blown away:
https://www.mediafire.com/file/bf32katz7z7mjj8/Dv%20illegal%20levels%20and%20clipping.png
Your mp4 plays back at 5:4 aspect ratio. What's with that? Isn't PAL DV standard def a 4:3 ratio? What's with the oddball output fie size and mod2 width? Can't your gear play standard video formats? Why are you using FFMS2 with DV souce. Have you heard about AviSource()? Much more reliable with DV.
I guess that's enough questions that were bothering me.
LoadVirtualDubplugin("drive:\path\VirtualDub\plugins\ccd.vdf","CamcorderColorDenoise",1)
AviSource("DV.avi")
AssumeBFF()
Levels(16,1.0,255,16,235,dither=true,coring=false)
# ------------ chubbyrain2 - interlaced, clean up border stain ----
separatefields()
a=last
a
chubbyrain2()
SmoothTweak(Hue2=7)
crop(690,0,0,0,true)
b=last
overlay(a,b,x=690)
weave()
QTGMC(preset="super fast",border=true)
TemporalDegrain(SAD1=300, SAD2=200, Sigma=12)
GradFun2DBmod()
SMoothUV()
Santiag(3,3, type="Sangnom")
LimitedSharpenFaster()
Crop(4,0,-12,-8).AddBorders(8,4,8,4)
ConvertToRGB32(interlaced=false,matrix="Rec601")
CamCorderColorDenoise(32,1)
ConvertToYV12(interlaced=false)
return last
result: DV_00B.mp4 (https://www.mediafire.com/file/u3n32m01ttx99tp/DV_00B.mp4)
highlights blown away.png (https://www.mediafire.com/file/bf32katz7z7mjj8/Dv%20illegal%20levels%20and%20clipping.png)
lansing
11th September 2017, 20:30
But in vdubfiltermod, there is ability to open multiple windows, so you have a "live" preview with some filters. See this thread. Also master blend has some monitor capability built in
http://forum.doom9.net/showthread.php?p=1749408
eg. Whaaaat do we have here?? :D
https://youtu.be/lAIcqQA4TMs
Just tried it, it's more like a hack than an ability. It's still unusable to me because of all those steps just to make it work, and going through the steps again for every change. It'll need a rewrite on the filter chain.
cooli
11th September 2017, 21:34
OK, I'll concede points to both sides concerning TemporalDegrain. I've had NeatVideo on board since v1.5 if you want to go back that far, but here there was no decent noise sample. Even lansing knows you don't throw NV at anything without a good noise sample. I did try it with v3.0 on my machine, but as with the O.P.'s mp4 it blurred out and smeared the fuzzy objects on the left of the image and made an unidentifiable blob of it. The capture itself is something I'd never do --what I have against capping analog to DV is that DV adds noise and buzzing edges that aren't in the source. I gave up on analog to DV back with Win98; it's just too much noise and oddball color to fool with. Rather than chop off chunks of image I'd rather use something to try to clean the edges. There are other denoisers in Avisynth, so I could have made a better choice. The main advice I'd give to the O.P. is to stop using DV for analog sources (or at least find a way to control input source levels with DV) and save yourself some work.
I don't go for the 64-bit argument, not with standard definition, because I have projects that depend on an arsenal of 32-bit filters that I won't give up, so something like PP is practically useless for restoration except for color work. PP doesn't deinterlace, IVTC, or resize worth a dam, and there are better encoders around, so what else can you do with PP except play with color? When I need complex color work and layer/blending features I use AftertEffects CS3 and ColorFinesse, which I won't give up either.
So I guess we can stop all this and play nice. There's more than one way to slay this beast. Good points, all.
This DV file comes from a Video8 Camcorder with DV-Out and I also have a Canopus ADVC-110, if I have to stop using DV to capture, what kind of hardware do I have to buy?
poisondeathray
11th September 2017, 22:08
Just tried it, it's more like a hack than an ability. It's still unusable to me because of all those steps just to make it work, and going through the steps again for every change. It'll need a rewrite on the filter chain.
That's fair enough. I don't use it either. :D But it's not *that* bad ; and definitely it's not what you said: "cannot do"
For some people , they can't or won't pay for Adobe or other software . It's nice to be aware of other options , especially if you're using vdub for other things concurrently like deshaker or neat video. And there are other free options for color manipulation like blender and natron, free resolve too.
You have a lot of hoops to go through in order to use something like premiere properly too (or even Resolve which is better than PP at color manipulation.) PP lacks in other areas that you might need vapoursynth or avisynth pre or post processing. You need a lot of workarounds for proper processing in any workflow. There isn't a single tool that can do it all
LemMotlow
12th September 2017, 14:47
What you're asking takes a lot of answering. I'll try to be brief. Others can offer more ideas.
Color balance is something I want to do, but how do you learn to correct that, how do you know it's too red?
You know it's too red by looking at it. Your sample isn't too bad. Your camera apparently saw the yellowish interior lighting and tried to strike a decent white balance by ending up somewhere in the middle between overly warm and cooler color, so it wouldn't take a quantum leap of correction to get more natural results. For example, what was really the color of the walls? Were they an overly orange white, or were they closer to just a more pale off-white? If you can get white and the child's gray clothing to look more neutral, all the colors will fall naturally into place. In this case you have clipped brights in the brightest objects and oversaturated red.
I corrected the blown-outs highlights for y=16-235 legal luma levels with this code:
Levels(16,1.0,255,16,235,dither=true,coring=false)
You can't correct bad levels later in RGB because the conversio0n to RGB will simply clip overextended YUV blacks and whites. Ideally you'd control levels during capture, which is not possible with the capture method you're using.
You have three colors to work with: Red, Green, and Blue. Here you have bright reds that are too hot, and depressed blue. The idea to correct this would be to decrease bright red and increase blue overall. Leave green alone.
If you're just starting with color correction, you have to get into basic color theory and how to manipulate the primary colors Red-Green-Blue. You'll have to help yourself by learning to work with histograms of various types. And you'll need to calibrate your monitor. Don't assume your monitor shows color and levels correctly just because it's digital. Most monitors are way off the mark out of the box when it comes to that. With an uncalibrated monitor you might make it look pretty good on one display but it won't look correct on any other display. Calibration adjusts monitor output to known universal standards. The results will look correct on a good monitor; on an off-color or cheapo monitor, that's the owner's problem, not yours.
You learn a lot about color and color controls by browsing any of hundreds of free tutorials on the internet, especially concerning Photoshop and video NLE's like Premiere Pro and AfterEffects. You don't need that software yourself, all you need are the principles of color correction that you can use with some of the Virtualdub filters mentioned and by learning to use color control functions in Avisynth. Two very useful VDub tools are ColorMill and gradation curves plus some built-ins that come with VDub. The principles are the same for still photos and video. But histograms are essential for analyzing color and levels. There are some good free tutorials at the site below. An acquaintance of mine from another forum led me to this site. It's about still photos, but the principles are the same for all color work and the site is an excellent resource:
Understanding histograms Part 1 and Part 2
http://www.cambridgeincolour.com/tutorials/histograms1.htm
http://www.cambridgeincolour.com/tutorials/histograms2.htm
You can also try Doom9's ancient but still useful capture guide. Try this page: 7.1 Postprocessing video using VirtualDub (http://foro.doom9.org/index.html?/capture/postprocessing_vdub.html). Skip all the stuff at the top and scroll halfway down this very long web page to the heading
7.1.9 Color adjustment.
Concerning the aspect ratio, I have just cropped the borders, what should I do after? Resize, add black borders?
That depends on your intended playback media. If you want DVD or standard-def BluRay output, you shoul restore the original frme size back to 720x576 by adding new black borders. Then encode for a 4:3 aspect ratio. I did this in Avisynth by cropping off unwanted areas and adding black pixels to center the image and restorenthe originl frame size without chopping any of the core image. I did this after deinteracing:
Crop(4,0,-12,-8).AddBorders(8,4,8,4)
[EDIT] Your larger sample isn't exactly like the original for some reason. For one thing, the colors look better (although brights are still clipped). The borders are different and there's more bottom-border noise. I'd fix that and center with this code after deinterlacing:
Crop(4,2,-12,-10).AddBorders(8,6,8,6)
If you want playback from some other device that can't handle anamorphic video (such as many so-called smart tv's that too stupid to play anamophic correctly), you'll have to go for square-pixel resizing:
Crop(4,0,-12,-8).AddBorders(8,4,8,4)
Spline36Resize(640,480)
Encode as mp4 for square-pixel playback.
This DV file comes from a Video8 Camcorder with DV-Out and I also have a Canopus ADVC-110, if I have to stop using DV to capture, what kind of hardware do I have to buy?Your camerra outputs lossy DV, so it can't be used if you want lossless capture from viedo8. What you'd need is a camera that plays analog vieo8 and ouputs analog video into a device optimized for lossless capture from analog source. That's a hardware problem, since the best premium hardware for that purpose stopped production years ago and work only with WinXP. There is a way around that with today's USB capture devices. But there are a lot of cheapo horrible USB devices around these days that are a waste of money, even at their low price. One possibility is Diamond Multimedia's VC500 (https://www.amazon.co.uk/Diamond-Multimedia-VC500-Capture-Device/dp/B000VM60I8), which is a decent performer sold at discounts under $50 USD. This one looks like some cheaper ripoffs, but the genuine Diamond product gives surprisingly good results. It comes with drivers for Win7, 8, 10, and XP.
Lossless capture is a different world. Most users capture to lossless AVI using lossless compression such as huffyuv, Lagarith, or UT Video. Lossslessly compressed capture of analog source comes in at ~30GB or so per hour. The capture software is usually VirtualDub or AmarecTV. The website at digitalfaq.com has a load of capture guides, many of them dated (the principles haven't changed, though), the latest update being this one for Virtualdub capture: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjjhZmI2Z_WAhUF5YMKHTiSBIcQFggmMAA&url=http%3A%2F%2Fwww.digitalfaq.com%2Fforum%2Fvideo-capture%2F7427-capturing-virtualdub-settings.html&usg=AFQjCNGOVRUbd0XcMSlK4jJX37b2s7yC7A. As you can see from that update, losssless capture isn't as automated as DV, which doesn't offer much control over the input or output.
If lossless capture seems too intimidating you can still stay with DV, but it just means extra cleanup work. A tape in fairly good condition such as your sample would be very workable, but a bad tape in poor condition means a lot of quality loss through all the required cleanup and more lossy encoding. So you'll have to make up your min about that.
LemMotlow
12th September 2017, 19:15
There's is a longer clip, if it helps. https://www.fvnet.ch/tmp/test/DV1.avi
Thanks, that's more to work with. Looks like a subtle but visible contrast change, the later portion lighter than the beginning. Not much of a problem, though. I used a script similar to the first one but removed TemporalDegrain to make everyone happy and used NeatVideo v3.6, probably not with as strong settings as the earlier post. There's still a little twitter in the carpet at the bottom of the frames.
In the deinterlaced version linked below I cleaned up a bad dropout in frames 3476-3477, a small 10-pixel comet in frames 4509-4511 in front of the child, and a thin comet in the background wall at frames 4842-4845 (those are at 1m09sec, 1m30sec, and 1m36sec respectively). In the original interlaced DV1.avi those glitches are at 1738, 2255, and 2421. For color I reduced red contrast in YUV and tweaked blue with ColorMill in Virtualdub --these were minor but visible corrections.
DV1_576p.mp4: https://www.mediafire.com/file/nndyncrc71wvraf/DV1_576p.mp4
StainlessS
12th September 2017, 22:07
Here results from GamMac, would need levels correction prior to conversion to RGB, and then calling GamMac (because of out of 16->235 YUV TV range).
https://s26.postimg.org/9ofi6xvvd/cooli.jpg (https://postimg.org/image/msl2jmnx1/)
I'm guessin that if pre-corrected, red channel would be better and not so blown out.
EDIT: Actually not much better.
Levels(16,1.0,255,16,235,dither=true,coring=false) # EDIT: This is rubbish, should have downloaded YUV clip
ConvertToRGB24.KillAudio
https://s26.postimg.org/kdt6z77o9/cooli_2.jpg (https://postimg.org/image/t8u19pwgl/)
EDIT: For Scale=2, I added this
Scale=2 BluMul=0.85 RedMul = 1.3
Results (diff only in bot right SCALE=2, window (perhaps further testing might provide better results)
https://s26.postimg.org/yzk7ng4gp/cooli_3.jpg (https://postimg.org/image/prrz6qxed/)
I did not try with clip, only the png (that was already blown by convertToRGB with bad YUV levels)
LemMotlow
12th September 2017, 23:45
Not much can be done with those levels. They were blown during capture.
lansing
12th September 2017, 23:53
You need to give us more information, like what color is the wall and the floor? And the shirt and the napkin?
LemMotlow
13th September 2017, 00:27
The baby's suit looks ike neutral gray, the bck wll an off-white, the lady's skirt brwn. That's what happens when you set a gray point on the kid's clothes. the rest just falls into place.
In any case, i seriously doubt that the kid's hair is green.
StainlessS
13th September 2017, 01:44
OK, here modded script
Have set coords to skip crap around the edges.
If no further tweaks [EDIT: After GamMac] set omin,omax to 0,255.
Suggest try either Scale=0, or scale=1, not scale=2 (flickering).
All 3 windows show SAME scale.
RedMul, GrnMul & BluMul set for A window
B_RedMulMod and B_BluMulMod affects window B relative to the A window multipliers.
C_RedMulMod and C_BluMulMod affects window C relative to the A window multipliers.
Good luck.
FN="DV1.AVI" # converted to UT_Video via ffmpeg, I dont have DV codec.
Avisource(FN)
#Histogram(mode="levels")
Levels(16,1.0,255,16,235,coring=false) # make Y in 16-?235 range
ConvertToRGB24
#return last
O=Last
DC=Last
x =8 # Coords (for dc Detection Clip) # AVOID EDGE CRAP
y =4
w=-26
h=-10
#Return GamMac(DC,x=x,y=y,w=w,h=h,Coords=True) # Show Coords only
# CHANGE these to 0,255 if no further tweaking to be done later
omin=5 # Output channels minimum (footroom for manual editing).
omax=250 # Output channels maximum (headroom for manual editing).
Scale=1 # USE EITHER 0 or 1, 2 defo causes flickering DONT USE, AFFECTS ALL 3 OUTPUT WINDOWS
####################################################
####################################################
####################################################
# A window mods,
RedMul = 1.30 # Required Ave multiplier for Red Channel, applied when requesting GuessGamma(reqAve*RedMul), Even applied when LockChan=-1.
GrnMul = 1.0 # Same for Green channel. GrnMul even applies when LockChan is Green Channel, etc for chans.
BluMul = 0.90 # Same for Blue channel. Allows tinkering/fine tuning.
# B Window Mods Relative to A window Redmul and GrnMul
B_RedMulRel=0.05
B_BluMulRel=0.0
# C Window Mods Relative to A window Redmul and GrnMul
C_RedMulRel=0.0
C_BluMulRel=0.05
####################################################
####################################################
####################################################
###########
LockChan = 1 # Suggest not change
Th = 0.0
LockVal = 128.0 # Only valid if LockChan == -1
RngLim = 11
GamMax = 10.0
Show = True # Metrics
Verb = 5 # Verbocity FULL
SHOWCOORDS= True # Show Original with Coords
DITHER=FALSE
A_TEXT = RT_String("Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul,GrnMul,BluMul)
A=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)
B_TEXT = RT_String("B Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul+B_RedMulRel,GrnMul,BluMul+B_BluMulRel)
B=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul+B_RedMulRel,GrnMul=GrnMul,BluMul=BluMul+B_BluMulRel,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)
C_TEXT = RT_String("C Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul+C_RedMulRel,GrnMul,BluMul+C_BluMulRel)
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul+C_RedMulRel,GrnMul=GrnMul,BluMul=BluMul+C_BluMulRel,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)
COORDS=O.GamMac(dc=DC,x=x,y=y,w=w,h=h,Coords=True)
ODC=((SHOWCOORDS)?COORDS.Spline36Resize(width,Height):O) # Resize COORDS (Not necessarily the same sizse as source clip)
ODC_TEXT=(SHOWCOORDS)?"Detect Clip with Coords":"Original"
TOP=StackHorizontal(Sub(ODC,ODC_TEXT,true),Sub(A,A_TEXT))
BOT=StackHorizontal(Sub(B,B_TEXT),Sub(C,C_TEXT))
StackVertical(TOP,BOT)
return Last
# Stack Overhead Subtitle Text, with optional FrameNumber shown
Function Sub(clip c,string Tit,Bool "ShowFrameNo",int "first_frame", int "last_frame",string "font",float "size",int "text_color",
\ int "halo_color",int "align",int "spc",float "font_width",float "font_angle") {
/* http://forum.doom9.org/showthread.php?p=1813402#post1813402
Title bar is Round(size+2) pixels hi (default 20).
Dont use align=4,5,6, better use 1,2,3,7,8,or 9.
*/
ShowFrameNo=Default(ShowFrameNo,False)
first_frame=Default(first_frame,0) last_frame=Default(last_frame,c.FrameCount-1)
font=default(font,"Ariel") size=Default(size,18.0)
text_color=Default(text_color,$00FFFF00) halo_color=Default(halo_color,$00000000)
align=default(align,7) spc=Default(spc,0)
font_width=Default(font_width,0) font_angle=Default(font_angle,0.0)
c.BlankClip(height=round(size+2.0))
NSFN=(!ShowFrameNo) ? "" : RT_String(""" %s"),first_frame=%d,last_frame=%d,font="%s",size=%.3f,text_color=$%X,halo_color=$%X,
\ align=%d,spc=%d,font_width=%.3f,font_angle=%.3f)""",
\ Tit,first_frame,last_frame,font,size,text_color,halo_color,align,spc,font_width,font_angle)
(ShowFrameNo)
\ ? ScriptClip("""Subtitle(String(current_frame,"%.f]"""+NSFN)
\ : Subtitle(Tit,first_frame=first_frame,last_frame=last_frame,font=font,size=size,text_color=text_color,
\ halo_color=halo_color,align=align,spc=spc,font_width=font_width,font_angle=font_angle)
Return StackVertical(c).AudioDubEx(c)
}
https://s26.postimg.org/jn9pqnc8p/cooli_4.jpg (https://postimg.org/image/3p100ii0l/)
EDIT: I have not tried to get best color, my concern was to make script more usable for the OP.
RedMul=1.3 and BluMul=0.9, were simply my first guess.
EDIT: Can use Scale=2, IF you set Th non 0.0 (maybe something like 0.01). Think flickering down to noisey pixel extremes.
EDIT: On 2nd thoughts, as starting points
DC=Last.Blur(1.0,1.0)
Scale=1 # or 2
RedMul = 1.2
GrnMul = 1.0
BluMul = 1.0
# B Window Mods Relative to A window Redmul and GrnMul
B_RedMulRel= -0.025
B_BluMulRel= 0.025
# C Window Mods Relative to A window Redmul and GrnMul
C_RedMulRel= 0.025
C_BluMulRel=--0.025
LockChan = 1 # can try -2 or -3
Th = 0.01
https://s26.postimg.org/nc8lhm115/cooli_5.jpg (https://postimg.org/image/o1rdtz1kl/)
LemMotlow
13th September 2017, 02:27
Frame 1857 from DV1_576p.mp4, in post #17, made with pixel readings off light and dark gray clothing areas for gray-point reckoning.
If you know what gray looks like, it's a pretty good start.
https://www.mediafire.com/file/nb886wnxtv7wmb5/F%201867%20from%20DV1_576p_mp4.jpg
F 1857 from DV1_576p.mp4.jpg (https://www.mediafire.com/file/nb886wnxtv7wmb5/F%201867%20from%20DV1_576p_mp4.jpg)
I gave up on trusting GamMac. 90% of the time it gave me almost or near what I started with, which is pretty much what I'm seeing in the photos posted. But I keep trying with it.
lansing
13th September 2017, 08:03
The original idea of GamMac was to apply average luma on the RGB channel so the picture has better contrast, it has very little to do with correcting color cast, as you can see from the original (https://forum.doom9.org/showthread.php?t=173683) (the 3rd image). The color correction part came from tweaking of hue, which has nothing to do with function. We can further see proofs from all the images in the top post of GamMac thread (https://forum.doom9.org/showthread.php?t=173695), all the shadows were obviously wrong.
LemMotlow
13th September 2017, 09:24
Everythjing can be reduced to numbers. Eyes are obsolete.
LemMotlow
14th September 2017, 09:34
The original idea of GamMac was to apply average luma on the RGB channel so the picture has better contrast, it has very little to do with correcting color cast
If that's the case, I guess I should have ignored the statement "useful to correct color cast", which appears right after the start of Stainless' thread on GamMac,
Start Of GamMac Thread.png (https://www.mediafire.com/file/dv2twbvi7tj9js8/Start%20Of%20GamMac%20Thread.png)
https://www.mediafire.com/file/dv2twbvi7tj9js8/Start%20Of%20GamMac%20Thread.png
and which led me down the wrong path completely and wasted hours if not days of my time. Had I known from the start that GamMac is only a guide to correcting image contrast, and isn't really useful for correcting color, I could have saved myself a lot of the trouble of trying to use it.
videoFred
14th September 2017, 11:00
The original idea of GamMac was to apply average luma on the RGB channel so the picture has better contrast, it has very little to do with correcting color cast
You must have missed my example pictures.
Fred.
videoFred
14th September 2017, 11:12
and which led me down the wrong path completely and wasted hours if not days of my time. Had I known from the start that GamMac is only a guide to correcting image contrast, and isn't really useful for correcting color, I could have saved myself a lot of the trouble of trying to use it.
I am very sorry to hear this LemMotlow :(
I can only say it works almost perfect on 8mm film capturings. On those files it removes blue, red, green, whatever colorcast very well as you can see on my examples in the GamMac thread.
I advise to use AvsPmod and make sliders for all GamMac settings. Then, make a before/after screen with stackhorizontal() and Histograms on both pictures. Then you can examine in detail what GamMac does.
Fred.
LemMotlow
14th September 2017, 11:49
Ah. So you're saying that no one should be using the conventional color grading tools that pros have been using for decades and painters have used for centuries.
I don't go for it. I don't trust numbers any more than I trust politicians.
Anyway, my post was a reply to a previous remark that GamMc isn't designed for color correction and is designed only for contrast correction. I definitely can't agree with that.
videoFred
14th September 2017, 12:15
Ah. So you're saying that no one should be using the conventional color grading tools that pros have been using for decades and painters have used for centuries.
I am not saying that. I'm only saying that GamMac is the perfect tool for my (very specific)purpose.
PS: English is not my native langue, perhaps I am missing sometimes what people realy want to say.
Fred.
johnmeyer
14th September 2017, 18:40
Ah. So you're saying that no one should be using the conventional color grading tools that pros have been using for decades and painters have used for centuries.
I don't go for it. I don't trust numbers any more than I trust politicians.
Anyway, my post was a reply to a previous remark that GamMc isn't designed for color correction and is designed only for contrast correction. I definitely can't agree with that.You're just being difficult. You also obviously don't have to do things, under deadline, for clients. I also can tell by the words you use that you actually are not in this business. A true film person would use the phrase "color timing" or at least "color grading."
Whatever you call it, getting the color right, and making one scene match the next is extraordinarily time consuming when done manually. Yes, like painters, who have skill that I don't possess -- and neither do most people -- manually correcting color can produce amazing results. For the rest of us, who have a life outside of correcting color, the automated tools are a godsend.
lansing
15th September 2017, 03:33
You must have missed my example pictures.
Fred.
I just did a thorough test on the filter today, it did indeed remove color cast very close to photoshop's auto color correction option using "dark and light color". It somehow doesn't need a midtone, don't know why. The only time it'll fail is when there's color cast only on the top half range on the picture, such as old anime.
LemMotlow
15th September 2017, 04:02
You're just being difficult. You also obviously don't have to do things, under deadline, for clients. I also can tell by the words you use that you actually are not in this business. A true film person would use the phrase "color timing" or at least "color grading."
Whatever you call it, getting the color right, and making one scene match the next is extraordinarily time consuming when done manually. Yes, like painters, who have skill that I don't possess -- and neither do most people -- manually correcting color can produce amazing results. For the rest of us, who have a life outside of correcting color, the automated tools are a godsend.Really admire your expertise, john, but I know very well what color timing and color grading mean and have known it for many years. I don't normally use those terms because I know that the average user isn't doing any color cleanup, never has, never will, and will never learn how. The importance of color grading is totally lost on them. Their standard of ultimate video quality is YouTube and will never go beyond it. Throwing automated tools at them is like throwing napalm on a backyard barbeque. As for myself, I learned about color grading when I got my B.A. in TV/Film production a long time ago.
johnmeyer
15th September 2017, 05:44
As for myself, I learned about color grading when I got my B.A. in TV/Film production a long time ago.Well then, you most definitely know what you are doing. My only point was the one about the time it takes to color grade film, especially amateur film.
There are so many problems with amateur film that professionals don't need to deal with: consumer stocks were not as good as pro stocks (Kodak had a completely different line of emulsions for pros); consumer film colors fade over time (except for Kodachrome); most film prior to Super 8 was exposed in a camera that only had manual exposure controls, and most people did not own an exposure meter. So they just set the controls based on the instructions with the film ("use f5.6 for overcast days; f11 for bright sunny days; etc.).
The developing was also all over the place. Kodak was pretty good with their Kodachrome (although they lost the recipe for a few years in the mid-1970s). All other emulsions, including Ektachrome and other Kodak emulsions, were often screwed up during processing.
The lenses in amateur cameras were pretty awful. Sophisticated coatings and computer-designed lenses didn't start appearing until the 1990s, a quarter century after most 8mm and Super 8 was taken.
The point is that amateur film's color is not only awful, but it usually changes from scene to scene. The rule of thumb was five seconds per scene (because film was so expensive). That's 10-12 scenes per minute. In a twenty minute 400' reel, that's over 200 scenes, many of which have to be graded individually. I've done that work, and it produces great results, but you can't get people to pay you for that time, so you have to come up with another alternative. I have dozens of Vegas (my NLE) scripts as well as AVISynth scripts that help.
VideoFred has managed to make GamMac do pretty decent gamma as well as color correction. I've seen the results. I haven't yet been able to duplicate his results, but I am working on getting up to speed with his "secret" which is to overlay a small box which contains an average of all colors in order to keep GamMac from "going off into the weeds" (technical explanation ...). I hope to get that working tomorrow, now that I'm almost finished with my current set of transfers. Since both my transfer computer and the Firewire on my transfer camera (my trusty FX1) bit the dust earlier this week, I'll have a month or more without any film transfers, so I should have time to work on this.
cooli
15th September 2017, 10:09
Hello,
Thanks four your help, I'm trying to use GamMac but x64
version 1.09, since there's no dither argument in this version
can I just remove (dither=DITHER) from the script?
OK, here modded script
Have set coords to skip crap around the edges.
If no further tweaks [EDIT: After GamMac] set omin,omax to 0,255.
Suggest try either Scale=0, or scale=1, not scale=2 (flickering).
All 3 windows show SAME scale.
RedMul, GrnMul & BluMul set for A window
B_RedMulMod and B_BluMulMod affects window B relative to the A window multipliers.
C_RedMulMod and C_BluMulMod affects window C relative to the A window multipliers.
Good luck.
FN="DV1.AVI" # converted to UT_Video via ffmpeg, I dont have DV codec.
Avisource(FN)
#Histogram(mode="levels")
Levels(16,1.0,255,16,235,coring=false) # make Y in 16-?235 range
ConvertToRGB24
#return last
O=Last
DC=Last
x =8 # Coords (for dc Detection Clip) # AVOID EDGE CRAP
y =4
w=-26
h=-10
#Return GamMac(DC,x=x,y=y,w=w,h=h,Coords=True) # Show Coords only
# CHANGE these to 0,255 if no further tweaking to be done later
omin=5 # Output channels minimum (footroom for manual editing).
omax=250 # Output channels maximum (headroom for manual editing).
Scale=1 # USE EITHER 0 or 1, 2 defo causes flickering DONT USE, AFFECTS ALL 3 OUTPUT WINDOWS
####################################################
####################################################
####################################################
# A window mods,
RedMul = 1.30 # Required Ave multiplier for Red Channel, applied when requesting GuessGamma(reqAve*RedMul), Even applied when LockChan=-1.
GrnMul = 1.0 # Same for Green channel. GrnMul even applies when LockChan is Green Channel, etc for chans.
BluMul = 0.90 # Same for Blue channel. Allows tinkering/fine tuning.
# B Window Mods Relative to A window Redmul and GrnMul
B_RedMulRel=0.05
B_BluMulRel=0.0
# C Window Mods Relative to A window Redmul and GrnMul
C_RedMulRel=0.0
C_BluMulRel=0.05
####################################################
####################################################
####################################################
###########
LockChan = 1 # Suggest not change
Th = 0.0
LockVal = 128.0 # Only valid if LockChan == -1
RngLim = 11
GamMax = 10.0
Show = True # Metrics
Verb = 5 # Verbocity FULL
SHOWCOORDS= True # Show Original with Coords
DITHER=FALSE
A_TEXT = RT_String("Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul,GrnMul,BluMul)
A=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)
B_TEXT = RT_String("B Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul+B_RedMulRel,GrnMul,BluMul+B_BluMulRel)
B=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul+B_RedMulRel,GrnMul=GrnMul,BluMul=BluMul+B_BluMulRel,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)
C_TEXT = RT_String("C Scale=%d rMul=%.2f gMul=%.2f bMul=%.2f",Scale,RedMul+C_RedMulRel,GrnMul,BluMul+C_BluMulRel)
C=GamMac(LockChan=LockChan,SCALE=SCALE,RedMul=RedMul+C_RedMulRel,GrnMul=GrnMul,BluMul=BluMul+C_BluMulRel,
\ Th=Th,LockVal=LockVal,RngLim=RngLim,GamMax=GamMax,
\ dc=DC,
\ x=x,y=y,w=w,h=h,
\ omin=omin,omax=omax,
\ Show=Show,Verbosity=Verb,dither=DITHER)
COORDS=O.GamMac(dc=DC,x=x,y=y,w=w,h=h,Coords=True)
ODC=((SHOWCOORDS)?COORDS.Spline36Resize(width,Height):O) # Resize COORDS (Not necessarily the same sizse as source clip)
ODC_TEXT=(SHOWCOORDS)?"Detect Clip with Coords":"Original"
TOP=StackHorizontal(Sub(ODC,ODC_TEXT,true),Sub(A,A_TEXT))
BOT=StackHorizontal(Sub(B,B_TEXT),Sub(C,C_TEXT))
StackVertical(TOP,BOT)
return Last
# Stack Overhead Subtitle Text, with optional FrameNumber shown
Function Sub(clip c,string Tit,Bool "ShowFrameNo",int "first_frame", int "last_frame",string "font",float "size",int "text_color",
\ int "halo_color",int "align",int "spc",float "font_width",float "font_angle") {
/* http://forum.doom9.org/showthread.php?p=1813402#post1813402
Title bar is Round(size+2) pixels hi (default 20).
Dont use align=4,5,6, better use 1,2,3,7,8,or 9.
*/
ShowFrameNo=Default(ShowFrameNo,False)
first_frame=Default(first_frame,0) last_frame=Default(last_frame,c.FrameCount-1)
font=default(font,"Ariel") size=Default(size,18.0)
text_color=Default(text_color,$00FFFF00) halo_color=Default(halo_color,$00000000)
align=default(align,7) spc=Default(spc,0)
font_width=Default(font_width,0) font_angle=Default(font_angle,0.0)
c.BlankClip(height=round(size+2.0))
NSFN=(!ShowFrameNo) ? "" : RT_String(""" %s"),first_frame=%d,last_frame=%d,font="%s",size=%.3f,text_color=$%X,halo_color=$%X,
\ align=%d,spc=%d,font_width=%.3f,font_angle=%.3f)""",
\ Tit,first_frame,last_frame,font,size,text_color,halo_color,align,spc,font_width,font_angle)
(ShowFrameNo)
\ ? ScriptClip("""Subtitle(String(current_frame,"%.f]"""+NSFN)
\ : Subtitle(Tit,first_frame=first_frame,last_frame=last_frame,font=font,size=size,text_color=text_color,
\ halo_color=halo_color,align=align,spc=spc,font_width=font_width,font_angle=font_angle)
Return StackVertical(c).AudioDubEx(c)
}
https://s26.postimg.org/jn9pqnc8p/cooli_4.jpg (https://postimg.org/image/3p100ii0l/)
EDIT: I have not tried to get best color, my concern was to make script more usable for the OP.
RedMul=1.3 and BluMul=0.9, were simply my first guess.
EDIT: Can use Scale=2, IF you set Th non 0.0 (maybe something like 0.01). Think flickering down to noisey pixel extremes.
EDIT: On 2nd thoughts, as starting points
DC=Last.Blur(1.0,1.0)
Scale=1 # or 2
RedMul = 1.2
GrnMul = 1.0
BluMul = 1.0
# B Window Mods Relative to A window Redmul and GrnMul
B_RedMulRel= -0.025
B_BluMulRel= 0.025
# C Window Mods Relative to A window Redmul and GrnMul
C_RedMulRel= 0.025
C_BluMulRel=--0.025
LockChan = 1 # can try -2 or -3
Th = 0.01
https://s26.postimg.org/nc8lhm115/cooli_5.jpg (https://postimg.org/image/o1rdtz1kl/)
Groucho2004
15th September 2017, 10:22
Hello,
Thanks four your help, I'm trying to use GamMac but x64
version 1.09, since there's no dither argument in this version
can I just remove (dither=DITHER) from the script?
I see now that there is a 1.10 Beta of GamMac. Here (https://www.dropbox.com/s/g0e7tvxu50vihad/GamMac64_110Beta.7z?dl=0) is a 64 bit build.
StainlessS
16th September 2017, 02:19
Oh, cheers G2K4.
cooli
25th September 2017, 09:47
The green bar is back :-(
https://www.fvnet.ch/tmp/test/border2.jpg
https://www.fvnet.ch/tmp/test/DV2.avi
Groucho2004
25th September 2017, 10:25
The green bar is back :-(
You already posted this here (http://forum.doom9.org/showthread.php?p=1819488#post1819488). Please don't double post.
Katie Boundary
30th September 2017, 04:04
Need some advice
Here's some advice: never buy store-brand disposable razors. They're already dull right out of the factory.
Next time, post a more descriptive title.
cooli
3rd October 2017, 14:34
You already posted this here (http://forum.doom9.org/showthread.php?p=1819488#post1819488). Please don't double post.
Sorry removed the other post.
LemMotlow
3rd October 2017, 16:02
The green bar is back :-(
https://www.fvnet.ch/tmp/test/border2.jpg
https://www.fvnet.ch/tmp/test/DV2.aviMembers have already posted suggestions about how to handle edge stains in post #2 and other posts. There's more than one way to handle it. But your sample has been processed to RGB, highlights are still blown to hell, and converting to RGB kills any effort to correct brights or other problems. If you expect to work restoration and repair on a video, you're shooting yourself in the foot by capturing to a lossy DV codec in the first place.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.