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 24th April 2020, 03:30   #81  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
The credits at the end are 30p, however they have low enough metrics that tdecimate will drop a frame (treating it as film with a duplicated frame) instead of blending them to 24p. So, the stars behind the text end up moving irregularly. The override forces it to blend them to 24p instead. I didn't find other areas of episodes in my limited testing that were 30p that were incorrectly handled requiring and override. The wormhole opening and closing in the intro might be, but it's pretty much a toss up.

I would expect Voyager is similar, but I haven't actually examined an episode to see.
Stereodude is offline   Reply With Quote
Old 24th April 2020, 05:13   #82  |  Link
Chir
Registered User
 
Join Date: Mar 2020
Posts: 11
Oh - I get it now.

I'll move the credits from the TFM overrides to the TDecimate and mark them as P...
Chir is offline   Reply With Quote
Old 24th April 2020, 05:52   #83  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by Chir View Post
Oh - I get it now.

I'll move the credits from the TFM overrides to the TDecimate and mark them as P...
You need the credits in both. You need them marked as p in the TFM override and marked as v in the td override.
Stereodude is offline   Reply With Quote
Old 26th April 2020, 19:38   #84  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,056
Quote:
Originally Posted by Stereodude View Post
Stuff it Katie... Your method returns soft looking video
Wrong. It returns the frames exactly as they appear on the DVD, with no blurring, whenever field matches can be found.

Quote:
Originally Posted by Stereodude View Post
that has nasty cadence judder for nearly all of it. The method Chir is using has no cadence judder
I believe what you mean to say is that my method allows conversion to VFR to be done as a second step, rather than making everything 10x more complicated than it needs to be by trying to deinterlace while in a VFR workflow.
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 26th April 2020, 23:33   #85  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by videoh View Post
That's very rude. You should be nice to the ladies.
Katie might have XX chromosomes, but she's no lady. Katie reaps what she sows.
Stereodude is offline   Reply With Quote
Old 27th April 2020, 13:18   #86  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,496
I just tried Katie's script on the sample clip provided. No idea what the aim actually was, but I get a 60fps output with up to four repeating frames at some points, plus a lot of misordered frames.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 27th April 2020, 19:57   #87  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,406
Please stop with the gratuitous insults, Stereodude. If you wish to rebut what she says, then maybe do something like wonkey_monkey and try one of her scripts.
manono is offline   Reply With Quote
Old 29th April 2020, 06:46   #88  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,922
so i looked at the sample and i couldn't find a single part that is interlaced.

it's just 3:2 telecine with PsF credits.

i mean ok the the credits are sometimes only in 1 field but that doesn't change that i couldn't find a single part where the credits fade with 60 FPS not 30.

so what do i miss here?
huhn is offline   Reply With Quote
Old 29th April 2020, 13:16   #89  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
I guess that all depends on how you're defining "interlaced". You can't simply IVTC the thing to p24 and call it a day. There are i60 post telecine fades (in/out of black and into other scenes) on top of the telecined content and the text titles are faded in and out as i60 on top of the telecined underlying image.
Stereodude is offline   Reply With Quote
Old 29th April 2020, 21:18   #90  |  Link
huhn
Registered User
 
Join Date: Oct 2012
Posts: 7,922
not here to say this makes it trivial but this is stuff that's been dealt with all the time it's now similar to broadcast where sometime text with 30 FPS is shown.
huhn is offline   Reply With Quote
Old 5th May 2020, 06:25   #91  |  Link
Katie Boundary
Registered User
 
Katie Boundary's Avatar
 
Join Date: Jan 2015
Posts: 1,056
Quote:
Originally Posted by Stereodude View Post
Katie reaps what she sows.
Oh really?

What I sow:

Quote:
my method allows conversion to VFR to be done as a second step, rather than making everything 10x more complicated than it needs to be by trying to deinterlace while in a VFR workflow
What I reap:

Quote:
Stuff it Katie
Quote:
Katie might have XX chromosomes
Hmmm, those things don't seem very similar.

By the way, Chir, this is exactly the sort of hysterical poop-flinging that I told you about in that PM I sent you. Now you have proof
__________________
I ask unusual questions but always give proper thanks to those who give correct and useful answers.
Katie Boundary is offline   Reply With Quote
Old 5th May 2020, 12:15   #92  |  Link
ryrynz
Registered User
 
ryrynz's Avatar
 
Join Date: Mar 2009
Posts: 3,650
Quote:
Originally Posted by Katie Boundary View Post
Oh really?
Quote:
Originally Posted by wonkey_monkey View Post
up to four repeating frames at some points, plus a lot of misordered frames.
TBH that result speaks for itself, just drop it.

Last edited by ryrynz; 6th May 2020 at 00:21.
ryrynz is offline   Reply With Quote
Old 5th May 2020, 13:21   #93  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,829
You can fix the out of order frames when using the Katie method on the sample, by swapping the field arguments used by TFM, but her method is quite bizarre. I'd be keen to learn how she decimates it for a VFR encode.

Y=nnedi3(field=-2)
A=yadifmod2(mode=1,edeint=Y).selecteven()
B=yadifmod2(mode=1,edeint=Y).selectodd()
C=Tfm(field=0,mode=0,cthresh=2,mthresh=2,clip2=A,micmatching=0)
D=Tfm(field=1,mode=0,cthresh=2,mthresh=2,clip2=B,micmatching=0)
Interleave(C,D)

When I tried her method in an older thread it resulted in duplicate frames that probably didn't need to be duplicates, but whatever makes her happy. She's been told why it isn't as clever as she thinks it is in several threads.
I think Yadif is a new addition to the workflow though. I'm not sure I understand the benefit of telling TFM to replace the combed pixels using a clip de-interlaced by Yadif, which is replacing the combed pixels by taking them from a clip de-interlaced with nnedi3. Maybe I'm missing the obvious, but why wouldn't you use the "Y" clip for TFM's Clip2?

Y=nnedi3(field=-2)
A=Y.selecteven()
B=Y.selectodd()
C=Tfm(field=1,mode=0,cthresh=2,mthresh=2,clip2=A,micmatching=0)
D=Tfm(field=0,mode=0,cthresh=2,mthresh=2,clip2=B,micmatching=0)
Interleave(C,D)

Last edited by hello_hello; 5th May 2020 at 13:26.
hello_hello is offline   Reply With Quote
Old 8th May 2020, 16:16   #94  |  Link
zapp7
Registered User
 
Join Date: May 2020
Location: Canada
Posts: 49
Hi all, thanks so much for developing this workflow. I've started working on producing override files and have finished S01E01-02 (The Pilot). The output definitely looks better than my old workflow, which was rip with MakeMKV and then detelecine and deinterlace with Handbrake.

One thing I'm not 100% sure about is when to use the p, c overrides versus the + for the TFM ovr file. I'm guessing the p and c ones should be used to correct combing only when the frame fits in with an obvious 3 progressive-2 interlaced pattern. Is that correct?

Another question I have is what is the best way to save this output at the highest quality for input into the Topaz Video Enhance AI software? Right now I'm using ffmpeg with the command:

ffmpeg -i input.avs -aspect 640:480 -c:v copy output.mkv

I tried to fix the aspect ratio because it looked off. From what I understand, this is a lossless file? The output for one episode is about 31GB, which is fine with me as I have a lot of hard drive space.

(Note to @Chir: I'm the one that contacted you on GitHub.)
zapp7 is offline   Reply With Quote
Old 9th May 2020, 13:57   #95  |  Link
SaurusX
Registered User
 
Join Date: Feb 2017
Posts: 135
Quote:
Originally Posted by zapp7 View Post
ffmpeg -i input.avs -aspect 640:480 -c:v copy output.mkv

I tried to fix the aspect ratio because it looked off.
Decreasing the resolution before upscaling seems like a wrong move IMO. You want to use all the original details you can. You should use Topaz to expand everything so that your minimum dimensions are met and then downsize after that.
SaurusX is offline   Reply With Quote
Old 9th May 2020, 19:17   #96  |  Link
zapp7
Registered User
 
Join Date: May 2020
Location: Canada
Posts: 49
Quote:
Originally Posted by SaurusX View Post
Decreasing the resolution before upscaling seems like a wrong move IMO. You want to use all the original details you can. You should use Topaz to expand everything so that your minimum dimensions are met and then downsize after that.
Yeah, I think I misunderstood what I needed to do. I figured out that I need to encode with the original NTSC sample aspect ratio (SAR) of 8:9. I'm now using:

Code:
ffmpeg -i input.avs -c:v libx264 -preset ultrafast -crf 0 -vf scale=-2:480,setsar=8/9 output.mkv
The original res is 720x480, but I noticed there are black strips on the sides of the image so I trim a few pixels off of the left and right sides in avisynth. The -2 accounts for the slight variance in the x dimension from episode to episode (i.e. 710 vs 706, etc.) depending on how much I trim it.
zapp7 is offline   Reply With Quote
Old 12th May 2020, 02:19   #97  |  Link
Chir
Registered User
 
Join Date: Mar 2020
Posts: 11
Quote:
Originally Posted by zapp7 View Post
Yeah, I think I misunderstood what I needed to do. I figured out that I need to encode with the original NTSC sample aspect ratio (SAR) of 8:9. I'm now using:

Code:
ffmpeg -i input.avs -c:v libx264 -preset ultrafast -crf 0 -vf scale=-2:480,setsar=8/9 output.mkv
The original res is 720x480, but I noticed there are black strips on the sides of the image so I trim a few pixels off of the left and right sides in avisynth. The -2 accounts for the slight variance in the x dimension from episode to episode (i.e. 710 vs 706, etc.) depending on how much I trim it.

I think this would produce a more lossless result:
ffmpeg -i <your avs file> -map 0:v -c:v copy <your output file>

If you are happy with your results, feel free share your results with the github project that I started. Anyone can contribute!

https://github.com/Chireven/DeepSpaceNine
Chir is offline   Reply With Quote
Old 12th May 2020, 02:57   #98  |  Link
zapp7
Registered User
 
Join Date: May 2020
Location: Canada
Posts: 49
Quote:
Originally Posted by Chir View Post
I think this would produce a more lossless result:
ffmpeg -i <your avs file> -map 0:v -c:v copy <your output file>
Do you correct for the SAR at any point later in the process? I ask because this command appears to produce a horizontally stretched image. It's not super obvious but it's evident if you compare your output it to the original DVD footage. I used the codec because it's my understanding that SAR can't be corrected using the "copy" command. I read that CF 0 H.264 is lossless so I was hoping that would be sufficient.

I have about 10 episodes "complete", and I put that in quotes because I feel as though I am still learning the whole process and making refinements. There are undoubtedly errors in what I have. Should I share anyway? What do you think?
zapp7 is offline   Reply With Quote
Old 12th May 2020, 03:17   #99  |  Link
JoelHruska
Registered User
 
Join Date: May 2020
Posts: 77
Hey all,

Just thought I'd post here and introduce myself. I'm Joel Hruska, from ExtremeTech, and I've been working to upscale Deep Space 9.

Some of the workflows I'm currently evaluating are below: When I refer to "my" QTGMC filter, it's nothing exotic -- just a simple repair script, lightly tweaked from the AviSynth Wiki. This isn't all of them -- I'm not in front of my PC at the moment -- so this is just what I can recall from memory.

Handbrake Source -- DaVinci Resolve Studio (framerate conversion to 119.88 fps using dummy frames) -- StaxRip (AviSynth to apply my own QTGMC filter ) -- Topaz VEAI upscale.

Handbrake Source -- DaVinci Resolve Studio (framerate conversion to 119.88 fps using interpolated frames) -- StaxRip (AviSynth to apply QTGMC and decimate the frame rate back to 23.976) -- Topaz VEAI upscale.
)
Handbrake Source -- StaxRip (AviSynth to apply a Doom 9 Deinterlacing filter suggested on the first page + my own QTGMC repair filter + daa3mod) -- Upscale 4x in TVEAI .

Handbrake Source -- StaxRip (AviSynth to apply my own QTGMC repair filter) -- Topaz VEAI 4x upscaling -- DaVinci Resolve Studio ingestion and 119.88 fps conversion -- 23.976 fps decimation in a second run through AviSynth.

Handbrake Source -- StaxRip (AviSynth to apply my own QTGMC repair filter) -- DaVinci Resolve Studio Ingestion and 119.88 fps conversion -- AviSynth decimation back to 23.976 fps -- Topaz VEAI upscaling.

Note that all of the above assume that I'm using a CFR MKV or M4V file created in Handbrake. VBR files have their own dependencies and must be processed in a different order. The five workflows above are more representative than static -- while I'm actively experimenting with all of them, I'm also trying some ideas that aren't listed above.

I do not currently have an option to use MakeMKV. StaxRip will not / cannot match A/V if handed a VFR file -- at least not that I can figure out. I would love to solve this problem by feeding the MakeMKV file directly into DaVinci Resolve Studio, but DRS will not ingest MPEG-2 files. (DRS won't ingest MKV files either, and StaxRip cannot mux M4V files properly. There's a merry hell of file dependencies depending on what kind of source you start with in all this).

In my last article I referred to an encode process I call Rubicon. Rubicon is created by ripping the DVD in Handbrake into H.264 Max Production, CFR (I'm evaluating this workflow in VFR right now, but Rubicon as demonstrated was created with CFR):

After ripping, I ran it through a QTGMC repair filter, set for Input Type 2 on the first pass and Input Type 3 on the second. I then run the QTGMC repair function (daa3mod is used for AA as well). This fixes the interlacing and 3:2 pulldown problems, but doesn't do a great job on the credits.

Once the StaxRip encode is finished, I upscaled the video in Topaz VEAI, dropped the upscaled footage into DaVinci Resolve Studio, interpolated 119.88 frames of information into the video stream (Optical Blend, Large Motion Vectors, Enhanced Better), then ran it back through AviSynth with a ChangeFPS(24000, 1001) command.

This produced the following video (Please set to 4K):

https://www.youtube.com/watch?v=8Dwf...ature=youtu.be

For comparison, here's the exact same clip from an upscaled MKV of a DS9 episode that I ran through Topaz Video Enhance AI with no further processing:

https://www.youtube.com/watch?v=DzeE...ature=youtu.be

When I started this project I said I wanted to provide a free software workflow and I mean that. Katie Boundary's deinterlacing filter from Page 1 fixed most of the problems I had in Sacrifice of Angels, and the simple QTGMC repair script I'm using appears to fix the rest. It produces a rather nice 48fps version of the show. There's also the option to rip the VOB directly at 29.97 fps. When the same script is used on them, they become 60fps files, and I'm evaluating that option as well just to see how well it compares.

Finally, I'll be evaluating the impact of leaving the show at 119.88 fps without ever decimating the frame rate down at all. (This only applies to the versions of the show that use dummy frames -- the interpolated "supersmooth" variants are not being used.

Right now, I'm wondering what the best way is to get moire out of the early show credits and out of Episode 1-1, Emissary, where the Borg cube is absolutely riddled with it. Is there a way to remove the rainbow effect with a filter, or does it have to be done by hand?

One question I'd really like to know the answer to, if anybody does: Everyone talks about H.265 in terms of its ability to deliver high-quality results in a smaller file size. I don't really care about that aspect of it. What I'm curious about is this: Does H.265 ever produce better visual results than H.264? Are there times when one should use H.265 rather than H.264 because it results in a higher quality picture *in absolute terms, regardless of file size?*

Happy to discuss results and any of the above. Apologies that it's a bit of a muddle.

Link to my last story, if anyone wants to see the video samples. Set for 4K in all cases when available. I upscaled the same clips from a DVD rip, an MKV file, and my own Rubicon upscale method.

https://www.extremetech.com/extreme/...-brought-ahead

Last edited by JoelHruska; 12th May 2020 at 03:19. Reason: Inserted link.
JoelHruska is offline   Reply With Quote
Old 12th May 2020, 15:57   #100  |  Link
SaurusX
Registered User
 
Join Date: Feb 2017
Posts: 135
What are your QTGMC calls specifically? QTGMC is great and can be used on progressive material, but most of this series does not need it. There are a handful of 60i sequences throughout and that's it. There has already been much discussion in this thread as to the "best" workflow for resolving the interlaced sections of this series. Don't get married to Handbrake.

Last edited by SaurusX; 12th May 2020 at 16:00.
SaurusX 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 03:04.


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