View Full Version : Intertitle - change?
color
2nd November 2022, 10:38
I have a movie and translated the intertitle. There is a alot of images, about 200. So I need a way to "change" them somehow. (replace the original)
I know about what frame they need to go on. Is there a "easy" way to just have "intertitle1-200" and just write what frames they need to replace? (like: intertitle1, 100, 150\intertitle2, 400, 500\intertitle3, 2020,2140 and so on)
I did try this, but it gets so confusing after first image, so I think I need to scrap this idea:
DirectShowSource("C:\Nosferatu.mp4")
intertitle1 = ImageSource("C:\Nosferatu.00.png")
Trim(0, 1123) + Trim(0, 2074).Overlay(intertitle1, 0, 00, opacity = 1.0) + Trim(3199, 0)
(Sorry english is my my first language, and long time ago I posted anything here)
VoodooFX
2nd November 2022, 12:38
I know about what frame they need to go on. Is there a "easy" way to just have "intertitle1-200" and just write what frames they need to replace?
Easy:
DirectShowSource("C:\Nosferatu.mp4") # never use this filter
i001 = ImageSource("C:\Nosferatu.00.png").Trim(0,-1).ConvertToYV12().Loop(3199 - 1123 - 1)
Trim(0, 1123) + i001 + Trim(3199, 0)
color
2nd November 2022, 14:09
Easy:
DirectShowSource("C:\Nosferatu.mp4") # never use this filter
i001 = ImageSource("C:\Nosferatu.00.png").Trim(0,-1).ConvertToYV12().Loop(3199 - 1123 - 1)
Trim(0, 1123) + i001 + Trim(3199, 0)
This is where I get confuse. So there isnt a easier way? Well, I will try again and see. I mess up a little here and there with the numbers and have problem locating where I do wrong.
I will try and see if its easier with how you would solve it.
Edit: i know there is other that directshowsource. Is ffmpegsource better? Or suggestions?
StainlessS
2nd November 2022, 16:56
Perhaps these threads of interest,
Script to detect intertitles? :- https://forum.doom9.org/showthread.php?t=167882&highlight=InterTitle
Extend duration of intertitles :- https://forum.doom9.org/showthread.php?t=182176&highlight=Intertitle
Is ffmpegsource better? Or suggestions?
For MP4, LSMashVideoSource() is suggested.
VoodooFX
2nd November 2022, 18:10
This is where I get confuse. So there isnt a easier way?
You can't have easier than the two numbers per cut/insert.
StainlessS
2nd November 2022, 18:55
Color, can you create a frames list for your source.
[InterTitleStartFrameNo, InterTitleEndFrameNo]
eg
100,150
2100,2150
I'll do a script to automate using only above framefile.
You'll need Current RT_Stats Beta, FrameSel(), FrameRepeat().
https://forum.doom9.org/showthread.php?t=167971&highlight=FrameSel
https://forum.doom9.org/showthread.php?t=168047&highlight=FrameRepeat
StainlessS
2nd November 2022, 20:11
OK, This works, however I never did do the FrameRepeat() filter in x64, only available for x86.
I'll see if I can do 64 bit dll.
(but below does work if you use x86)
ReplaceRangesWithImageDupes.avs
# ReplaceRangesWithImageDupes.avs # https://forum.doom9.org/showthread.php?p=1977671#post1977671
VFN = ".\Src.avi"
Images = ".\IMAGE\Nosferatu%02d.png".RT_GetFullPathname # only 2 digits in image name index (limited to 100 images)
Frames = ".\Frames.txt".RT_GetFullPathname
AviSource(VFN, Pixel_Type="YV12")
FPS = FrameRate
SRC = Last
# MAKE DBase of Ranges, start and end FrameNos
START_FIELD = 0
END_FIELD = 1
DB = ".\MyDBase.DB".RT_GetFullPathname
RT_DBaseAlloc(DB,0,"ii") # init, 0 records, 2 int fields
RT_DBaseReadCSV(DB, Frames, StartField=START_FIELD,EndField=END_FIELD)
Records = RT_DBaseRecords(DB) # Number of ranges in Frames file.
RT_DebugF("Records = %d",Records,name="ReplaceRangesWithImageDupes: ")
# Read Images
IMG = ImageSource(Images,fps=FPS,Start=0,End=Records-1) # End is 0 relative, ie records - 1
IMG = IMG.ConvertToYV12
# Make Temp Repeated IMAGE framesNos file
Tmp = ".\~TmpRepeatFile.txt".RT_GetFullPathname
RT_FileDelete(Tmp)
for(rec=0,Records-1) {
Start = RT_DBaseGetField(DB,rec,START_FIELD)
End = RT_DBaseGetField(DB,rec, END_FIELD)
Len = End - Start + 1
RT_WriteFile(Tmp, "%d, %d # Image(%d) : Range(%d , %d)", rec, Len, rec, Start, End, Append = True)
}
# Make Repeated IMAGE frames Clip
SHOW=False
IMG = FrameRepeat(IMG,Cmd=Tmp,Show=SHOW)
#Return IMG
# Replace frames in source clip
SHOW=False
FrameRep(SRC,IMG, cmd = Frames, show = SHOW)
# Closedown and cleanup
# RT_FileDelete(DB)
# RT_FileDelete(Tmp)
Return Last
UPDATES
As set up, You need IMAGE\ directory in current dir for images.
EDIT: Is limited to 100 intertitle replacements, due to only 2 digits in YOUR image name [ImageSource()], ie
Images = ".\IMAGE\Nosferatu%02d.png".RT_GetFullPathname # only 2 digits in image name index
Always use 6 digits in image index if you can do it automatically, is always more flexible. (a bit tedious if you have to do it by hand).
color
2nd November 2022, 20:50
OK, This works, however I never did do the FrameRepeat() filter in x64, only available for x86.
I'll see if I can do 64 bit dll.
(but below does work if you use x86)
ReplaceRangesWithImage.avs
# ReplaceRangesWithImage.avs
VFN = ".\Src.avi"
Images = ".\IMAGE\Nosferatu%02d.png".RT_GetFullPathname # only 2 digits in image name index
Frames = ".\Frames.txt".RT_GetFullPathname
AviSource(VFN, Pixel_Type="YV12")
FPS= Last.FrameRate
SRC = Last
# MAKE DBase of Ranges, start and end FrameNos
DB = ".\MyDBase.DB"
RT_DBaseAlloc(DB,0,"ii") # init, 0 records, 2 int fields
RT_DBaseReadCSV(DB, Frames, StartField=0,EndField=1)
Records = RT_DBaseRecords(DB) # Number of ranges in Frames file.
RT_DebugF("Records = %d",Records)
# Read Images
IMG = ImageSource(Images,fps=FPS,Start=0,End=Records-1) # End is 0 relative, ie records - 1
IMG = IMG.ConvertToYV12
# Make Temp Repeated IMAGE frames file
Tmp = ".\~TmpRepeatFile.txt".RT_GetFullPathname
RT_FileDelete(Tmp)
START_FIELD = 0
END_FIELD = 1
for(rec=0,Records-1) {
Start = RT_DBaseGetField(DB,rec,START_FIELD)
End = RT_DBaseGetField(DB,rec, END_FIELD)
Len = End - Start + 1
RT_WriteFile(Tmp, "%d, %d", rec, Len, Append = True)
}
# Make Repeated IMAGE frames Clip
SHOW=False
IMG = FrameRepeat(IMG,Cmd=Tmp,Show=SHOW)
#Return IMG
# Replace frames in source clip
SHOW=False
FrameRep(SRC,IMG, cmd = Frames, show = SHOW)
# Closedown and cleanup
# RT_FileDelete(DB)
# RT_FileDelete(Tmp)
Return Last
As set up, You need IMAGE\ directory in current dir for images.
EDIT: Is limited to 100 intertitle replacements, due to only 2 digits in YOUR image name [ImageSource()], ie
Images = ".\IMAGE\Nosferatu%02d.png".RT_GetFullPathname # only 2 digits in image name index
Always use 6 digits in image index if you can do it automatically, is always more flexible. (a bit tedious if you have to do it by hand).
Thank you, so much easier! I will try tomorrow. I dont know why my brain cant to numbers with trim. Thank you for your help! ☺️
StainlessS
2nd November 2022, 21:56
For this frames.txt
250,350
490,589
Here is ~TmpRepeatFile.txt
0, 101
1, 100
First image (0) repeated 101 times.
2nd image (1) repeated 100 times.
201 frame IMG clip result.
frames 250 -> 350 replaced with First image (0) repeated 101 times.
frames 490 -> 589 replaced with 2nd image (1) repeated 100 times.
Do report if worked OK, thanks.
I'll try do x64 dll and post.
StainlessS
3rd November 2022, 04:47
FrameRepeat v1.02 with x64, Done:- https://forum.doom9.org/showthread.php?p=1632538#post1632538
tormento
3rd November 2022, 10:46
What about using ASS type subtitles? They have great flexibility, such as animation, vector rendering, etc.
If you often have the need to render different title types, perhaps you should learn how to use them.
color
3rd November 2022, 11:27
What about using ASS type subtitles? They have great flexibility, such as animation, vector rendering, etc.
If you often have the need to render different title types, perhaps you should learn how to use them.
Well...Yes. That might also be an alternative, and does not need to re-encode the video as well.
I don't really know any software (or how to edit/create) ass-files. Cause they are bitmap each file?
Is it time-based or frame-based?
EDIT: Might Aegisub do the work?
kedautinh12
3rd November 2022, 12:01
I think Kainote is update very much of original aegisub and i think better than fork of aegisub (for me)
https://github.com/bjakja/Kainote
Boulder
3rd November 2022, 15:11
I'd use Subtitle Edit for any subtitling needs. It should support ASS type as well, at least it's in the list of extensions when loading a subtitle or saving one.
color
3rd November 2022, 16:38
I was suppose only to change and re-encode, but I rethinked after ASS was mentioned that It could be an even easier way and no need to re-encode as well.
I am still trying to figure out how to add the image in Kainote, I did try Subtitle Edit, but that seems to be only textbased editing and ocr from ass, not able to add images (or I might not understand how it really works, I have only done a few ocr in it before and translation once or twice).
BTW, how do I insert the image in Kainote? I have tried now in 2 hours and I think I don't really understand how it works.
StainlessS
3rd November 2022, 20:04
Post #7, Some minor changes (no bug fixes) to previous script. Updates on Blue.
Generated "~TmpRepeatFile.txt" from post #9, now as
0, 101 # Image(0) : Range(250 , 350)
1, 100 # Image(1) : Range(490 , 589)
Renamed script, ReplaceRangesWithImageDupes.avs
Does the given script work OK ?
Thanks.
color
3rd November 2022, 20:47
Post #7, Some minor changes (no bug fixes) to previous script. Updates on Blue.
Generated "~TmpRepeatFile.txt" from post #9, now as
0, 101 # Image(0) : Range(250 , 350)
1, 100 # Image(1) : Range(490 , 589)
Renamed script, ReplaceRangesWithImageDupes.avs
Does the given script work OK ?
Thanks.
I did try to get it to work. But it seems like I have one or more plugins that do not work. I will check a bit more tomorrow. (Had to do other stuff today).
And thank you for helping. ☺️
StainlessS
3rd November 2022, 21:30
FrameSel :- https://forum.doom9.org/showthread.php?t=167971&highlight=FrameSel
Direct Link[FrameSel_x86_x64_dll_v2-21_20210727.zip] :- https://www.mediafire.com/file/7piun32ojt2jjb7/FrameSel_x86_x64_dll_v2-21_20210727.zip/file
FrameRepeat :- https://forum.doom9.org/showthread.php?t=168047&highlight=FrameRepeat
Direct Link[FrameRepeat_25&26_x86_x64_dll_v1-02_20221103.zip] :- https://www.mediafire.com/file/ngibp5etmsqv73z/FrameRepeat_25%252626_x86_x64_dll_v1-02_20221103.zip/file
Direct Link: RT_Stats 2.0 Beta 13 :- https://www.mediafire.com/file/xa3t1wx234gyzfq/RT_Stats_25%252626_x86_x64_dll_v2.00Beta13_20201229.zip/file
Direct links current at time of posting links.
All three have dlls for Avs v2.58, v2.6/+ x86 and Avs+ x64.
EDIT: Rename dlls from eg, FrameRepeat_x64.dll to FrameRepeat.dll before copy to Plugins. [avoid multiple dll's under different names]
All 3 (I think) require Visual studio 2008 runtimes.
EDIT:
AOI [All-In-One] VisualStudio Runtimes, up to VS 2022. By abbodi1406 (current as of 15 days ago):- https://github.com/abbodi1406/vcredist/releases
About 25MB [much smaller than downloading all from M$ - only single instance of installer/housekeeping files where necessary, so smaller].
Installs all from single double click on the exe. [close down all apps before execution, maybe reboot a good idea afterwards].
EDIT: The script requires AVS+. [could be modified for avs 2.6std and avs 2.58 wrapping for() loop stuff in GSCript(""" ... """), ie
GScript("""
for(rec=0,Records-1) {
Start = RT_DBaseGetField(DB,rec,START_FIELD)
End = RT_DBaseGetField(DB,rec, END_FIELD)
Len = End - Start + 1
RT_WriteFile(Tmp, "%d, %d # Image(%d) : Range(%d , %d)", rec, Len, rec, Start, End, Append = True)
}
""")
EDIT: Of course, that would require the GScript plugin too.
kedautinh12
4th November 2022, 02:48
With Kainote you can click video -> open -> all types -> choose your image
kedautinh12
4th November 2022, 03:18
Latest beta ver if you want
https://drive.google.com/uc?id=1ECqsrLo5d1jPoz-FKvJrS0279YeTKrmS&export=download
color
4th November 2022, 20:38
With Kainote you can click video -> open -> all types -> choose your image
I have not had a lot of time to try everything yet. I did try but it opens an image as a video file? I dont understand how I export and import multiple images and set timer.
I did however find this:
https://github.com/py7hon/IMG2ASS
So I will try, still dont understand where to put the code
kedautinh12
5th November 2022, 01:52
You can ask new feature to author
https://github.com/bjakja/Kainote/issues
tormento
5th November 2022, 13:36
So I will try, still dont understand where to put the code
Why are you trying to insert an image when you could superimpose a different text + background anyhow you want with ASS?
color
5th November 2022, 13:41
Why are you trying to insert an image when you could superimpose a different text + background anyhow you want with ASS?
I do want to try both version, if future will need reencode that will be easy task to fix then when I know how to do.
But I will do ASS this time for this movie. But I got a shorter movie I want to reencode with images replaced
color
5th November 2022, 19:54
Color, can you create a frames list for your source.
[InterTitleStartFrameNo, InterTitleEndFrameNo]
eg
100,150
2100,2150
I'll do a script to automate using only above framefile.
You'll need Current RT_Stats Beta, FrameSel(), FrameRepeat().
https://forum.doom9.org/showthread.php?t=167971&highlight=FrameSel
https://forum.doom9.org/showthread.php?t=168047&highlight=FrameRepeat
Ah, I got it to work, I just realised I started the first image with name 01 instead of 00. :D
Thank you. Works like a charm.
(I didn't get the subtitle thing to work at all, so I go for the swap image.) :D
BTW, Can I download all your plugins and put in avisynt+ or may that be some conflicts with other plugins?
StainlessS
5th November 2022, 20:07
Thanks for the feedback.
Just make sure that you remove any eg "_x86" or "_x64" from eg SomePlug_x64.dll" and should be no conflict.
(I would remove those from all plugins, not just mine)
color
6th November 2022, 06:48
Thanks for the feedback.
Just make sure that you remove any eg "_x86" or "_x64" from eg SomePlug_x64.dll" and should be no conflict.
(I would remove those from all plugins, not just mine)
I will do so. And thank you again.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.