This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Encoding with Vapoursynth + Avisynth
#4
Porting:
function ReplaceFrames(clip source, int start1, int end1, int start2, int end2) {
    # Extraire les segments à garder
    segment1 = source.Trim(0, start1 - 1)
    segment2 = source.Trim(start2, end2)
    segment3 = source.Trim(end1 + 1, source.FrameCount - 1)
  
    # Assembler les segments
    return segment1 ++ segment2 ++ segment3
}
to Vapoursynth should be easy.
Should be:
def ReplaceFrames(clip: vs.VideoNode, start1: int, end1: int, start2: int, end2: int)  -> vs.VideoNode:
    # Extraire les segments à garder
    segment1 = source.Trim(0, start1 - 1)
    segment2 = source.Trim(start2, end2)
    segment3 = source.Trim(end1 + 1, source.num_frames - 1)
  
    # Assembler les segments
    return segment1 + segment2 + segment3
}
So you could save that in a file named replaceframes.py (in your 'Hybrid/64bit/vsscripts'-folder) and then use it in a custom section through:
import replaceframes

# Remplacement des frames 43125 à 43129 par 43120 à 43124
clip = replaceFrames.ReplaceFrames(clip, 43125, 43129, 43120, 43124)
# Remplacement des frames 43301 à 43304 par 43275 à 43278
clip = replaceFrames.ReplaceFrames(clip, 43301, 43304, 43275, 43278)
# Remplacement de la frame 22261 par 22257
clip = replaceFrames.ReplaceFrames(clip, 22261, 22261, 22257, 22257)
# Remplacement de la frame 22262 par 22257
clip = replaceFrames.ReplaceFrames(clip, 22262, 22262, 22257, 22257)
# Remplacement de la frame 22263 par 22256
clip = replaceFrames.ReplaceFrames(clip, 22263, 22263, 22256, 22256)
# Remplacement de la frame 22264 par 22258
clip = replaceFrames.ReplaceFrames(clip, 22264, 22264, 22258, 22258)
# Remplacement de la frame 22437 par 22441
clip = replaceFrames.ReplaceFrames(clip, 22437, 22437, 22441, 22441)
# Remplacement de la frame 22438 par 22442
clip = replaceFrames.ReplaceFrames(clip, 22438, 22438, 22442, 22442)
# Remplacement de la frame 22439 par 22443
clip = replaceFrames.ReplaceFrames(clip, 22439, 22439, 22443, 22443)
# Remplacement de la frame 22440 par 22444
clip = replaceFrames.ReplaceFrames(clip, 22440, 22440, 22444, 22444)
# Remplacement de la frame 22454 par 22453
clip = replaceFrames.ReplaceFrames(clip, 22454, 22454, 22453, 22453)
clip = replaceFrames.ReplaceFrames(clip, 22440, 22440, 22444, 22444)

return clip
Got no time to test, but this should work.
One could also use https://github.com/Irrational-Encoding-W...emapFrames in a custom section.

Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Reply


Messages In This Thread
RE: Encoding with Vapoursynth + Avisynth - by Selur - 03.09.2024, 04:37

Forum Jump:


Users browsing this thread: 1 Guest(s)