Forums > MaxMSP

Use .srt (subRipTile) or SSA (SubStation Alpha)

Jul 20 2010 | 9:48 pm

I want to use .srt (subRipTile) or SSA (SubStation Alpha) to add subtitles on video.
I know that Quicktime pro let see a movie with srt subtitle. The srt subtitle must have the same name with the movie in the same folder. uses Quicktime so we can use srt .
But i only have the free version of Quicktime which don’t work with subtitles.
Is there an other solution to do it?
Best regards

Jul 27 2010 | 7:21 am

I have try with quicktime pro but it don’t work.
I suppose that i should use Perian but it only work on Mac and i’m on Windows.
Is there an other way to use .srt (subRipTile) or SSA (SubStation Alpha) to add subtitles on video.
Is my question right or not?
Because nobody answer to me.
Have a nice day.

Jul 27 2010 | 2:36 pm

I’m pretty sure I’m correct in saying that doesn’t provide any particular help to you in dealing with .srt files, but you can write a program that synchronizes a .mov with a .srt. The .srt format is just plain text and very simple to parse. I think you could build your own in roughly the following way.

Use the text object or the js object to read in the .srt file. The js object would be my choice because you could also use it to parse the file, translate the timecode into QT timescale units, etc. Load the .mov into and query its timescale units with the ‘gettimescale’ message. You’ll need to use that value in order to convert the .srt timings into timescale units. As you play a .mov file in, you would need to continually poll its current time (in its native timescale units) by sending it the ‘time’ message. When the movie time equals or surpasses the start time of a subtitle, trigger the display of that subtitle, and when the time equals or surpasses the stop time of the subtitle trigger the end of the display of that subtitle and start looking to display the next one. By "trigger the display" I mean write the text of the subtitle into a jit.lcd object then composite that on top of the movie (using jit.op @op + or jit.alphablend), or another way would be to write the text into and render that on top of a that is showing the movie.

I guess that’s a verbose and complicated explanation. I don’t have time to write an example program, so I hope it’s clear. I don’t think it’s hard to do, but you do pretty much need to build it from scratch, I fear.

Jul 27 2010 | 9:34 pm

Thank you Christopher, now i see a way to do it.
Best regards.

Jul 30 2010 | 10:24 pm

I have made a patcher but i’m lost to convert the srt file and to synchronise it with the video.
Am i on the right way?
Can someone help me?
Here is my patcher and my srt file:

— Pasted Max Patch, click to expand. —

Have a nice day.

Aug 04 2010 | 10:56 pm

Is my question poorly worded?
Have a nice day.

Aug 06 2010 | 9:14 am

A little help for the JS Object?
Best regards

Viewing 7 posts - 1 through 7 (of 7 total)

Forums > MaxMSP