View Single Post
Old 17th May 2020, 18:12   #232  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
Time to reverse my position.....

Given poisondeathray posted a link to an interlaced section of an episode, I thought I'd give VFR encoding a try. I took the sample we've been playing with previously and appended the interlaced sample to the end of it. Then I ran an analysis pass with TIVTC to create the metrics files and had a look at the output. TFM breezed through the problematic credits at the start without requiring a tweak. I did have to set micmatching=0 to prevent a glitch in the interlaced section. It's smoother through the fades between shots than the methods I used previously. VFR straight out of Avisynth is probably the way to go.

Edit: It turns out TFM's default de-interlacing sucks balls for the interlaced CGI parts (lots of aliasing). When I realised it didn't look anywhere near as good as my video card's de-interlacing, I switched it out for PP=5. Much better. New samples below.

The script for the analysis pass:

Quote:
LoadPlugin("C:\Program Files\MeGUI\tools\dgindex\DGDecode.dll")
A = DGDecode_mpeg2source("D:\VTS_02_1_sample.d2v")
B = DGDecode_mpeg2source("D:\space battle.d2v")
A + B

Crop(8,0,-8,0, Align=true)
TFM(Output="D:\TFMMetrics.txt", micmatching=0, PP=5)
TDecimate(Mode=4, Hybrid=2, Output="D:\TDecimateMetrics.txt")
I added trims to the script after creating the timecodes to apply filtering to the various sections. There's also a version included without any filtering. TFM just doing it's thing.

Encoding script without filters:

Quote:
LoadPlugin("C:\Program Files\MeGUI\tools\dgindex\DGDecode.dll")
A = DGDecode_mpeg2source("D:\VTS_02_1_sample.d2v")
B = DGDecode_mpeg2source("D:\space battle.d2v")
A + B

Crop(8,0,-8,0, Align=true)
TFM(Input="D:\TFMMetrics.txt", micmatching=0, PP=5)
TDecimate(Mode=5, Hybrid=2, Input="D:\TDecimateMetrics.txt", tfmIn="D:\TFMMetrics.txt", mkvout="D:\TimeCodes.txt")

Resize8(640,480)
Encoding script with filters:

Quote:
LoadPlugin("C:\Program Files\MeGUI\tools\dgindex\DGDecode.dll")
A = DGDecode_mpeg2source("D:\VTS_02_1_sample.d2v")
B = DGDecode_mpeg2source("D:\space battle.d2v")
A + B

Crop(8,0,-8,0, Align=true)
TFM(Input="D:\TFMMetrics.txt", micmatching=0, PP=5)
TDecimate(Mode=5, Hybrid=2, Input="D:\TDecimateMetrics.txt", tfmIn="D:\TFMMetrics.txt", mkvout="D:\TimeCodes.txt")

__film = last
__t0 = __film.trim(0, 106).MCDegrainSharp()
__t1 = __film.trim(107, 590)
__t2 = __film.trim(591, 2978).QTGMC(InputType=1, Preset="very slow", ShutterBlur=3, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8)
__t3 = __film.trim(2979, 5556).QTGMC(InputType=1, EzDenoise=1)
__t4 = __film.trim(5557, 5979).QTGMC(InputType=1, Preset="very slow", ShutterBlur=3, ShutterAngleSrc=180, ShutterAngleOut=180, SBlurLimit=8)
__t0 ++ __t1 ++ __t2 ++ __t3 ++ __t4

Resize8(640,480)

# Tried QTGMC(InputType=1, EzDenoise=1) to see how it compares, but I still
# think I prefer MCDegrainSharp for this one even though QTGMC removes more noise
VFR Encodes, Take 2.zip (81.1 MB)

JoelHruska,
VFR isn't that hard to do, and this may be as close to a one size fits all method as it gets, and for the samples I've created at least, it looks the best. Avisynth outputs the average frame rate and the timecodes are used to make it variable at the encoding stage. You create the scripts for the analysis pass, run them, and TIVTC creates the metrics files. When I'm doing that sort of thing I use MeGUI, as it has an analysis pass mode and it's easy to add a bunch of jobs to the job queue. The trick is to never open the analysis scripts after running them, otherwise the metrics files are over-written and you have to run them again. Then it's just a matter of adding the encoding scripts to the job queue. If you specify unique names for the files for each episode, you can develop a system to do it pretty efficiently. I added Trims to one of the encodes above to apply the same filtering as before. It's easy to do, but it's not vital. You do have to decode with repeat flags being honoured though or it won't work.
Adding the timecodes to the x264 command line is done like this:

--tcfile-in "D:\Timecodes.txt"

PS. ChangeFPS(24000,1001) isn't the best way to decimate a 120fps source. It doesn't discriminate.
TDecimate(mode=7, rate = 24.0/1.001) tries to make sure the decimated frames are always duplicates.

Last edited by hello_hello; 18th May 2020 at 01:33.
hello_hello is offline   Reply With Quote