How to add subtitles to a QuickTime movie

1.3k views Asked by At

I'm using the AxQTOControlLib.AxQTControl QuickTime C# COM component to display video in my software. I would like to add subtitle to the video.

I know that quicktime file can embed subtitle using the following string format:

{QTtext}{font:Arial}{plain}{size:12}{textColor: 65535, 65535, 65535}{backColor: 0, 0, 0}  
{justify:left}{timeScale:15}{width:587}{height:33}{timeStamps:absolute}{language:0}
{textEncoding:256}

[0:00:00.10]
I said hello, Dolly,

[0:00:03.10]
Well, hello, Dolly

[0:00:06.20]
It's so nice to have you back where you belong

...

Unfortunately I'm unable to found any information of how add this text track to the movie programaticaly...

I tried another solution consisting of adding transparent System.Windows.Form.Label above the AxQtControl but the transparency doesn't work.

Any idea?

2

There are 2 answers

1
brennanyoung On

You used to be able to open those files into quicktime player (or any quicktime playback gadget) and it would become a text track automagically. (Just as importing an mp3 file becomes an audio track). Have you tried that?

Once it's a movie track, you add it like any other.

3
Thomas Ayoub On

Maybe something like that (sorry for VB):

With AxQTControl2.Movie 
Dim trkSubtitle As QTTrack = .Tracks(.Tracks.Count) 
If Not trkSubtitle Is Nothing Then 
    trkSubtitle.top = .Height - trkSubtitle.Height
    trkSubtitle.TransferMode = QTTransferModesEnum.qtTransferModeBlend 
    trkSubtitle.OperationColor = "32768, 32768, 32768" 
    trkSubtitle.HighQualityMode = True 
End If 
.Time = 0 
.SelectionDuration = 0
End