I'm referring to image based subs. The reason I'm asking is because the alignment info is lost when an image based sub is converted into srt. And if I would have a list of the lines not aligned bottom I could manually fix the corresponding lines in the srt file.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 20 of 20
Thread
-
Last edited by teodargent; 5th Jun 2019 at 16:58.
-
Don't know of any tool which does what you want out of the box.
There are multiple image based subtitle formats, assuming you have a format which contains position data it should be possible to read this data and output it together with the time stamp (and/or file position).
Got a sample of an image based subtitle file which has subtitles placed at the bottom and subtitles that are not placed at the bottom?users currently on my ignore list: deadrats, Stears555 -
-
Here's an example using your Blade Runner sub/idx:
Code:BlankClip(width=720, height=576, length=180000, fps=25, pixel_type="YV12") #Mpeg2Source("Blade Runner (1982).d2v").ColorYUV(gain_y=-256) VOBSUB("Blade Runner (1982)") Crop(0,0,-0,504) Subtract(last, Loop(2,0,0)) WriteFileIf(last, "nonbottom.txt", "(AverageLuma(last) > 126.01)", "current_frame/framerate", append = false)
Code:126.879997 131.520004 135.639999 139.199997 144.440002 147.720001 151.639999 156.679993 162.279999 165.720001 ...
The script took about 3 minutes to run with 64 bit AviSynth+.
Oh, I forgot to mention: I used VirtualDub to play through the entire script as fast as possible via File -> Run Video Analysis Pass. -
You just have to find an AviSynth filter that renders pgs/sup subs. I've never used it but... http://avisynth.nl/index.php/SupTitle Then use it instead of VOBSUB().
-
By the way, you'll have to change the frame dimensions, cropping, and maybe the frame rate to match the BD.
-
I only changed crop to Crop(0,0,-0,400) and it worked fine even though the BD is 1080p 23.976 fps
-
I don't know how VOBSUB() handles subs that are positioned outside the frame. Maybe it scales the output to the frame size. Or maybe it just doesn't render the parts that would fall outside the frame. So the script may have run and produced an output file, but that file may not reflect all subs that aren't on the bottom line. I recommend you try 1920x1080 and see how the list compares to your 720x576 run.
-
It looks like it scales the subs. The first screenshot is at 720x576, the second at 1920x800 (same as the subs source).
[Attachment 49275 - Click to enlarge]
[Attachment 49276 - Click to enlarge]
Also the output was the same but at the higher resolution took a lot longer to complete. Is it possible to also have a visual output while processing? Like seeing the actual frames with the top aligned subs.Last edited by teodargent; 5th Jun 2019 at 16:59.
-
If you want to see the full frame with subtitles:
Code:BlankClip(width=720, height=576, length=180000, fps=25, pixel_type="YV12") VOBSUB("Blade Runner (1982).idx") src=last Crop(0,0,-0,504) # remove bottom line of subs Subtract(last, Loop(2,0,0)) WriteFileIf(last, "nonbottom.txt", "(AverageLuma(last) > 126.01)", "current_frame/framerate", append = false) StackHorizontal(src, last.AddBorders(0,0,src.width-last.width, src.height-last.height))
Another possibility is to overlay the test clip onto the video. Instead of StackHorizontal() use:
Code:Overlay(src, last, opacity=0.5) # use any opacity you want
-
Hi! I just tried SupTitle but I can't get it to work. I tried this and it worked:
Code:LoadPlugin("C:\Program Files (x86)\AviSynth\plugins\ffms2.dll") FFVideoSource("v.avi") SupTitle("C:\Users\Teodor\Desktop\Extract subs alligned top\s.sup")
Code:BlankClip(width=720, height=576, length=320000, fps=25, pixel_type="YV12") SupTitle("C:\Users\Teodor\Desktop\Extract subs alligned top\s.sup")
-
Those sup subs probably came from a Blu-Ray disc. They expect a frame size of 1920x1080. You can upscale your source, add the subs, then downscale back to the original size -- but the subs will be really tiny.
-
Sorry but I'm a total noob and I didn't understand what you meant. I tried this:
Code:BlankClip(width=1920, height=1080, length=320000, fps=25, pixel_type="YV12") SubTitle("C:\Users\Teodor\Desktop\Extract subs alligned top\s.sup") src=last Crop(0,0,-0,500) # remove bottom line of subs Subtract(last, Loop(2,0,0)) WriteFileIf(last, "nonbottom.txt", "(AverageLuma(last) > 126.01)", "current_frame/framerate", append = false) Overlay(src, last, opacity=0.5) # use any opacity you want
-
A black clip is ok. You called SubTitle() instead of SupTitle(). Cropping 500 lines seems excessive. Maybe you only care about the top half?
-
*facepalm*
Yes, that is what I care about.
Anyway, using SupTitle and 1920x1080 works fine but takes a long time to complete. Since Suptitle does not resize the subs like VOBSUB, I found that the best workaround is to convert the the .sup subs in vobsub using BDSup2Sub and then use the script with VOBSUB (240x100, very fast). -
Yes, the larger frame takes longer to complete. And note that your script created a ~3.5 hour blank clip. Probably longer than the real movie. Specifying the real runtime of the movie would cut down the processing time. Or you can just terminate processing once the preview has exceeded the movie length.
Similar Threads
-
Anyone know of a sub program that will break long lines into 3 lines?
By JeremyBrown in forum SubtitleReplies: 19Last Post: 13th Apr 2020, 19:03 -
Distorted bar at bottom of video
By RS456 in forum CapturingReplies: 68Last Post: 10th Mar 2019, 23:35 -
DVDR with Lines on Top and Lines on Bottom?
By Disco Makberto in forum MediaReplies: 13Last Post: 14th Feb 2015, 03:34 -
Lines at the bottom when capturing VHS to DVD
By Papermouse in forum Newbie / General discussionsReplies: 3Last Post: 3rd Oct 2014, 08:21 -
Hi8 noise at bottom - not overscan - what causes it?
By cym in forum CapturingReplies: 12Last Post: 17th Sep 2014, 06:51