Go Back    Forum > Digital Video > Video Project Help > Restore, Filter, Improve Quality

Reply
 
LinkBack Thread Tools
  #1  
09-02-2018, 02:58 PM
stevevid stevevid is offline
Free Member
 
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
I need to adjust each scene in a file with different adjustments. Initially, I started the process by setting up separate tabs in AvsPmod, one tab for each scene. It was working, but seemed awkward. Can I make adjustments to multiple scenes in one script? I tried the partial script below, but it only showed a 16 frame scene. Can a variation of this approach work or do I have to breakup the overall file into a file for each scene?

Code:
AVISource("file1.avi")
#Scene 1:  
S1 = Trim(0,7809)
FadeIn(S1, 15)
ColorYUV(S1,gain_y=70,off_y=0,cont_y=80,off_u=0,cont_u=256,off_v=0,cont_v=256,opt="",showyuv=false)
ConvertToYV12(matrix="Rec601", interlaced=true)
SmoothAdjust_SmoothLevels(16,1.1,235,16,235,chroma=200,limiter=0,tvrange=true)
FadeOut(S1, 15)
Histogram("levels")
Code:
#Scene 2: 
S2 = Trim(8192,15476)
FadeIn(S2, 15)
ColorYUV(S2, gain_y=110, gamma_y=128, off_y=-80, cont_y=-32, gain_U=0, off_u=-8,cont_u=128,gain_v=0, off_v=0, cont_v=128, showyuv=false)
ConvertToYV12(matrix="Rec601", interlaced=true)
SmoothAdjust_SmoothLevels(16,1.1,235,16,235,chroma=200,limiter=0,tvrange=true)
FadeOut(S2, 15)
Histogram("levels")
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
09-02-2018, 03:47 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,658
Thanked 2,461 Times in 2,093 Posts
Use [code][/code] around Avisynth scripts when posting. I fixed your last post for you.

Watch out about multple AvsPmod tabs/windows. Each eats resources, and you can quickly run out, and the program gets really unstable. It's already NOT the most stable of software, but that makes it so much worse.

I don't do this, but the way to make multiple adjustments in one really long script is to mark off the frame count.

SelectRangeEvery()
script
SelectRangeEvery()
next script

There's probably several ways to do it, as is the nature of Avisynth. This is something I never do, so I'm not 100% sure that's the correct command. I pre-split assets in VirtualDub, process individually.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: stevevid (09-02-2018)
  #3  
09-02-2018, 05:22 PM
stevevid stevevid is offline
Free Member
 
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
Thanks for converting my code for proper viewing. I wondered how everyone else was able to get it right.

I'll try both approaches at adjusting scenes. I thought about the presplitting but was overly concerned about converting between multiple color spaces.
Reply With Quote
  #4  
09-02-2018, 06:13 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,658
Thanked 2,461 Times in 2,093 Posts
Direct Stream Copy in VirtualDub won't convert colorspaces.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #5  
09-03-2018, 04:33 AM
sanlyn sanlyn is offline
Premium Member
 
Join Date: Aug 2009
Location: N. Carolina and NY, USA
Posts: 3,648
Thanked 1,308 Times in 982 Posts
Quote:
Originally Posted by stevevid View Post
I need to adjust each scene in a file with different adjustments. Initially, I started the process by setting up separate tabs in AvsPmod, one tab for each scene. It was working, but seemed awkward. Can I make adjustments to multiple scenes in one script? I tried the partial script below, but it only showed a 16 frame scene. Can a variation of this approach work or do I have to breakup the overall file into a file for each scene?

Code:
AVISource("file1.avi")
#Scene 1:  
S1 = Trim(0,7809)
FadeIn(S1, 15)
ColorYUV(S1,gain_y=70,off_y=0,cont_y=80,off_u=0,cont_u=256,off_v=0,cont_v=256,opt="",showyuv=false)
ConvertToYV12(matrix="Rec601", interlaced=true)
SmoothAdjust_SmoothLevels(16,1.1,235,16,235,chroma=200,limiter=0,tvrange=true)
FadeOut(S1, 15)
Histogram("levels")
Code:
#Scene 2: 
S2 = Trim(8192,15476)
FadeIn(S2, 15)
ColorYUV(S2, gain_y=110, gamma_y=128, off_y=-80, cont_y=-32, gain_U=0, off_u=-8,cont_u=128,gain_v=0, off_v=0, cont_v=128, showyuv=false)
ConvertToYV12(matrix="Rec601", interlaced=true)
SmoothAdjust_SmoothLevels(16,1.1,235,16,235,chroma=200,limiter=0,tvrange=true)
FadeOut(S2, 15)
Histogram("levels")
AvsPmod is a disaster. Good idea, dumb and primitive implementation.

Whether or not you use separate scripts is up to you, but separate scripts run in VirtualDub is the bestv way to insure your sanity. The separate outputs can be joined later, even in VirtualDub or an encoder.

Separate scripts or not, your logic is incorrect. Your script applies a fade-in,m then completely alters the fade-in's color, gamma, and other visual properties with ColorTYUV and other filters. Fix the color and noise first, then apply fade-in and fade-out last.

Code:
vid1=AVISource("file1.avi")

#Scene 1:  
vid1.Trim(0,7809)
ColorYUV(gain_y=70,off_y=0,cont_y=80,off_u=0,cont_u=256,off_v=0,cont_v=256,\  
    opt="",showyuv=false)
ConvertToYV12(matrix="Rec601", interlaced=true)
SmoothLevels(16,1.1,235,16,235,chroma=200,limiter=0,tvrange=true)
FadeIn(15)
FadeOut(15)
Histogram("levels")
S1=last

#Scene 2: 
Vid1.Trim(8192,15476)
ColorYUV(gain_y=110, gamma_y=128, off_y=-80, cont_y=-32, gain_U=0,  off_u=-8,\  
    cont_u=128, gain_v=0, off_v=0, cont_v=128, showyuv=false)
ConvertToYV12(matrix="Rec601", interlaced=true)
SmoothLevels(16,1.1,235,16,235,chroma=200,limiter=0,tvrange=true)
FadeIn(15)
FadeOut(15)
Histogram("levels")
S2=last

Return (S1 + S2)
Fades and dissolves look cleaner and smoother if the video is first deinterlaced, fades and dissolves are applied, and then re-interlaced. But most people see no difference, and QTGMC is the only deinterlacer that should ever be used for that kind of work.

There are multiple ways of setting up code for two processes in one script, but fading-in and then filtering the fade-in is incorrect logic. Also, the code as presented extracts two different chunks from the main video but joins and saves only the two chunks, S1 and S2. What happens to the rest of the main video?

By the way, you'll get even cleaner chroma results if you convert to yv16 for SmoothLevels and Histogram, then convert all to YV12 for output to the encoder or let the encoder do it. http://avisynth.nl/index.php/YV16
Reply With Quote
  #6  
09-03-2018, 08:24 AM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,658
Thanked 2,461 Times in 2,093 Posts
Quote:
Originally Posted by sanlyn View Post
AvsPmod is a disaster.
but separate scripts run in VirtualDub is the best way
I don't find VirtualDub any more stable than AvsPmod. The main advantage of AvsPmod is immediately WYSIWYG, while VirtualDub goes through a while save/reopen motion. Both have given me countless errors. In fact, I'd say the Avisynth scripts themselves are just as unstable.

Long scripts like he wants to do are usually what causes crashes.

Quote:
vid1.Trim(0,7809)
Vid1.Trim(8192,15476)
I first thought of trim(), but didn't think it would work. I was thinking the first trim() would discard, and subsequent trim would trim() nothing, crash script. I guess not? (Again, not something I ever really do.)

Quote:
video is first deinterlaced
More and more, I'm suggested that be done separately, and in the much-faster x64 Avisynth. The process is easily 2x+ faster in the x64+ (Avisynth x64+ "plus") version.

Quote:
QTGMC is the only deinterlacer that should ever be used for that kind of work.
This needs repeating.
There are times that a Yadifmod will do nicely, but QTGMC is still the go-to.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #7  
09-03-2018, 11:53 AM
stevevid stevevid is offline
Free Member
 
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
Interesting discussions.

As far as stability, VirtualDub seems the most unstable to me. It crashes fairly frequently with some sort of memory error. Also, things like viewing preview and histogram at the same time can be frustrating. I found a convoluted way to make it work, but it required a lot of trial and error. Getting VD to accept the proper frame rate was a royal pain. It kept setting the rate at 25 fps even though I told it to do 29.97. I now have a procedure to make that work (have the vcr on and feeding video to the capture device before setting the fps under the video/settings menu). So far, AvsPmod seems to work ok. The only thing I've found is it has an odd desire to add a new tab every time it's opened, but I can live with that. Anything else I should watch out for?

Sanlyn, you asked about the rest of the video beyond scenes 1 & 2. I just had two scenes set up as a trial. There are more scenes. They're just not listed yet.

Lordsmurf, you mentioned errors could become more of a problem with a longer script. Yep, I can't even get a simple IF statement to work using the Gscript plugin. I'll post this as a separate thread.

Lordsmurf, Did you previously warn people away from the 64-bit version of AviSynth (maybe I'm confusing this with the 64-bit Huffyuv)? Here you praise some of 64-bit AviSynth's attributes. Is it best to use the 64-bit version on a system with a fourth generation i7 processor, Windows 7 Pro, and 16GB memory? Would you recommend the latest version r2662 or the last stable version r1576?

Thanks,
Steve

Last edited by stevevid; 09-03-2018 at 12:11 PM.
Reply With Quote
  #8  
09-03-2018, 06:43 PM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,658
Thanked 2,461 Times in 2,093 Posts
bad = Huffyuv 64, Huffyuv MT
good = Avisynth + x64

Avisynth+ is not fun to install. You install + to get x64, delete the x86/32-bit folders, then install regular Avisynth over it. Then you have to install all the dependency files in the various Windows folders, both x64 and x86. I have an installer guide in Notepad++ right now, but haven't had time to finish.

I don't know what you refer to with stable/latest versions. Go here: http://avs-plus.net/

I would not suggest it in anything less than a comparable (or better) setup to what I'm using:
- i7-6700K
- 16gb RAM
- SSD drive for processing
- good cooling; I use a nice fat Noctua
- Windows 7; Win8/10 not friendly to video tasks

On lower specs, mere HDD, etc, Avisynth is about as fun as a visit to the dentist.

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
  #9  
09-04-2018, 02:15 AM
stevevid stevevid is offline
Free Member
 
Join Date: Jul 2018
Location: Dallas, TX
Posts: 124
Thanked 12 Times in 9 Posts
Quote:
Originally Posted by lordsmurf View Post
Avisynth+ is not fun to install. You install + to get x64, delete the x86/32-bit folders, then install regular Avisynth over it. Then you have to install all the dependency files in the various Windows folders, both x64 and x86. I have an installer guide in Notepad++ right now, but haven't had time to finish.
Would posting the part of the installer guide you do have done help get my, and others, installation going in the right direction?

Quote:
Originally Posted by lordsmurf View Post
On lower specs, mere HDD, etc, Avisynth is about as fun as a visit to the dentist.
Ugh. Now you've done it. You reminded me I need to make a dentist appointment.
Reply With Quote
  #10  
09-15-2018, 12:55 AM
lordsmurf's Avatar
lordsmurf lordsmurf is online now
Site Staff | Video
 
Join Date: Dec 2002
Posts: 13,658
Thanked 2,461 Times in 2,093 Posts
The essentials are this:

(1) install Avisynth+ but only the x64. If any part of x86 gets installed, just delete the folders manually. Install in the "Avisynth+" directory under "Program Files (x86)", and yes even for this 64-bit software.

(2) install Avisynth 2.6 MT unofficial. Install in "Avisynth" folder under "Program Files (x86)". It will overwrite some x86+, but not x64, that's what you want.

(3) install all the dependency DLLs for Windows folders

(4) put 32-bit scripts in Avisynth/plugins, and 64 in Avisynth+ folders

- Did my advice help you? Then become a Premium Member and support this site.
- For sale in the marketplace: TBCs, workflows, capture cards, VCRs
Reply With Quote
The following users thank lordsmurf for this useful post: stevevid (09-15-2018)
Reply




Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital 8 tapes without audio for certain scenes? Sess Capture, Record, Transfer 7 11-06-2012 09:48 AM
Water scenes have noticeable artifacts on DVD? kpmedia Encode, Convert for discs 0 04-11-2010 04:03 AM
JVC 9900 odd artifacts on motion scenes ? zaq.hack Restore, Filter, Improve Quality 7 10-22-2009 12:51 PM
Good quality restore/capture setup? tobias Restore, Filter, Improve Quality 21 04-28-2009 11:05 PM
Blank out scenes help manthing Edit Video, Audio 3 06-13-2007 03:21 AM




 
All times are GMT -5. The time now is 02:45 AM