Log in

View Full Version : TemporalDegrain makes output 'jump'


asarian
8th June 2009, 06:39
I tried to use TemporalDegrain; see:

First attempt (http://forum.doom9.org/showthread.php?p=1294632)

Sadly, things get all borked. Seems TemporalDegrain makes the source 'jump' back and forth a bit, every now and then. Real weird:

borked movie clip (http://www.mediafire.com/?njt1zrmott5)

Obviously, it's unusable that way. I even double-checked here on this forum, to see whether I got the method right. But I guess I'm missing something anyway. Hope someone knows what causes this.

Thanks

onesloth
8th June 2009, 08:36
You should post your avs file.

Didée
8th June 2009, 09:24
"Things you may encounter when using DirectShowSource()" ...

(DS filters often are not frame-accurate when seeking in the source. With a memory-hungry script like TemporalDegrain, in combination with the huge framesize of full-HD, it is likely to happen that the available memory is not sufficient to hold enough enough source frames in the cache for simply using "next-frame - next-frame - next-frame", hence nonlinear frame requests are made by the source filter, which in turn is producing the problem when the source filter is not frame accurate.

Solution - do not use DirectShowSource, but an appropriate specialized source filter like DGAVCDec[NV] / DGVC1DecNV / ffmpegsource, or whatever fits your actual source type.)

asarian
8th June 2009, 21:05
"Things you may encounter when using DirectShowSource()" ...

(DS filters often are not frame-accurate when seeking in the source. With a memory-hungry script like TemporalDegrain, in combination with the huge framesize of full-HD, it is likely to happen that the available memory is not sufficient to hold enough enough source frames in the cache for simply using "next-frame - next-frame - next-frame", hence nonlinear frame requests are made by the source filter, which in turn is producing the problem when the source filter is not frame accurate.

Solution - do not use DirectShowSource, but an appropriate specialized source filter like DGAVCDec[NV] / DGVC1DecNV / ffmpegsource, or whatever fits your actual source type.)


Thanks for your help. Your solutions could present a problem, though. The avs script is called in conjuction with x264 (because it's Blu-Ray VC1 source, and I need it converted to H264). Full script (job1.avs) is like this:


---------------------------------
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFT3DFilter.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\hqdn3d.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mt_masktools-25.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\mvtools2.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RepairSSE3.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RSharpenSSE3.dll")

video=DirectShowSource("D:\Temp\job1\video.mkv",audio=false).ConvertToYV12().TemporalDegrain(degrain=3, ov=4, blksize=16)
video=Crop(video, 0, 142, 0, -142)
video=ConvertToRGB(video)
return video
---------------------------------


The full job includes the job1.avs, for x264, like:


---------------------------------
"C:\Program Files\tools\x264\x264.exe" "D:\Temp\job1\job1.avs" --crf 16 --sar 1:1 --level 4.1 --aud --nal-hrd --vbv-bufsize 35000 --vbv-maxrate 35000 --merange 16 --filter 0,0 --ref 3 --b-pyramid --mixed-refs --bframes 3 --b-adapt 2 --weightb --no-fast-pskip --direct auto --subme 9 --trellis 1 --partitions all --8x8dct --me esa --threads auto --thread-input --progress --no-psnr --no-ssim --output "D:\Temp\video.264"
---------------------------------


I can't use DGVC1DecodeNV, because A) my G80 chip only supports VP1, and B) this all runs on a VM. So, if I simply extract the BD VC1 stream directly, what source filter should I use then? (which does not require CUDA).

Thanks

Firebird
8th June 2009, 21:18
FFmpegSource
http://forum.doom9.org/showthread.php?t=127037

asarian
9th June 2009, 06:49
FFmpegSource
http://forum.doom9.org/showthread.php?t=127037

Ok, I tried it as follows; first I added this:

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\FFMS2.dll")

Then I did:

video=FFVideoSource("D:\Temp\job1\video.mkv", track=-1, seekmode=1, timecodes="D:\Temp\whatever.timecodes", cache=true, cachefile="D:\Temp\whatever.ffcache").ConvertToYV12().TemporalDegrain(degrain=3, ov=4, blksize=16)

Either I get this:

avis [error]: unsupported input format (DIB)
x264 [error]: could not open input file 'D:\Temp\job1\job1.avs'

Or a System Acces Violation when I actually put the timecodes and cachefile parameters in. Any reason why it would break so ugly?

Firebird
9th June 2009, 12:29
Try that:
FFVideoSource("D:\Temp\job1\video.mkv").ConvertToYV12().TemporalDegrain(degrain=3, ov=4, blksize=16)
Crop(0, 142, 0, -142)
Is there a reason to ConvertToRGB? And remove all video=

asarian
9th June 2009, 22:33
Try that:
FFVideoSource("D:\Temp\job1\video.mkv").ConvertToYV12().TemporalDegrain(degrain=3, ov=4, blksize=16)
Crop(0, 142, 0, -142)
Is there a reason to ConvertToRGB? And remove all video=

Thanks again, but I still can't get it to work. :( I keep getting:

avis [error]: unsupported input format (DIB )

Why?? The mkv is made with the latest mkvmerge, and contains just one simple 1080p elementary VC1 stream. And is being properly set to the ConvertToYV12() color space. It simply should work. But it doesn't.

Firebird
10th June 2009, 00:14
Well, the easiest way would be if you upload this file and i'll check it.
If you can't try to remove filters one by one and find out what is causing that problem.

And check this thread:
http://forum.doom9.org/showthread.php?t=107549

asarian
10th June 2009, 11:44
Well, the easiest way would be if you upload this file and i'll check it.
If you can't try to remove filters one by one and find out what is causing that problem.


Well, the filters themselves don't cause the problem, as I had already a 'working' output file (see first post) with DirectShowSource. Here (http://www.mediafire.com/?mmmynmnojyn) is a clean sample, though.


And check this thread:
http://forum.doom9.org/showthread.php?t=107549

I had already seen that thread. It primarily deals with odd resolutions and the absence of ConvertToYV12(), both of which are not applicable here.

Thanks for your continued help, anyway.

Didée
10th June 2009, 12:49
Another possible workaround - you might try to hard-buffer the input of DirectShowSource manually, with FrameCache() (from WarpSharp.dll) or RequestLinear() (from TIVTC.dll). No guarantee that this works out, but with some luck, it might.