easy scenefiltering (scene filter macros)

Issue #31 new
Former user created an issue

I wanted scene filtering in vapoursynth similar to avisynth where you can apply a filter to a section between two bookmarks with hotkeys.

The first step to this was finding a way to import scxvid keyframes into vsedit. After a bit of digging, I found that vsedit .bookmarks files were really just a plaintext file with nothing but frame numbers stored and separated by a space and a comma. I then looked into avspmod's source code to see how it preformed the action. After a couple hours of banging my head against the keyboard, I achieved importing scxvid keyframes into vsedit by getting the avspmod code that made the frame numbers then modifying it to print out a separate file.

A buddy of mine completely rewrote that code and turned it into a CLI script which you can find here.

To use it, first make the scxvid keyframes and then just run the Python3 script using the given syntax when you run the script. After that, open up your video in vsedit, place any random bookmark in the video and it will create a .bookmarks file of the same name as your script and in the same directory, then open said file in notepad++ or similar and replace the contents with the contexts of the file created by the script above. Afterwards, close vsedit and reopen it and reload your video and you'll see your scxvid keyframes are loaded as bookmarks which you can skip between with ctrl+left/right arrow key.

The keyframes aren't entirely accurate and may insert false keyframes, but it's what people have done in avspmod for years and it's worked just fine.

The next course of action would be:

  1. implement the option to import a .bookmarks file with vsedit's simple format of frame numbers separated by a comma and a space to make that step of the progress easier,
  2. implementing/creating macros to apply your desired filter to the frame selection indicated by the bookmarks just like you can with avspmod.

Wobbly implements a way to do 2. but you can't view your filtering in real time with wobbly's preview window. The way wobbly does this is by making a python def in what it calls a "pattern" such as

#!

clip = taa.TAAmbk(clip, aatype='Nnedi3')

with the def being

 def aa(clip):
    clip = taa.TAAmbk(clip, aatype='Nnedi3')
    return clip

A full script scene filtered with wobbly looks like this (a couple things added by me by hand because there didn't seem to be a way to do dithering in wobby or apply a filter to the final output) Perhaps someone could make something from modified wobbly code?

Would making macros to enable efficient scenefiltering like we can with avspmod be doable? I don't have the programming knowledge to do this myself but I tried looking into everything to make it as easy and straight forward as I could for someone who does.

here's a sample scxvid keyframes file. Just save the paste as a .log or .txt.

Comments (0)

  1. Log in to comment