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. |
29th October 2011, 06:17 | #1 | Link |
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! |
29th October 2011, 09:00 | #2 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
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 |
29th October 2011, 19:26 | #3 | Link |
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? |
29th October 2011, 20:56 | #4 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
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 |
30th October 2011, 00:02 | #5 | Link |
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? |
30th October 2011, 00:19 | #6 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
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 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. |
30th October 2011, 00:29 | #7 | Link |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
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.
|
Thread Tools | Search this Thread |
Display Modes | |
|
|