VideoHelp Forum
+ Reply to Thread
Results 1 to 28 of 28
Thread
  1. Here's a short sample mpeg2. This was from a VHS-to-DVD conversion of a program recorded off TV which I demuxed from the DVD. I don't have the original video this is all I have.

    The brightness levels change every several seconds. Is there any way I can fix it so that it's all the same brightness?

    Also the video stutters a bit. Is there any way to fix that? (probably not but there's no harm in asking).
    Quote Quote  
  2. RE: brightness levels shifts

    You just manually correct sections , use trim to join them. Or if there are a lot of sections , but the changes are the same, use remapframes

    I don't know if there is an "automatic" way to do it that gets it fairly accurate (the automatic fixes will usually be off a bit)

    Use histogram() to match the waveform to see how to adjust tweak and levels

    e.g for this sample , frames 240-327 shift "darker"

    Code:
    main=MPEG2Source("Raw 2001 Dec 10 stutter & brightness changing.d2v", cpu=0)
    
    #240-327
    main
    tweak(cont=1.3, coring=false)
    levels(17,1.15,255,0,255,false)
    filtered=last
    
    main.trim(0,239) ++ filtered.trim(240,327) ++ main.trim(328,0)
    
    #histogram
    Last edited by poisondeathray; 12th Oct 2012 at 11:14.
    Quote Quote  
  3. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I saw some very slight stutter in Windows Media Player, but not in VLC Player with de-interlace turned on. AutoLevels() in Avisynth had trouble with the brightness changes, but VDub's Autolevels plugin cleared the level changes completely, 100%. But VDub is working in RGB: that made me wonder if the original's YV12 colorspace is messed up somehow. Vdub had no level fix problems, even with the bad noise.

    When it came time to encode a new MPEG, neither TMPGenc Plus nor HCenc could handle the godawful interlace and low-bitrate artifacts. Re-encoding with no denoising prep work accentuated the noise. The original bitrate (around 5000) is simply too low for fast-action video like this. Without some heavy duty cleaning before re-encode, the artifacts look really bad. I'd go to QTGMC to clean it up but I didn't have time.
    Last edited by sanlyn; 23rd Mar 2014 at 11:57.
    Quote Quote  
  4. Which autolevels plugin for vdub, sanlyn ? The one I have is "EOD Auto Levels 1.2" . It seems to do something funky with the saturation - is there another plugin or what settings did you use ?
    Quote Quote  
  5. I already use CPU=6 to deblock and McTemporalDenoise and QGTMC to clean up (however I keep the video interlaced). Are those not enough to clean this video? If not, what script would you suggest?

    I would also be interested to know what auto levels plugin and script you used if that can automatically fix the brightness levels so the whole video is the same brightness.

    I guess the stutter was my imagination as it only appeared in my video editor and not in my DVD player.
    Quote Quote  
  6. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    I used EODal12 from http://eodvdf.narod.ru/ . The filter has several settings to modify its effects. Under "General Settings" at the top of the filter's configuration window, I set "Bright" to 10, "Dark" to 20. The other settings were unchanged. I ran the plugin in VirtualDub after trying some cleanup in AVisynth. The plugin doesn't work correctly with other filters preceding it. In VirtualDub, it has to be eitehr the only plugin loaded or has to be the top plugin if you chain filters beneath it.

    The original has black levels set too high; it's somewhat under-saturated and a bit too green.

    All autogain filters require some fiddling, including the Avisynth plugin. The AutoLevels .dll fixed levels but "blinked" several times and blew out highlights. I rarely use autofilters of any kind. They almost never behave the way you want. And when I did use them I had a hell of a time following them with other color and level adjustments to keep values within standard specs and, usually, to tweak the auto corrections. The VDub's plugin does has more useable adjustments IMO. But it depends on the individual video.

    I wanted to try more cleanup but will have to wait until later today after I repair a client's PC.
    Last edited by sanlyn; 23rd Mar 2014 at 11:57.
    Quote Quote  
  7. I don't use VirtualDub. Could you please provide a script I could use with HCEncoder with regards to the brightness fixing.
    Quote Quote  
  8. Originally Posted by sanlyn View Post
    I used EODal12 from http://eodvdf.narod.ru/ . The filter has several settings to modify its effects. Under "General Settings" at the top of the filter's configuration window, I set "Bright" to 10, "Dark" to 20. The other settings were unchanged. I ran the plugin in VirtualDub after trying some cleanup in AVisynth. The plugin doesn't work correctly with other filters preceding it. In VirtualDub, it has to be eitehr the only plugin loaded or has to be the top plugin if you chain filters beneath it.
    That's weird , I don't seem have those options. It's the same filter as in that link. I redownloaded it to make sure

    It shows up as AutoLevels v1.2 and the only adjustments are intensity and mode . If I use custom-static mode, you can access bright and dark cut , but it doesn't really work like it's supposed to
    Quote Quote  
  9. ColorYUV(autogain=true)
    Quote Quote  
  10. Awesome thanks, it works although there is still a slight brightness change in another video I have. I also looked at this page http://www.thebattles.net/video/autolevels.html which says that ColorYUV(autogain=true) isn't always perfect. Should I use autolevels instead. If so, what script should I use?
    Last edited by VideoFanatic; 12th Oct 2012 at 13:38.
    Quote Quote  
  11. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Autogain is definitely not perfect. Autowhite has similar problems. They tend to stretch the histogram too much at extremes. I think I successfully used it on only 1 occasion, and I needed ColorYUV() and SmoothLevels() in heavy doses to clean the imperfections. The Autolevels() .dll blinked a bit and did some strange things with gamma; it wasn't exactly steady and seemed to react slowly, even though I adjusted some of its parameters. I suppose I could have spent more time with it, but I was getting frustrated -- a repeat of my earlier experiences with that .dll.

    I took more looks at the VDub results. Okay, it works 100% for most of its run, but around frame 250 and a few frames after you see a color change, so I'll grade VDub a "B" on this instead of an "A". If you look at the dark blip with an RGB histogram you'll see that it isn't just luma that changes; the color channels all change as well. I suppose if you didn't expect the blip to appear you probably wouldn't notice the gradual cyan on the white deck; in the next scene change the deck looks white again, but its color changes a time or two thru the clip elsewhere-- so maybe it's arena lighting doing it. All those flashes going off don't help auto filters at all. I'm surprised that any of them can cope with those flashes.

    I'm on my client's PC now (at least I got his internet working again after a TDSS trojan). I'll play more later.
    Last edited by sanlyn; 23rd Mar 2014 at 11:57.
    Quote Quote  
  12. Originally Posted by jagabo View Post
    ColorYUV(autogain=true)

    nice, it works for this one
    Quote Quote  
  13. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Right, poisondeathray, I was going to wait until I got home from this PC repair job to try that one. I've been a bad boy here, I installed Avisynth and VirtualDub on the client's PC and tried autogain. Works a little better, but it's blowing out the brights. A little ColorYUV or SmoothLevels after it could fix that problem. That's a surprise: autogain usually gives me a much tougher go of it. As I said, it depends on the specific video.

    I'd try autogain and tweak it before running other cleanup. Have to wait until I get home, though. I'd better get rid of Avisynth and VirtualDub on this machine, and get outta here.
    Last edited by sanlyn; 23rd Mar 2014 at 11:57.
    Quote Quote  
  14. Originally Posted by sanlyn View Post
    I've been a bad boy here, I installed Avisynth and VirtualDub on the client's PC and tried autogain.
    hahaha remind me not to get you to fix my computers


    That's a surprise: autogain usually gives me a much tougher go of it. As I said, it depends on the specific video.
    I agree, "auto" anything usually produces mediocre results . Definitely suprised, but it beats the hell out of manually correcting sections
    Quote Quote  
  15. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    ColorYUV autogain worked better thn I've seen it. Wrestling arena lighting is generally pretty even across time, but it's anyone's guess autogain will do if the cameras switches to a darker audience shot. I had just enough time to run QTGMC, autogain, awarpsharp for some of the chroma bleed, then fed the clip to ColorMill and a shot of medium-octane NeatVideo. I couldn't quite get all the motion smear cleaned (no thanks to the low bitrate of the original DVD) and wth more time I might dig up ways to get somewhat cleaner edges. A bitrate of 5000 is just not enough to handle tape noise, camera pans over crowd detail, and fast motion all at the same time. That low bitrate was a killer. I targeted 6400 VBR in HCenc. A retail DVD would have gone even higher.

    The "v2" version below is interlaced. "v5" is progressive. The interlaced version would likely look more like the v5 progressive on TV. I'll need a little time to get the messy script together and post a little later.
    Last edited by sanlyn; 23rd Mar 2014 at 11:58.
    Quote Quote  
  16. Ok thanks. You don't need to worry about low bitrates, I'm putting the episodes on Bluray so you can use as high a bitrate as you want to keep all the quality. The brightness issue is a priority for me at the moment. I can fix the other stuff later.
    Quote Quote  
  17. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    You can't reinvent data that's gone. The original has the low bitrate. A higher bitrate on a new encode will at least keep things from getting worse. On the original DVD, the crime has already been committed. All that can be done now is to clean it up as well as possible without filtering the poor thing to death, then reencoding at a suitable bitrate to protect the work and time invested in cleaning it up.
    Last edited by sanlyn; 23rd Mar 2014 at 11:58.
    Quote Quote  
  18. I know, I just meant that you can use whatever bitrate you want to allow the filters to do their job without causing artifacts due to a low target bitrate. You said you were going to work on it some more but I was just wondering if you fixed the brightness issue yet?
    Quote Quote  
  19. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Yep. There are two mpg samples posted earlier in #15, above. The script for Step 1 is below. I saved the results of Step1.avs as RGB32 for Step 2, which was NeatVideo run alone. I saved the NeatVideo Step2 as Lagarith/YV12 for HCenc encoding. The results of HCenc went to TMPGenc MPEG Editor for joining the original AC3 audio to the MPG.

    Avisynth plugins (step1 script): DeGrainMedian, QTGMC, ChromaShift, aWarpSharp, SangNom
    VirtualDub plugins (step1 script): ColorMill, Hue/aturation/Intensi9ty (Hue.vdf), FlaXen VHS plugin (fxvhs.vdf)
    NeatVideo noise profile and filter profile: step2_NV.dnp, step2_NV.nfp

    Code:
    # ---------------- STEP 1 -------------------
    # --- change the path and video filename  ---
    # ---         to match your setup         ---
    # -------------------------------------------
    vpath="E:\forum\stutter\"
    ppath="D:\AviSynth 2.5\plugins\"
    vdpath="D:\VirtualDub\plugins\"
    Import(ppath+"QTGMC-3.32.avs")
    LoadVirtualDubPlugin(vdPath+"ColorMill.vdf","colormill",1)
    LoadVirtualDubPlugin(vdPath+"Hue.vdf","HSI",1)
    LoadVirtualDubPlugin(vdPath+"fxvhs.vdf","VHS",1)
    
    MPEG2Source(vpath+"Raw 2001 Dec 10.d2v")
    
    AssumeTFF().SeparateFields()
    DeGrainMedian(limitY=5,limitUV=5,mode=3)
    ChromaShift(C=2)
    Weave()
    
    Crop(14,0,-4,-8)
    ColorYUV(autogain=true)
    AddBorders(8,4,10,4)
    ColorYUV(cont_y=-25,off_y=-5)
    ColorYUV(cont_v=-5)
    
    QTGMC(preset="slow")
    mergechroma(aWarpSharp(depth=20,thresh=0.75,blurlevel=3, cm=1))
    sangnom()
    ColorYUV(off_y=-5)
    # ----------------------------------------
    # Use "SelectEven() for progressive output
    # ----------------------------------------
    #SelectEven()
    AssumeTff().SeparateFields().SelectEvery(4,0,3).Weave()
    
    ConvertToRGB32(matrix="Rec601",interlaced=true)
    ColorMill(25700, 27748, 25696, 25700, 27236, 25735, 27499, 22379, 22359, 25700, 25700, 25700, 25700, 1124, 6149)
    HSI(0, 1, -6, 0, 9)
    VHS(0, 5, 30, 15, 5, 10, 1, 0, 0, 0, 15, 0, -1, -2, 1, 1)
    return last
    # ---- save as RGB32 for VirtualDub/NeatVideo --------
    Some people run NeatVideo inside Avisynth, but most do not. It's a hassle to make changes that way. It also slows a script more than necessary. NeatVideo runs much faster by itself. On my 3.5 GHz it runs about 10 or 12 fps.
    Last edited by sanlyn; 23rd Mar 2014 at 11:58. Reason: script correction
    Quote Quote  
  20. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by sanlyn View Post
    I used EODal12 from http://eodvdf.narod.ru/ . The filter has several settings to modify its effects. Under "General Settings" at the top of the filter's configuration window, I set "Bright" to 10, "Dark" to 20. The other settings were unchanged. I ran the plugin in VirtualDub after trying some cleanup in AVisynth. The plugin doesn't work correctly with other filters preceding it. In VirtualDub, it has to be eitehr the only plugin loaded or has to be the top plugin if you chain filters beneath it.
    That's weird , I don't seem have those options. It's the same filter as in that link. I redownloaded it to make sure

    It shows up as AutoLevels v1.2 and the only adjustments are intensity and mode . If I use custom-static mode, you can access bright and dark cut , but it doesn't really work like it's supposed to
    Yes. That is weird. Sorry, I don't know how missed this post. I just noted, the link gets a vdf dated May 2008. But I'm using AutoLevels.vdf dated 2002. Also came with a text file. Lemme take a look on the 'net and see what happened to 2002.
    Last edited by sanlyn; 23rd Mar 2014 at 11:59.
    Quote Quote  
  21. I'm getting this error: SeparateFields should be applied on frame-based material: use AssumeFrameBased() beforehand
    . It's giving an error on this line: AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
    I don't understand that as I thought QGTMC makes it progressive and I need that line to make it interlaced again so why's it giving that error? This is my script:

    Code:
    vpath="L:\2 = New\Raw 2001 Dec 10 stutter & brightness changing.d2v"
    ppath="C:\Program Files\AviSynth 2.5\plugins"
    vdpath="C:\Program Files\AviSynth 2.5\plugins"
    Import("C:\Program Files\AviSynth 2.5\plugins\QTGMC-3.32.avsi")
    LoadVirtualDubPlugin("C:\Program Files\AviSynth 2.5\plugins\ColorMill.vdf","colormill",1)
    LoadVirtualDubPlugin("C:\Program Files\AviSynth 2.5\plugins\Hue.vdf","HSI",1)
    LoadVirtualDubPlugin("C:\Program Files\AviSynth 2.5\plugins\fxvhs.vdf","VHS",1)
    
    MPEG2Source("L:\2 = New\Raw 2001 Dec 10 stutter & brightness changing.d2v")
    
    AssumeTFF().SeparateFields()
    DeGrainMedian(limitY=5,limitUV=5,mode=3)
    Weave()
    
    Crop(14,0,-4,-8)
    ColorYUV(autogain=true)
    ColorYUV(cont_y=-25,off_y=-9)
    ColorYUV(cont_v=-5)
    ChromaShift(C=2)
    AddBorders(8,4,10,4)
    
    QTGMC(preset="slow")
    mergechroma(aWarpSharp(depth=20,thresh=0.75,blurlevel=3, cm=1))
    sangnom()
    
    AssumeTFF().SeparateFields().SelectEvery(4,0,3).Weave()
    
    ConvertToRGB32(matrix="Rec601",interlaced=true)
    ColorMill(25700, 27748, 25696, 25700, 27236, 25735, 27499, 22379, 22359, 25700, 25700, 25700, 25700, 1124, 6149)
    HSI(0, 1, -6, 0, 9)
    VHS(0, 5, 30, 15, 5, 10, 1, 0, 0, 0, 15, 0, -1, -2, 1, 1)
    return last
    # ---- save as RGB32 for VirtualDub/NeatVideo --------
    Quote Quote  
  22. Originally Posted by sanlyn View Post
    The 2002 version and text file are attached. The 2002 version doesn't show up as "1.2" in VDub's filter list, and the .vcf entries for the two versions don't look alike.
    Thanks, you never know when certain filters can come in handy
    Quote Quote  
  23. Originally Posted by holygamer View Post
    I'm getting this error: SeparateFields should be applied on frame-based material: use AssumeFrameBased() beforehand
    Just do what it says.
    Quote Quote  
  24. Ok its just I thought that Sanly's interlaced sample he made was with the script he gave me and that code you mentioned isn't in the sample script he gave me. So I was wondering how it worked for him.
    Quote Quote  
  25. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Originally Posted by holygamer View Post
    I'm getting this error: SeparateFields should be applied on frame-based material: use AssumeFrameBased() beforehand
    . It's giving an error on this line: AssumeTFF().SeparateFields().SelectEvery(4,0,3).We ave()
    I don't understand that as I thought QGTMC makes it progressive and I need that line to make it interlaced again so why's it giving that error? This is my script:
    I've been staring at your script for 15 minutes. Except for pathnames and that sort of thing, I see no difference between your script, the one I posted earlier, the one in the zip file posted earlier, and the three copies I just now ran on my computer (1 copy made from your post, 1 copy of the original that's still on my PC, and 1 copy downloaded from the .zip file I posted earlier). I don't get that message.

    Try running it without sangnom(). Bypass sangnom by changing this line:
    Code:
    sangnom()
    to this:
    Code:
    # sangnom()
    At that point in the code the video is progressive. Something is making the script assume something else. SangNom is for antialiasing. Likely the video will look OK without it.

    Or, you can insert the statement "AssumeFrameBased()" just before the re-interlace line. But that doesn't get to the root of the problem and shouldn't be necessary. Anyway, bypassing SangNom should allow the script to continue. QTGMC and later filters will clean up some of the jaggies anyway.

    By the way, because QTGMC is an ".avsi" on your machine instead of an ".avs", you don't need this line:
    Code:
    Import("C:\Program Files\AviSynth 2.5\plugins\QTGMC-3.32.avsi")
    An .avsi file in your plugins folder would be imported automatically. I used it in my script because QTGMC is kept in my plugins folder as .avs, not as .avsi. But that shouldn't make any difference.
    Last edited by sanlyn; 23rd Mar 2014 at 12:00.
    Quote Quote  
  26. Sanlyn - I just used your Step 1 script and it looked fine so I didn't use Neat Video. I don't have Neat Video anyway.

    So to fix the changing brightness levels did you just use ColorYUV(autogain=true)? because you mentioned EODal12 before.

    I have lots of similar videos like this (however they don't have the changing brightness problem). I was wondering if there are any safe settings in your script which I could use on similar videos without having to analyze each one and modify the script?

    Could you please tell me where the documentation is for the following so I can understand what settings you used?:

    ColorMill
    fxVHS
    HSI (Hue)

    DegrainMedian

    I read that DeGrainMedian tends to cause artifacts in anything less then mode=3 and it's not very powerful in mode=3!
    It says that Mode is the operation mode (the more, the weaker). So does that mean that under or over 3 is not a good idea for the reason stated above?

    I usually use DeGrainMedian(limitY=2, limitUV=3, mode=1, interlaced=true) but I noticed you used this:

    DeGrainMedian(limitY=5,limitUV=5,mode=3)

    Is it safe to use your version on other videos and what's the difference?
    Quote Quote  
  27. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    You can't use the same plugins or methods for every video. But it's likely that similar filters can be used for most parts of this orm otyher videos. As it is, I'm not satisfied with my version, it could stand some tweaking (for one thing, I think it's a bit dark). Rule of thumb: "I if it looks great now, come back 2 days later and look again."

    I can't answer all the questions immediately, it's Sunday and I have chores to run for elderly relatives. I can check the forum later on my in-laws' PC, but they have no video apps. Be back later with more.
    Last edited by sanlyn; 23rd Mar 2014 at 12:00.
    Quote Quote  
  28. Banned
    Join Date
    Oct 2004
    Location
    New York, US
    Search Comp PM
    Originally Posted by holygamer View Post
    Sanlyn - I just used your Step 1 script and it looked fine so I didn't use Neat Video. I don't have Neat Video anyway.
    It's your choice, but you seem to sometimes go through hoops to do things in Avisynth that NeatVideo can do with one hand tied behind its back. Personally, I don't use many VirtualDub plugins, barely a handful. Except for NV, the few others are all color adjustment plugins. All the others I use are from Avisynth or in the TMPGenc Plus encoder.

    Originally Posted by holygamer View Post
    So to fix the changing brightness levels did you just use ColorYUV(autogain=true)? because you mentioned EODal12 before.
    autogain=true worked better than the VDub version. Sometimes you have to try both, then select the best one. You can never tell what auto filters will do, which why I hate using them and rarely do. But don't forget, the script I posted has some additional steps to take with autogain that you didn't take in the script you posted later. By itself, autogain will make your video look washed out.

    Originally Posted by holygamer View Post
    I have lots of similar videos like this (however they don't have the changing brightness problem). I was wondering if there are any safe settings in your script which I could use on similar videos without having to analyze each one and modify the script?
    I wish I could say yes, but....every video has its own problems. You can always try an effective idea, then modify it, add to it, etc., to solve specific problems.

    Originally Posted by holygamer View Post
    Could you please tell me where the documentation is for the following so I can understand what settings you used?:

    ColorMill
    fxVHS
    HSI (Hue)
    The colorMill home page is http://fdump.narod.ru/rgb.htm . The 4 control sections in ColorMill used most often are Gamma, Levels, Reg-Green-Blue, and Saturation. The other sections are seldom used. if ever. These appear to be extra the designer has set up for his own personal taste. Don't use the sharpener. If you don't understand basic terms like Gamma, levels, etc., then an RGB control like ColorMill is a great way to see what those terms mean. Load up a video and start playing with the sliders in the 4 sections mentioned. It won't take long.

    No one has ever seen official docs for Flaxen fxVHS, not even on Flaxen's own site. Almost everyone uses the plugin for one thing: to help correct chroma shift. Turn the other features off. An article on using it is at this site: http://www.doom9.org/index.html?/capture/chroma_artefacts.html . Scroll a little way down the page until you see the heading "12.2.2 Virtualdub usage"

    HSI is the Hue/Satuation/Intensity filter from Donald Graft and Neuron2. It comes with a small .txt file (load it into your VirtualDub plugin folder and the .txt file pops up if you click "Help" in the filter's dialog window). I don't use this filter very often. Its effects are quite specialized, but I don't know of any others of its type that can fix 1 or 2 colors without screwing up all the others. The Hue.txt file is attached at the bottom of this post.

    Originally Posted by holygamer View Post
    I read that DeGrainMedian tends to cause artifacts in anything less then mode=3 and it's not very powerful in mode=3!
    It says that Mode is the operation mode (the more, the weaker). So does that mean that under or over 3 is not a good idea for the reason stated above?

    I usually use DeGrainMedian(limitY=2, limitUV=3, mode=1, interlaced=true) but I noticed you used this:

    DeGrainMedian(limitY=5,limitUV=5,mode=3)

    Is it safe to use your version on other videos and what's the difference?
    I don't see that "my version" is very different from yours. The parameters are there to adjust the results; there is no one way to use these plugins, it depends on specific problems. The version I used is seen often in doom9 -- it comes out of the plugin's documentation. I haven't seen any complaints about artifacts. If I ever did see complaints, I'd want to ask: what kind of artifacts? It is suggested as a "prep" step on very noisy video to help QTGMC, so that QTGMC won't have to struggle to interpolate thru so much noisy grain. Otherwise, I don't use it.
    Last edited by sanlyn; 23rd Mar 2014 at 12:00. Reason: the usual fllod of typos. I think I'm getting worse!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!