hello,
I'm working on a video , for personnal use only, and the vide has some burnt subtitles. So I decided to use the Skier's AVS script from https://forum.videohelp.com/threads/358181-How-to-remove-hard-coded-subtitles-HELP-PLE...SE#post2481785
For that script, it works perfectly, The result is quite good. Look at this my script for harcoded subtitles :
LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\exorcist.vdf", "Exorcist", 1)
LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\Bright.vdf", "Brightness_Contrast", 1)
SubtitleTopLeftX = 298
SubtitleTopLeftY = 790
SubtitleTopRightX =1620
SubtitleTopRightY = 790
clip = DirectShowSource("F:\****.mkv").ConvertToRGB32()
maskclip = Levels(clip, 113, 10.000, 255, 75, 210)
maskclip = GeneralConvolution(maskclip, 0, "
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10 ", 256, false)
clip2 = OverLay(clip,maskclip,0,0,mode="subtract")
clip2 = Blur(clip2, 1.58)
clip2 = ConvertToYUY2(clip2)
clip2= Tweak(clip2, hue=25.7,bright=32,cont=7.0)
maskclip = Crop(clip2, SubtitleTopLeftX,SubtitleTopLeftY,-SubtitleTopLeftX,80).ConvertToRGB32.crop(0,0,0,-2).Trim(0,0)
maskclip = maskclip.Brightness_Contrast(-254, 32)
maskclip = ConvertToYUY2(maskclip)
maskclip = Tweak(maskclip, hue=-180.0,sat=0.0,bright=22,cont=10.0)
maskclip = ConvertToRGB32(maskclip)
maskclip = maskclip.Levels(0, 0.281, 100, 6, 177)
maskclip = maskclip.Greyscale()
maskclip = maskclip.Exorcist(2, 100)
maskclip = maskclip.Exorcist(-2, 100)
maskclip = maskclip.Brightness_Contrast(-21, 32)
maskclip = GeneralConvolution(maskclip, 0, "
25 25 25 25 25
25 25 25 25 25
25 25 25 25 25
25 25 25 25 25
25 25 25 25 25 ", 256, false)
maskclip = maskclip.Core(116,0)
maskclip = maskclip.Blur(1.58)
clip = dekafka(clip, maskclip, SubtitleTopLeftX, SubtitleTopLeftY, maskclip.width, maskclip.height,216)
clip = ConvertToYV12(clip)
return clip
Then I want to insert an image, at X frame of the video. so my script for this is :
on these 4 lines, my script works perfectlyDirectShowSource("F:\***.mkv").ConvertToRGB32()
logo = ImageSource("C:\Users\***\Desktop\test2.png").Conv ertToRGB32()
logooverlay = Overlay(logo, x=0, y= 0, mode="blend")
Trim(0,4312) ++ logooverlay.Trim(4313,4424) ++ Trim(4425,150626)
But when I decide to put it on my previous long script (the harcoded subtitles script), the script for adding image seems to not working. I dont have avisynt error, but the image don't appear on the screen
Could someone have some idea please ? Why I can't "join" 2 scripts like this ?
Is it possible ? if yes, how ?
thanks a lot.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 17 of 17
Thread
-
-
The Return line at the end of the first script is the end of it. Anything following it would be ignored.
From near the end of your first script, try something like this. I'm assuming both scripts refer to the same DirectShowSource video? If so, it's probably easier to keep "Clip" assigned only to the source video.
Here, the output of the first script becomes NewClip1 and the image is overlayed on that as NewClip2, rather than overlaying it on an unprocessed version of the DirectShowSource video. I assume that's what you're wanting to do?
maskclip = maskclip.Core(116,0)
maskclip = maskclip.Blur(1.58)
NewClip1 = dekafka(Clip, maskclip, SubtitleTopLeftX, SubtitleTopLeftY, maskclip.width, maskclip.height,216)
# skip the ConvertToYV12 and Return lines at the end of the first script
# skip the DirectShowSource line at the beginning of the second script.
Logo = ImageSource("C:\Users\***\Desktop\test2.png")
NewClip2 = Overlay(NewClip1, Logo, x=0, y= 0, mode="blend")
# Change NewClip1 to Clip in the line above, if you want to overlay the image on an unprocessed version of the source video.
NewClip1.Trim(0,4312) ++ NewClip2.Trim(4313,4424) ++ NewClip1.Trim(4425,150626)
ConvertToYV12()Last edited by hello_hello; 14th Oct 2018 at 02:59.
-
hello
thanks for answers, so now it works perfectly
however, I need some other help, always in this script.
I would if possible to blur hardcoded subtitles only between frame number 4740 and frame number 132834.
I tried to put
.Trim(4740, 132834)
after this line
clip2 = OverLay(clip,maskclip,0,0,mode="subtract")
but it doesn't work : the mask seems to be "copied" only between 4740 and 132834 frames
how could I just blur my hardocded subtitles only between 4740 and 132834 frames ? where do I must put my Trim script ?
thanks so much -
Remember the original clip then use ReplaceFramesSimple(original, nosubs, mappings="[4740 132834]").
-
hello, thanks
I've tried, even with replacing original and deleting nosubs, but, I've got some error for this line
in the avisynth wiki they said
ReplaceFramesSimple(baseClip, sourceClip, mappings="[10 20] 25 30")
in my first clip (of first message here) what are my baseClip and my sourceClip ?
In fact, now, my entire script is for the full length of my video. I don't want to remap or replace frame, I just want my script ONLY between 4340 and 132834 frames, not the full video
do you see what I mean ?Last edited by sulkiyan; 14th Oct 2018 at 08:20.
-
RemapFramesSimple replaces frames in the first clip with the specified frames from the second clip.
Last edited by jagabo; 14th Oct 2018 at 09:09.
-
I understand what RemapFramesSimple do, but I've got only ONE video, not two.
And when I try your script, all my entire script for removing hardcoded subtitless is "cancelled" : I see again all hardcoded subtitles
do you help me with the good syntax please ? -
-
yes I saw it
this is what i added at the end of my entire script
clip = DirectShowSource("F:\***.mkv").ConvertToRGB32()
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\RemapFrames.dll")
ReplaceFramesSimple(clip, maskclip, mappings="[4740 132834]")
I tried all possible things for replaceframessimple (sourceclip and baseclip), and at each time, it's not working -
sourcelclip and baseclip are symbolic names in the examples. Replace them with the names of the clips in your script.
I don't have some of the filters you're using, or a suitable test clip, so I can't test this -- but I think it will work:
Code:LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\exorcist.vdf", "Exorcist", 1) LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\Bright.vdf", "Brightness_Contrast", 1) SubtitleTopLeftX = 298 SubtitleTopLeftY = 790 SubtitleTopRightX =1620 SubtitleTopRightY = 790 original = DirectShowSource("F:\****.mkv") clip = ConvertToRGB32(original) maskclip = Levels(clip, 113, 10.000, 255, 75, 210) maskclip = GeneralConvolution(maskclip, 0, " 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ", 256, false) clip2 = OverLay(clip,maskclip,0,0,mode="subtract") clip2 = Blur(clip2, 1.58) clip2 = ConvertToYUY2(clip2) clip2= Tweak(clip2, hue=25.7,bright=32,cont=7.0) maskclip = Crop(clip2, SubtitleTopLeftX,SubtitleTopLeftY,-SubtitleTopLeftX,80).ConvertToRGB32.crop(0,0,0,-2).Trim(0,0) maskclip = maskclip.Brightness_Contrast(-254, 32) maskclip = ConvertToYUY2(maskclip) maskclip = Tweak(maskclip, hue=-180.0,sat=0.0,bright=22,cont=10.0) maskclip = ConvertToRGB32(maskclip) maskclip = maskclip.Levels(0, 0.281, 100, 6, 177) maskclip = maskclip.Greyscale() maskclip = maskclip.Exorcist(2, 100) maskclip = maskclip.Exorcist(-2, 100) maskclip = maskclip.Brightness_Contrast(-21, 32) maskclip = GeneralConvolution(maskclip, 0, " 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 ", 256, false) maskclip = maskclip.Core(116,0) maskclip = maskclip.Blur(1.58) clip = dekafka(clip, maskclip, SubtitleTopLeftX, SubtitleTopLeftY, maskclip.width, maskclip.height,216) clip = ConvertToYV12(clip) # at this point "original" is the original video, "clip" is the video with subs removed ReplaceFramesSimple(original, clip, mappings="[4740 132834]") logo = ImageSource("C:\Users\***\Desktop\test2.png").ConvertToRGB32() logooverlay = Overlay(logo, x=0, y= 0, mode="blend") Trim(0,4312) ++ logooverlay.Trim(4313,4424) ++ Trim(4425,150626)
Last edited by jagabo; 14th Oct 2018 at 10:23.
-
thanks, after modifications, I don't have error, but the script for removing the subs is ALWAYS applied for the ENTIRE video, not for video part between 4740 and 132834 frames.
it's strange -
I haven't used ReplaceFrames, and I'm still not 100% sure what you're wanting to do, but I assume for the script below "Clip" is the source video, "Clippy" would be a second source video if you're using one (otherwise you don't need that line), "NewClip1" is the clip with blurred subtitles, and "NewClip2" is the clip with the overlayed image. You can overlay the image on "Clip", "Clippy" or "NewClip1", whichever you specify for Overlay(), and it'll be "NewClip2".
Code:LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\exorcist.vdf", "Exorcist", 1) LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\Bright.vdf", "Brightness_Contrast", 1) SubtitleTopLeftX = 298 SubtitleTopLeftY = 790 SubtitleTopRightX =1620 SubtitleTopRightY = 790 Clip = DirectShowSource("F:\****.mkv").ConvertToRGB32() Clippy = DirectShowSource("F:\****.mkv").ConvertToRGB32() # if the clip for overlaying the image is different to the previous one maskclip = Levels(clip, 113, 10.000, 255, 75, 210) maskclip = GeneralConvolution(maskclip, 0, " 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ", 256, false) clip2 = OverLay(clip,maskclip,0,0,mode="subtract") clip2 = Blur(clip2, 1.58) clip2 = ConvertToYUY2(clip2) clip2= Tweak(clip2, hue=25.7,bright=32,cont=7.0) maskclip = Crop(clip2, SubtitleTopLeftX,SubtitleTopLeftY,-SubtitleTopLeftX,80).ConvertToRGB32.crop(0,0,0,-2).Trim(0,0) maskclip = maskclip.Brightness_Contrast(-254, 32) maskclip = ConvertToYUY2(maskclip) maskclip = Tweak(maskclip, hue=-180.0,sat=0.0,bright=22,cont=10.0) maskclip = ConvertToRGB32(maskclip) maskclip = maskclip.Levels(0, 0.281, 100, 6, 177) maskclip = maskclip.Greyscale() maskclip = maskclip.Exorcist(2, 100) maskclip = maskclip.Exorcist(-2, 100) maskclip = maskclip.Brightness_Contrast(-21, 32) maskclip = GeneralConvolution(maskclip, 0, " 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 ", 256, false) maskclip = maskclip.Core(116,0) maskclip = maskclip.Blur(1.58) NewClip1 = dekafka(Clip, maskclip, SubtitleTopLeftX, SubtitleTopLeftY, maskclip.width, maskclip.height,216) Logo = ImageSource("C:\Users\***\Desktop\test2.png") NewClip2 = Overlay(Clippy, Logo, x=0, y= 0, mode="blend") # specify Clip, Clippy or NewClip1 as the video to overlay the image, whichever you want to use. Clip.Trim(0,4312)\ ++ NewClip2.Trim(4313,4424)\ ++ Clip.Trim(4425, 4739)\ ++ NewClip1.Trim(4740, 132834) ConvertToYV12()
Clip.Trim(0,4312)\
++ NewClip2.Trim(4313,4424)\
++ Clip.Trim(4425, 4739)\
++ NewClip1.Trim(4740, 132834)
ConvertToYV12()
I can't test it either, but that should work.Last edited by hello_hello; 14th Oct 2018 at 12:15.
-
here my entire script
LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\exorcist.vdf", "Exorcist", 1)
LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\Bright.vdf", "Brightness_Contrast", 1)
SubtitleTopLeftX = 298
SubtitleTopLeftY = 790
SubtitleTopRightX =1620
SubtitleTopRightY = 790
original = DirectShowSource("F:\***.mkv")
clip = ConvertToRGB32(original)
maskclip = Levels(clip, 113, 10.000, 255, 75, 210)
maskclip = GeneralConvolution(maskclip, 0, "
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10 ", 256, false)
clip2 = OverLay(clip,maskclip,0,0,mode="subtract")
clip2 = Blur(clip2, 1.58)
clip2 = ConvertToYUY2(clip2)
clip2= Tweak(clip2, hue=25.7,bright=32,cont=7.0)
maskclip = Crop(clip2, SubtitleTopLeftX,SubtitleTopLeftY,-SubtitleTopLeftX,80).ConvertToRGB32.crop(0,0,0,-2).Trim(0,0)
maskclip = maskclip.Brightness_Contrast(-254, 32)
maskclip = ConvertToYUY2(maskclip)
maskclip = Tweak(maskclip, hue=-180.0,sat=0.0,bright=22,cont=10.0)
maskclip = ConvertToRGB32(maskclip)
maskclip = maskclip.Levels(0, 0.281, 100, 6, 177)
maskclip = maskclip.Greyscale()
maskclip = maskclip.Exorcist(2, 100)
maskclip = maskclip.Exorcist(-2, 100)
maskclip = maskclip.Brightness_Contrast(-21, 32)
maskclip = GeneralConvolution(maskclip, 0, "
25 25 25 25 25
25 25 25 25 25
25 25 25 25 25
25 25 25 25 25
25 25 25 25 25 ", 256, false)
maskclip = maskclip.Core(116,0)
maskclip = maskclip.Blur(1.58)
clip = dekafka(clip, maskclip, SubtitleTopLeftX, SubtitleTopLeftY, maskclip.width, maskclip.height,216)
ReplaceFramesSimple(original, clip, mappings="[4740 132834]")
logo = ImageSource("C:\Users\**\Desktop\test2.png")
NewClip2 = Overlay(clip, logo, x=0, y= 0, mode="blend")
clip.Trim(0,4312) ++ NewClip2.Trim(4313,4424) ++ clip.Trim(4425,150626)
original = DirectShowSource("F:\***.mkv")
clip = ConvertToRGB32(original)
LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\assrender.dll")
AssRender("C:\Users\*\Desktop\A.ass")
AssRender("C:\Users\*\Desktop\C.ass")
AssRender("C:\Users\*\Desktop\D.ass") -
Whenever you don't specify a clip by name the name "last" is used automatically. In your script ReplaceFramesSimple is creating a clip called last. Which is then ignored by the rest of the script which is using "clip" instead. Changing the line to "clip = ReplaceFramesSimple..." should take care of that problem. Then there are some useless lines near the end of the script.
Try this:
Code:LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\exorcist.vdf", "Exorcist", 1) LoadVirtualdubplugin("C:\Users\**\Desktop\Nouveau dossier (2)\plugins32\Bright.vdf", "Brightness_Contrast", 1) SubtitleTopLeftX = 298 SubtitleTopLeftY = 790 SubtitleTopRightX =1620 SubtitleTopRightY = 790 original = DirectShowSource("F:\***.mkv") clip = ConvertToRGB32(original) maskclip = Levels(clip, 113, 10.000, 255, 75, 210) maskclip = GeneralConvolution(maskclip, 0, " 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ", 256, false) clip2 = OverLay(clip,maskclip,0,0,mode="subtract") clip2 = Blur(clip2, 1.58) clip2 = ConvertToYUY2(clip2) clip2= Tweak(clip2, hue=25.7,bright=32,cont=7.0) maskclip = Crop(clip2, SubtitleTopLeftX,SubtitleTopLeftY,-SubtitleTopLeftX,80).ConvertToRGB32.crop(0,0,0,-2).Trim(0,0) maskclip = maskclip.Brightness_Contrast(-254, 32) maskclip = ConvertToYUY2(maskclip) maskclip = Tweak(maskclip, hue=-180.0,sat=0.0,bright=22,cont=10.0) maskclip = ConvertToRGB32(maskclip) maskclip = maskclip.Levels(0, 0.281, 100, 6, 177) maskclip = maskclip.Greyscale() maskclip = maskclip.Exorcist(2, 100) maskclip = maskclip.Exorcist(-2, 100) maskclip = maskclip.Brightness_Contrast(-21, 32) maskclip = GeneralConvolution(maskclip, 0, " 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 ", 256, false) maskclip = maskclip.Core(116,0) maskclip = maskclip.Blur(1.58) clip = dekafka(clip, maskclip, SubtitleTopLeftX, SubtitleTopLeftY, maskclip.width, maskclip.height,216) clip = ReplaceFramesSimple(original, clip, mappings="[4740 132834]") logo = ImageSource("C:\Users\**\Desktop\test2.png") NewClip2 = Overlay(clip, logo, x=0, y= 0, mode="blend") clip.Trim(0,4312) ++ NewClip2.Trim(4313,4424) ++ clip.Trim(4425,150626) LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\assrender.dll") AssRender("C:\Users\*\Desktop\A.ass") AssRender("C:\Users\*\Desktop\C.ass") AssRender("C:\Users\*\Desktop\D.ass")
-
No, it won't be necessary to copy th script just above.
I take the one on your previous post and I added ++ Clip.Trim(132935, 150626)
(you've forgot it :P and my video was cut at 132934 frame.
so now, everything is working perfectly
thanks so so much for your suggestions , appreciate
PS : before I go, I'm wondering if with some avs script I could put a logo following end credits ? OR do I make it with premiere pro ?
If you don't know, doesn't matter,
thanks so so much, see ya -
Just create a blank clip with the same properties as your video and overlay your logo, then append it at the end.
Similar Threads
-
Need a particular 3D avisynth script
By mazinz in forum Video ConversionReplies: 8Last Post: 25th Feb 2018, 04:55 -
Need help with AVISynth script
By duffbeer in forum DVD RippingReplies: 13Last Post: 8th Sep 2016, 16:05 -
Best possible AviSynth Script
By Suwadith in forum Video ConversionReplies: 31Last Post: 10th Sep 2015, 06:43 -
Help with the AVISynth script
By Tri P in forum Newbie / General discussionsReplies: 0Last Post: 24th May 2014, 06:22 -
avisynth - How to write avisynth script for rgba overlay
By moelover in forum EditingReplies: 3Last Post: 13th Apr 2014, 12:24