Importing Subtitles from a Text File into FCP X

Greetings,


I am trying to import a Text File with Timecode and Subtitles into FCP X.

Right now, it's in a .txt file with the following format:

TC_start_1 TC_end_1

Title 1

TC_start_2 TC_end_2

Title 2

etc...


Also, I'd like to have the lines broken at word boundaries when they cross say 35 characters.


I can manipulate the text in Python, so there's some flexibility there.


Is there an easy way of getting it into FCP X 10.2.2?


Thanks in advance for your help.

Rajnesh

MacBook Pro (Retina, Mid 2012), OS X El Capitan (10.11.2), 16GB RAM, NVIDIA GeForce GT 650M 1G

Posted on Jan 10, 2016 11:22 PM

Reply
10 replies

Nov 30, 2017 4:06 AM in response to Drc937

Since my X-Title Importer was mentioned in the thread a few notes on it here.

As said above there are several import options.

One is to import "Un-timed text" like:

"this is sub 1


and sub 2

with 2 lines


followed by sub 3"

The text has to be divided by double returns. The app will create a new sequence with title types of choice. The duration is calculated by a user defined "reading speed". Gaps can be pre-defined as well.


Another option is the "User TC text"


Compared to Subtitle 4.0 there are several advantages:

Title of choice (includes DH Subtitle_x), easy access to any subtitle in the Timeline Inspector (Text, Role etc.), text "search and replace" and individual access to each title.

Additionally these subtitles also can be exported to various subtitle types if needed and usage for small projects is free. If you have time and split larger projects into chunks then it is a totally free app 🙂

Nov 28, 2017 3:06 PM in response to Drc937

In the File generator, there is a parameter called Speed. It is set to Constant by default. You need to change it to Custom. Once Custom is selected, you will get a Custom Speed parameter (which is pre-keyframed from 0 to 100%). It is usually useful to Reset Parameter to clear the pre-keyframing of the Custom Speed parameter, then set the first keyframe at 0% on the first frame of the project. After that, play your video and advance the Custom Speed parameter to the matching line (a new keyframe will automatically be set at that point).


Use the technique outlined above to turn the "Linear" (by default) keyframes into Constant (stepwise changes).


HTH

Jan 11, 2016 9:32 PM in response to Rajnesh Domalpalli

Motion is cheaper... by half.


With Motion you don't have to deal with time codes. Just lines of text. I've got to take care of some stuff right now, but I'll get back on in an hour or so and fill in the details. It's a little lengthy and I have to find my notes on the tutorial I was working on... It's definitely a different way of doing things than most people are used to. You basically import the txt file (as double spaced lines of text), then keyframe the lines. Save as a generator. Apply to the project. When you're done - throw it out. It can't be templated.


BBL

Jan 12, 2016 2:27 AM in response to Rajnesh Domalpalli

OK, I'm back.

The long version:


.srt files look like this: [It's a Wonderful Life opening]

———————————————

1

00:01:23,920 --> 00:01:29,480

I owe everything to George

Bailey... Help him, dear Father.


2

00:01:29,520 --> 00:01:35,320

Joseph, Jesus and Mary.

Help my friend, Mr. Bailey.


3

00:01:35,680 --> 00:01:38,840

Help my son, George, tonight.


4

00:01:38,880 --> 00:01:42,600

He never thinks about himself,

God, that's why he's in trouble.


5

00:01:42,680 --> 00:01:46,840

George is a good guy.

Give him a break, God...

———————————————

For Motion -- all those numbers have to go. If you don't have it already, download TextWrangler (it's free) and open the srt file. Go to Search > Find and in the dialog, make sure Grep is checked. In the find box type this regular expression:

\d.*\n

What this roughly translates into is:

find every line that starts with a decimal character and select everything until the end of the line.

There's a small square with a 'g' on it and a disclosure triangle. Click that and select Save - name the pattern something like "strip SRT numbers".

Click the Replace All button. The result will look like:

_____________________________

I owe everything to George

Bailey... Help him, dear Father.


Joseph, Jesus and Mary.

Help my friend, Mr. Bailey.


Help my son, George, tonight.


He never thinks about himself,

God, that's why he's in trouble.


George is a good guy.

Give him a break, God...


_______________________________

Add a first blank line then Save the file as xxxxxx-chapterX.txt for importing into Motion.


The extra empty lines are a good thing (sometimes you need to "blank" the text) and in general, I recommend at least double spacing throughout the file, in most cases.


While I'm at it, full length motion pictures are a little too much to manage, so I highly recommend cutting the file sizes down to "chapter sized" chunks... it will make things very much easier. 100 lines each would be about ideal (you'll see it when you start working with it - but you are not limited to that.)


If you make smaller file size chunks, then from FCPX export the corresponding Ranges (ProRes Proxy -- smaller, easier and you'll be throwing away the clips afterwards anyway.) [You can opt to use Audio only as well, but the visual cues help speed things up sometimes.]


Create a Generator project (you will want to save this "template project" to FCPX directly.)

Import a chapter video into Motion. Adjust the Project Length to the length of the imported video (very easy to do and there's a couple of different ways to accomplish it... )


From the generators menu, add Generators > Text Generators > File to the project.

User uploaded file


In the Inspector for the File Generator, click the Browse button and load up your text file. Set the Speed to Custom and immediately Reset the Custom Speed when it appears (the default action is to play each line in order at a fixed rate of speed.) The Custom Speed parameter is based on percentage (0 - 100%) so you can see why 100 lines per text file is ideal.


Move the playhead to the beginning of the project and set the first keyframe at 0%.

Play the file and for each line spoken, [pause play] set a keyframe by option dragging the Custom Speed value until the appropriate line appears. Continue this process until the last line of the file. [You can adjust keyframe positions now or later for more precision... often, close enough is good for subtitles.]


All the keyframes will be linear in nature and when you play the file, the lines will go from one to the next and be mostly out of sync from your keyframes. NOT a big deal!


Open the keyframe editor (with the File generator selected) and select any keyframe, then type Command-A to select all of them. Then right click on any keyframe and from the pop-up menu, select Interpolation > Constant. This creates a Step-wise change from keyframe to keyframe and syncs all the text up to the audio. [The blank lines between sentences helps blank them out for long pauses and is why they're important!]


If you got this far, it sounds like a lot. It's not (except for following the audio and timing the keyframes, which is kind of tedious) but in exchange for typing in all the TC and line number data, it's a much easier option.


Before saving, you can use the Text > Format to select the font styles you like, and you can use Properties > Transform > Position (and keyframe these if you need to move the text around the canvas - use the interpolation > constant trick on this as well). [You won't get this feature with regular subtitling.]


When you're satisfied with the subtitles, Save the generator (create a category called Subtitles) and name it with the video and chapter used.


In FCPX, find the time position you need to start the subtitles and place the corresponding generator at the location... move on to the next and the next etc... At this point, it's that easy. (For the non-subtitled version, select all the generators and type V to disable them.)


When you're done with the project, go into the Finder and throw them all in the trash. If you have no further use for the project, they will be a waste of space.


PS - cutting a script file into 100-line chunks is easy with TextWrangler - just turn on line numbers for a guide. When you make the selection, you can find the word count at the buttom right edge of the document (the stats are: characters/words/lines - right next to the view zoom size drop-down menu at the end.... if you need to estimate the length of time by the number of words.)


PPS - this method can only display one distinct line at a time, and it's not easy to do a multi-line display of several nearly simultaneous spoken lines. It may become necessary to break the some parts of the script into speaker one, speaker two files and you really can't do two File generators at once (due to a perceived bug [could be a feature - you never know with Apple] in Motion... which might be fixed by now - I just don't know.) The File generator recognized line breaks, but it doesn't "print" them on the screen if you know what I mean. As part of the text formatting, you can use a Paragraph style Layout > Layout Method and manipulate Line Wraps (by use of extra space characters in the text.) I haven't experimented a lot with that so I can't really tell you (and it's been months since I've dealt with subtitles in general).


Hope this helps. Save your money. Buy Motion. It can be used for so much more than just subtitles.

Jan 12, 2016 11:04 AM in response to fox_m

Thank you, so very much, fox_m. It was really nice of you to take the time and help.


I bought FxFactory's Subtitle Plugin for FCP X (before I read your email) and overall, I've been happy with their functionality and integration into FCP X. They have, what they call, a UserTC format to enter subtitles, and given what I received from our S. Korean correspondent, it fit our needs pretty well.


Their documentation and error message reporting could be better, but in a few days, I'll have a clearer picture. I'll post back then.


Thanks again and take care.

Rajnesh

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Importing Subtitles from a Text File into FCP X

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.