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 > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 17th April 2022, 09:33   #1  |  Link
JustinTArthur
Registered User
 
Join Date: Feb 2022
Location: Austin, TX
Posts: 5
vsfieldkit: functions for working with interlaced content

Been processing old home VHSes and DVDs lately and needed some things I hadn't seen in the VapourSynth community yet.

Documentation | Source Code

Some notable functions:
vsfieldkit.group_by_combed
vsfieldkit.group_by_field_order
vsfieldkit.resample_as_progressive
vsfieldkit.scan_interlaced
JustinTArthur is offline   Reply With Quote
Old 17th April 2022, 09:45   #2  |  Link
JustinTArthur
Registered User
 
Join Date: Feb 2022
Location: Austin, TX
Posts: 5
scan_interlaced is where I've spent most of my time. It's a frame doubler that draws interlaced fields like an interlaced scan display would, with optional phosphor decay simulation. It was inspired by Juha Jeronen's Phosphor deinterlacer for VLC media player.


Slowed from 59.94 to 10 fps. See how much smoother the right-side looks.

scan_interlaced reference and deep dive from the docs.

Last edited by JustinTArthur; 18th April 2022 at 08:14.
JustinTArthur is offline   Reply With Quote
Old 1st May 2022, 07:27   #3  |  Link
mikewando
Registered User
 
Join Date: Nov 2010
Posts: 11
Wow scan_interlaced looks super cool! I really like the deep dive too, both content and format. I've been considering writing some words about ways of handling telecined content and may take some inspiration.

I've been using FrameEval for the example situation presented for vsfieldkit.group_by_combed. I imagine it's about the same performance either way, but maybe worth testing/noting if one way has advantages over the other.

Code:
def filter_combed_only(n, f, filter, no_filter):
    return filter if f.props['_Combed'] == 1 else no_filter

no_filter = ...
filter = ...
clip = no_filter.std.FrameEval(functools.partial(filter_combed_only, filter=filter, no_filter=no_filter), prop_src=no_filter)
mikewando is offline   Reply With Quote
Old 1st May 2022, 08:31   #4  |  Link
JustinTArthur
Registered User
 
Join Date: Feb 2022
Location: Austin, TX
Posts: 5
Quote:
Originally Posted by mikewando View Post
Wow scan_interlaced looks super cool! I really like the deep dive too, both content and format.
Thanks for taking a look!

Quote:
Originally Posted by mikewando View Post
I've been using FrameEval for the example situation presented for vsfieldkit.group_by_combed.
What you're doing with FrameEval is in many ways better than group_by_combed. I'd recommend keeping it for your use-case. FrameEval is better here because it works in line with VapourSynth's way of doing things: stacking filters behind the scenes in a non-blocking way until frames are requested, e.g. by vspipe.

vsfieldkit.group_by_combed requests frames itself, forcing your filter stack to process content from the source all the way through your filters so far, blocking until it gets those frames. This makes for an elegant programming experience given there are no callbacks involved, but it's rarely faster.

All that said, here are some things it is good for:
  • Cutting and splicing. FrameEval doesn't have much for cutting or pulling out contiguous sub-clips of frames.
  • Introducing new frames. If field matching failed because a segment contains native 60i and you actually want to splice in bob-doubled frames from that into your otherwise de-telecined frames, you can do that with group_by_combed.
  • Writing a Python script for outputting analysis instead of frames.

I should definitely point more to FrameEval and ModifyFrames in the docs for those funcs and explain the use-cases a bit.

Last edited by JustinTArthur; 4th May 2022 at 08:50. Reason: Reverted to original
JustinTArthur is offline   Reply With Quote
Reply

Tags
deinterlacing, vapoursynth, vsfieldkit

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 01:17.


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