Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 29th October 2011, 06:17   #1  |  Link
Chymerix
Registered User
 
Join Date: Oct 2011
Posts: 5
Preroll Causing Corrupted Frames

Hi,

I'm trying to use NeatVideo in conjunction with HDRAGC in Avisynth. The NeatVideo filter is configured to do some temporal filtering, and so has a preroll value of 5 frames.

HDRAGC has no temporal component and can begin processing immediately. The issue I'm encountering is that the preroll for the NeatVideo plugin seems to add some blank frames to the beginning of the clip. These blank frames cause the HDRAGC plugin to choose incorrect filter values and corrupt the initial few seconds of my video.

I've confirmed that everything works after removing the preroll, but I'd like to be able to use the temporal component of NeatVideo with HDRAGC. Does anyone have any ideas for getting these two filters to play nice with each other? I suspect that I have to delay the application of the HDRAGC filter somehow. I tried using ApplyRange, but I'm unable to pass parameter name-value pairs to the HDRAGC filter in the call to ApplyRange. Any help is appreciated.

Thanks!
Chymerix is offline   Reply With Quote
Old 29th October 2011, 09:00   #2  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,412
Simplest solution is probably to use Loop() to repeat the first frame several times, apply the filters, then remove the extra frames.

Loop(10,0,0) # adds 9 frames at start
... # filters
Trim(9,0) # remove added frames
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 29th October 2011, 19:26   #3  |  Link
Chymerix
Registered User
 
Join Date: Oct 2011
Posts: 5
Thanks for the quick reply. This worked for the video, but caused audio encoding to hang.

I have the following setup:

Sony Vegas Movie Studio --> DebugMode FrameServer --> AviSynth --> MeGUI.

When I load the avisynth script in MeGUI and start the encoding, the audio encode progress indicator stays stuck at zero.

Any ideas?
Chymerix is offline   Reply With Quote
Old 29th October 2011, 20:56   #4  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,412
The end result should be to deliver the original audio, so I don't know why it shouldn't work - perhaps some glitch with Loop() and audio?

Easiest solution is just to save the original audio and dub it back at the end:

orig=last
Loop(10,0,0) # adds 9 frames at start
... # filters
Trim(9,0) # remove added frames
AudioDub(orig) # add back original untouched audio track
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Old 30th October 2011, 00:02   #5  |  Link
Chymerix
Registered User
 
Join Date: Oct 2011
Posts: 5
I had to select the "Write audio as PCM samples in signpost AVI" option in DebugMode FrameServer and both snippets you provided worked. Thanks a lot; I'm amazed at the quality I can get from DV footage using this combination of programs and filters.

I'm curious about how this works, though - How does looping over the first frame avoid the issue? I'd expect it to loop over the initial black preroll frames, but instead I see no trace of the preroll. And even though the looped frames are trimmed at the end, wouldn't they be present when the HDRAGC filter is initializing?
Chymerix is offline   Reply With Quote
Old 30th October 2011, 00:19   #6  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,173
To understand how an Avisynth graph runs you need to start at the end and work backwards calculating which frame numbers get asked for at each filter.

So first ...
Code:
# External App
Ask for frame 0
# Trim(9,0)
Ask for frame 9
# filters (5 frame temporal ref)
Ask for frame 7,8,9,10,11
# Loop(10,0,0)
Ask for frame 0,0,0,1,2
# Cache
Ask for frame 0,1,2
And next ...
Code:
# External App
Ask for frame 1
# Trim(9,0)
Ask for frame 10
# filters (5 frame temporal ref)
Ask for frame 8,9,10,11,12
# Loop(10,0,0)
Ask for frame 0,0,1,2,3
# Cache
Ask for frame 3

Last edited by IanB; 30th October 2011 at 00:23.
IanB is offline   Reply With Quote
Old 30th October 2011, 00:29   #7  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,412
Since the 'corruption' affects only the first few frames, the idea was to add some dummy frames at the start (here using Loop(), merely as the simplest way to achieve that), then trim off the extra frames at the end, so that the corruption affects only the dummy frames and not the real video.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 18:13.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.