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
#3
OK... I'll get straight to the point then. I want to replace problematic frames (with black hole / circle, like perforation) with their duplicate counterpart.

Here is the script :
# Charge le plugin FFMS2
LoadPlugin("C:\Program Files (x86)\AviSynth+\plugins64+\ffms2.dll")
# Source vidéo
video = FFVideoSource("C:\Users\Admin\Desktop\FILM 3 - ETAPE 3 - DAVINCI.mkv")
# Fonction pour remplacer des frames spécifiques
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
}
# Remplacement des frames 43125 à 43129 par 43120 à 43124
video = ReplaceFrames(video, 43125, 43129, 43120, 43124)
# Remplacement des frames 43301 à 43304 par 43275 à 43278
video = ReplaceFrames(video, 43301, 43304, 43275, 43278)
# Remplacement de la frame 22261 par 22257
video = ReplaceFrames(video, 22261, 22261, 22257, 22257)
# Remplacement de la frame 22262 par 22257
video = ReplaceFrames(video, 22262, 22262, 22257, 22257)
# Remplacement de la frame 22263 par 22256
video = ReplaceFrames(video, 22263, 22263, 22256, 22256)
# Remplacement de la frame 22264 par 22258
video = ReplaceFrames(video, 22264, 22264, 22258, 22258)
# Remplacement de la frame 22437 par 22441
video = ReplaceFrames(video, 22437, 22437, 22441, 22441)
# Remplacement de la frame 22438 par 22442
video = ReplaceFrames(video, 22438, 22438, 22442, 22442)
# Remplacement de la frame 22439 par 22443
video = ReplaceFrames(video, 22439, 22439, 22443, 22443)
# Remplacement de la frame 22440 par 22444
video = ReplaceFrames(video, 22440, 22440, 22444, 22444)

# Remplacement de la frame 22454 par 22453
video = ReplaceFrames(video, 22454, 22454, 22453, 22453)

# Retourner le résultat final
return video
Reply


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

Forum Jump:


Users browsing this thread: 2 Guest(s)