Caption manager

Home » Caption manager


Cap­tion mana­ger is a free online device crea­ting files that dis­play sub­titles on videos.

The input data is a set of trans­crip­tion files crea­ted by a ser­vice such as Deep­Trans­cript — Otter.ai and Whis­per­Trans­cribe are alter­nate options — and optio­nal­ly cor­rec­ted with Gram­mar­ly.

Because Whis­per­Trans­cribe creates sub­title files direct­ly (in VTT or SRT for­mat), you may not need Cap­tion mana­ger to create mono­lin­gual sub­titles, but you can still load an SRT file for addi­tio­nal cor­rec­tions. An advan­tage of using Deep­Trans­cript is explai­ned in sec­tion Trans­la­ted trans­crip­tions.

The final out­put is a set of cap­tion files that will dis­play sub­titles over a video player or a Word­Press web­site. Below is a sample 3‑hour video used to illus­trate the pro­cess. Sub­titles have been crea­ted in the video’s source lan­guage (English), and then trans­la­ted to French, Spa­nish and Ita­lian.

How it works

To create the trans­crip­tion file in the video’s source lan­guage, first export your video to an MP3 sound file.

If you are using Whis­per­Trans­cribe, export the result as a ‘srt’ (sub­title) file. Cap­tion Mana­ger will auto­ma­ti­cal­ly convert it back to a trans­crip­tion file.

If you are using Deep­Trans­cript, you may need to cut the MP3 file into frag­ments that fit within the pro­gram’s size limits (approxi­ma­te­ly 1 hour). Export each trans­crip­tion as a tabu­la­ted text file. The exten­sions of these files may be « txt » or « tab ». If you’re using Deep­Trans­cript, you’ll first need to export the trans­crip­tion as a CSV file. Then load this CSV file into a spread­sheet pro­gram and export it as tabu­la­ted text without the quo­ta­tion marks as text mar­kers.

Once your files are rea­dy, go to this page to upload them and enter your set­tings.

👉 To start a ses­sion, you will be asked to per­form a small cal­cu­la­tion and write the result in French… This is to prevent robots from satu­ra­ting the ser­vice. Pay atten­tion to the ‘plus’ ver­sus ‘moins’ (minus) ope­ra­tion !

The set­tings main­ly include the out­put file name (which will usual­ly match the video file name), the mini­mum dura­tion of a sub­title and the maxi­mum length of each sub­title. By default, the mini­mum dura­tion is set to 800 mil­li­se­conds and the maxi­mum length to 15 words.

Since speech ana­ly­sis devices work on breath units which may contain more than 15 words, sub­titles will often need to be bro­ken into smal­ler units. Cap­tion mana­ger will break them up and fix them at the cor­rect (inter­po­la­ted) times.

This pro­gram pro­duces “srt” (SubRip), “sbv” (Sub­Vie­wer) and “vtt” (WebVTT) cap­tion file (sub­title) for­mats. All of them are com­pa­tible with VLC and may be accep­table choices for You­Tube. The “vtt” for­mat is nee­ded by the default video player in Word­Press sites. In addi­tion, it is the only one that accepts the non-brea­king spaces requi­red by French punc­tua­tion, and the stan­dard for­mat for You­Tube. None of these for­mats are reco­gni­sed by the Quick­Time video player.

A few for­mat­ting tags such as ita­lics and bold are accep­ted in sub­titles. Line breaks are also accep­ted to denote speech turns in a dia­logue.

Turn-taking can be taken care of by dis­playing the names of the new spea­kers in the first sub­title of their turn to speak. This is done auto­ma­ti­cal­ly once spea­ker tags have been ente­red in the first column of the trans­crip­tion table.

Extra features

Glossary

When buil­ding a cap­tion file, it is pos­sible to make auto­ma­tic repla­ce­ments recor­ded in a “replace” file. This is a two-column tabu­la­ted file, the left contai­ning the string to be sear­ched, and the right its repla­ce­ment. Repla­ce­ments are case-sen­si­tive.

Unders­cores “_” can be used to replace spaces ; they are auto­ma­ti­cal­ly conver­ted to spaces when the glos­sa­ry is loa­ded.

This glos­sa­ry can be used, for example, to res­tore capi­tal let­ters that were for­got­ten during speech-to-text conver­sion. It can also be used to insert for­mat­ting tags :

Note that it may be neces­sa­ry to place spaces before and/or after search strings to iden­ti­fy them as whole words. Care should also be taken to avoid self-embed­ding rules (such as those on the second and third lines), as these would create unwan­ted repe­ti­tions when glos­sa­ry rules are applied mul­tiple times.

Ano­ther fea­ture (PREG_REPLACE) is avai­lable for geeks fami­liar with regu­lar expres­sion syn­tax : files contai­ning sets of repla­ce­ment strings appli­cable to preg_replace() com­mands (in PHP syn­tax). These preg_replace() rules are applied before the glos­sa­ry search-and-replace rules. As shown below, their sen­si­bi­li­ty to context solves the pro­blem of repea­ted self-embed­ding rewrites.

Merged transcription files

We recom­men­ded frag­men­ting the MP3 exports of the video sound­track so that they can be pro­ces­sed by an online speech-to-text ser­vice. This may yield seve­ral trans­crip­tion files. To faci­li­tate an auto­ma­tic trans­la­tion of the entire set of sub­titles, you will need to merge these files into a unique one, while at the same time applying changes pro­gram­med in the glos­sa­ry.

Translated transcriptions

Trans­la­tion is pro­vi­ded free of charge by online ser­vices such as Dee­pL Trans­la­tor.

It is recom­men­ded to per­form the trans­la­tion on a trans­cript file that is struc­tu­ral­ly simi­lar to the one pro­du­ced by Deep­Trans­cript. This is because the trans­crip­tion mecha­nism has per­for­med a seg­men­ta­tion based on breath units. That seg­men­ta­tion is also opti­mal for machine trans­la­tion. It is not a good idea to try to trans­late the contents of « srt » , « sbv » or « vtt » sub­title files, because their seg­men­ta­tion has been modi­fied to suit the maxi­mum length of sub­titles. Due to this, Whis­per­Trans­cribe may not be the best choice for mul­ti-lan­guage sub­titles.

Note that the out­put of Dee­pL Trans­la­tor won’t be a well-for­med trans­crip­tion file, unlike the one you got from Deep­Trans­cript. The main rea­son is that Dee­pL Trans­la­tor ‘trans­lates’ tabu­la­tions to spaces. Worse, it can insert unwan­ted spaces in time­codes, for example repla­cing “234.5′ with “235. 5” and replace dots with com­mas in floa­ting-point timings when trans­la­ted into French.… Cap­tion mana­ger will fix all these errors and handle the trans­la­ted trans­crip­tion as a well-for­med file.

Reference files

Cap­tion mana­ger can cor­rect the content of a trans­crip­tion file by com­pa­ring it to a refe­rence file. The refe­rence file is a plain text ver­sion (without time codes) of the trans­crip­tion that you have manual­ly crea­ted or edi­ted.

The use of refe­rence files saves the trouble of using REPLACE (glos­sa­ry) or PREG_REPLACE files.

Upload the refe­rence file(s) in the same order as the trans­crip­tion file(s). A but­ton cal­led FIX THE TRANSCRIPTION FILE(S) will then appear. Cli­cking on this but­ton will auto­ma­ti­cal­ly fix ‘001.txt’ and so on. The pro­cess is shown in a pop-up win­dow.

The Test only option is selec­ted by default. This allows you to check the pro­cess before saving the trans­crip­tion file that will replace the pre­vious ver­sion.

This pro­cess is very power­ful when trans­la­ting sub­titles.

Let’s look at an example. With Whis­per Trans­crip­tion Pro, I crea­ted both an “srt” sub­title file and a full text trans­crip­tion file of the audio track of a video in English. Using Dee­pL Trans­la­tor, I then trans­la­ted both into French.The “srt” file is nee­ded for its time­codes, but the full text trans­la­tion is much bet­ter. So the chal­lenge is to replace all the text in the “srt” file with equi­va­lent ver­sions taken from the full text (refe­rence) trans­la­tion.

Read the ori­gi­nal “srt” file and the refe­rence text.

Once the “srt” and the « refe­rence » files have been uploa­ded„ cli­cking on the FIX THE TRANSCRIPTION FILE(S) but­ton will dis­play this text which clear­ly shows how the sub­titles will be modi­fied and their time­codes rea­li­gned accor­din­gly.

Let’s look at the first three sub­titles. The English source is in ita­lics :

1
00:00:00,040 –> 00:00:05,060
What if eve­ry­thing that Big Phar­ma told you about migraines is a lie ?
Et si tout ce que Big Phar­ma vous a dit sur les migraines était un men­songe ?

2
00:00:05,210 –> 00:00:10,900
Now, given approxi­ma­te­ly a quar­ter of the popu­la­tion expe­riences migraines,
Sachant qu’en­vi­ron un quart de la popu­la­tion souffre de migraines,

3
00:00:11,240 –> 00:00:14,440
this sto­ry is very like­ly to affect you or someone you love.
cette his­toire est très sus­cep­tible de vous tou­cher ou de tou­cher quel­qu’un que vous aimez.

These will be repla­ced by :

1
00:00:00,040 –> 00:00:05,060
Et si tout ce que Big Phar­ma vous a dit sur les migraines était un men­songe ?

2
00:00:05,210 –> 00:00:14,440
Étant don­né qu’en­vi­ron un quart de la popu­la­tion souffre de migraines, il est très pro­bable que cette his­toire vous affecte, vous ou l’un de vos proches.

Sub­titles [2] and [3] have been mer­ged into one to recons­truct the whole sen­tence star­ting at 00:00:05 and ending at 00:00:14.

Now, it may be neces­sa­ry to break again the sen­tence as per the set­tings of Cap­tion mana­ger. Given the set­tings : maxi­mum num­ber of words = 10, and the stan­dard no-break rules for French, sub­title [2] is bro­ken into two sub­titles as fol­lows :

SOURCE :

Now, given approxi­ma­te­ly a quar­ter of the popu­la­tion expe­riences migraines, this sto­ry is very like­ly to affect you or someone you love.
Étant don­né qu’en­vi­ron un quart de la popu­la­tion souffre de migraines, il est très pro­bable que cette his­toire vous affecte, vous ou l’un de vos proches.

Moved down last word(s) ‘très’

#2
00:00:05.209 –> 00:00:09.824
Étant don­né qu’en­vi­ron un quart de la
popu­la­tion souffre de migraines, il est

#3
00:00:09.824 –> 00:00:14.439
très pro­bable que cette his­toire
vous affecte, vous ou l’un de vos proches.

Read the final ver­sion of the “srt” file. The result isn’t per­fect because I didn’t edit the trans­crip­tion and trans­la­tion, but it confirms that trans­la­ting sen­tences gives a much bet­ter result than trans­la­ting sub­titles one by one.

The disad­van­tage of this approach is that the time codes have been modi­fied, making it dif­fi­cult to super­im­pose seve­ral lan­guage ver­sions. To avoid this situa­tion, a two-step method can be used :

  1. Once you have uploa­ded seve­ral refe­rence files, click on the ADJUST REFERENCE FILES but­ton. This will open an edi­tor where you can arrange the sen­tences so that all the lan­guages match. Then click the FIX TRANSCRIPTION FILE(S) but­ton to match these trans­crip­tion files to the refe­rence files, as explai­ned above.
  2. To fina­lise the trans­crip­tion files, click the ADJUST TIME CODES but­ton. In Test mode you can check if the time codes are satis­fac­to­ry. If not, return to step 1.

Reader-friendly layout

Cap­tion mana­ger does its best to make sub­title text as easy to read as pos­sible. Each sub­title occu­pies seve­ral lines of approxi­ma­te­ly equal length. Cor­rect line feeds will be pro­du­ced if the machine has been ins­truc­ted on the maxi­mum num­ber of cha­rac­ters on each line. The default is 70 because the Word­Press Guten­berg video player creates frames with space that allows for about 75 cha­rac­ters per line.

Ano­ther use­ful fea­ture is the abi­li­ty to control the posi­tion of the breaks bet­ween suc­ces­sive cap­tions. Rea­ding becomes dif­fi­cult when cer­tain words appear at the end of a cap­tion or are moved to the next cap­tion. To do this, Cap­tion mana­ger requires lists of « non-brea­king » words that should not appear at the end of a cap­tion. Each list is asso­cia­ted with a spe­ci­fic lan­guage.

For ins­tance, look at no-break-fr.txt and no-break-en.txt. A few words are sum­ma­ri­sed as regu­lar expres­sions. For example, in French, /\s[Ll][ae]\s/ matches le, la, Le and La, and /\s[Dd]es?\s/ can match de, des, De and Des. As mat­ching is case sen­si­tive, it is neces­sa­ry to include upper case variants, which can be easi­ly com­bi­ned in regu­lar expres­sions.

Reor­de­ring requires moving words either back or for­ward. Let us see how it works. Consi­der the fol­lo­wing sequence of cap­tions :

Since words « de » and « la » are lis­ted in no-break-fr.txt, this sequence will be ren­de­red in the ‘for­ward’ mode as :

and in the ‘back­ward’ mode as :

These two options can be com­pa­red on this excerpt :

The “for­ward” mode is the default option because it seems bet­ter to delay text in sub­titles than to move it back­wards.

Details of the process

The source video was copied (via a screen cap­ture) from The Joe Rogan Expe­rience (April 2023 lien:kow3). There are some irre­gu­la­ri­ties in the strea­ming : frames tend to freeze, although the audio track remains conti­nuous. In prin­ciple, this is not too much of a pro­blem with speech data.

Due to the length of the video (3 hours), the MP3 sound track was sli­ced to three one-hour seg­ments, name­ly 1.mp3, 2.mp3 and 3.mp3. I used the (excellent) Twis­ted­Wave audio edi­tor on the Mac to do this. Cut­ting points need to be set at the end of sen­tences.

Each of the three sound files was sub­mit­ted to Deep­Trans­cript which trans­cri­bed them as text files. These were expor­ted in tabu­la­ted text for­mat : “1.txt”, “2.txt”, “3.txt”. (You can down­load these examples.) The “tab” exten­sion is ano­ther valid option.

Trans­crip­tion files were che­cked in a spread­sheet edi­tor — such as Excel, Plan­Ma­ker, etc. — to make sure that time­codes (in seconds) are dis­played as floa­ting point num­bers. You can see an example of the trans­crip­tion (1.txt) in its Excel/PlanMaker ver­sion : down­load “1.xlsx”. Since a French ver­sion of Plan­Ma­ker was used, floa­ting point num­bers have com­mas ins­tead of dots ; both are accep­table.

The first line of 1.txt does not contain signi­fi­cant data. It will auto­ma­ti­cal­ly be skip­ped by Cap­tion mana­ger. The first column, rena­med ‘track’, will be used for tags iden­ti­fying spea­kers — see Spea­kers and turn-taking below. Value “0,0” will be conver­ted to plain ‘0’ which means “no change.” The first column has been dele­ted in 2.txt and 3.txt ; this is no lon­ger neces­sa­ry.

These trans­crip­tion files are not sui­table for dis­playing sub­titles on the video, at least for the fol­lo­wing rea­sons :

  1. Their for­mat is not a reco­gni­sed stan­dard for use in video players.
  2. Lines are of very variable lengths because Deep­Trans­cript wor­ked on breath units to seg­ment the trans­crip­tion. For ins­tance, text on line #14 would not fit into a single video frame.
  3. Their content is “raw” and nota­bly contains miss­pel­led pro­per names. For ins­tance, “Bhat­ta­cha­rya” is trans­cri­bed as “bada cha­ria”! Also — one of the worst cases — “iver­mec­tin” as “iva­mech­ton”… In addi­tion, all text appears in lower­case. Still, these errors are consistent in the sense that they can be fixed by the rewrite rules of a glos­sa­ry.
  4. We need to merge the three trans­crip­tion files to pro­duce a unique cap­tion file. This is not just a mat­ter of copy-paste. The time codes should add up conti­nuous­ly from the first to the last part.

You should try to auto­mate cor­rec­tions by using a glos­sa­ry and/or sets of regu­lar expres­sion rules. Create a file named replace-en.txt in your text edi­tor. Type the search expres­sion at the start of each line. Then type a tabu­la­tion and type its repla­ce­ment.

An example of the English glos­sa­ry for this video is here : replace-en.txt.

The same pro­ce­dure works for regu­lar expres­sions : create a tabu­la­ted text file preg-replace-en.txt contai­ning pairs of argu­ments for preg_replace() ins­truc­tions (in PHP syn­tax) and upload it. Note that this set contains rules that won’t be self-embed­ding because of using contexts (nota­ted ‘$1’, ‘$2’, etc.). This means that applying the same set of rules mul­tiple times does not create unwan­ted repe­ti­tions.

Below is a screen­shot of the top of the home­page of Cap­tion mana­ger after uploa­ding the three trans­crip­tion files, auto­ma­ti­cal­ly rena­med 001.txt, 002.txt and 003.txt, and the cor­rec­tion files used by all these frag­ments : a glos­sa­ry file rena­med replace_001.txt, a regu­lar expres­sion file reg_replace_001.txt, and a non-brea­king list of words no_break_001.txt (see Rea­der-friend­ly layout above):

Cli­cking but­ton COMBINE SEQUENTIALLY creates unique files mer­ging the three trans­crip­tion files : new_transcription.txt and new_transcription-hms.txt, with time­codes res­pec­ti­ve­ly in seconds and in the hour-minute-second for­mat as sug­ges­ted by ‘hms’. This can be use­ful if you want to work on a single trans­cri­bed file ins­tead of three. The contents of replace_001.txt, reg_replace_001.txt and no_break_001.txt are igno­red in this pro­cess.

Create subtitles in the source language

On the Cap­tion mana­ger page, upload 1.txt, 2.txt, 3.txt (in this order) and cor­rec­tion files as shown in the pre­vious sec­tion. Then enter a name for out­put files — here for example, “Aseem­Mal­ho­tra-Joe­Ro­gan” — and click CREATE A SET OF CAPTION FILES (at the bot­tom of the page). This pro­duces cap­tion files in the three for­mats (srt, sbv, vtt), plus a com­po­site trans­crip­tion file, here named “AseemMalhotra-JoeRogan-hms.txt”.

Files replace_001.txt and reg_replace_001.txt have been used to modi­fy all these files. File no_break_001.txt has been used for crea­ting cap­tions.

The fol­lo­wing is an extract from the trace sho­wing the tran­si­tion from 002.txt to 003.txt and the conti­nui­ty of the time­codes (bro­ken at 02:01:47.800, i.e. 7307.800 seconds). It also confirms that the same files (replace_001.txt, reg_replace_001.txt and no_break_001.txt) have been used for cor­rec­tions :

If the name of the cap­tion file (in any of the three for­mats) is iden­ti­cal to the name of the video file (exclu­ding their exten­sions) and if they are on the same level, VLC will read the video and dis­play sub­titles. A great fea­ture of VLC is that by cli­cking on the left and right arrows, you can move back­wards and for­wards by 10 seconds, which is very conve­nient to re-read a frag­ment.

A plea­sant sur­prise : the size of the sub­titles is now much more in kee­ping with the frame of the video. The main rea­son is that a para­me­ter Max num­ber of words in each cap­tion has been set — to 15 by default. Only words lon­ger than 3 cha­rac­ters are coun­ted. So, long entries (such as line 14 of 1.xlsx) have been split into seve­ral sub­titles with their time codes inter­po­la­ted word-wise.

Cap­tion mana­ger also takes care of the mini­mum dura­tion of each sub­title (800 mil­li­se­conds by default). The time codes are adjus­ted so that the sub­titles never over­lap with each other.

Now it is time to edit 1.txt, 2.txt, 3.txt in a plain text edi­tor — e.g. Tex­tE­dit on a Mac. Read the sub­titles while playing the video (pre­fe­ra­bly at slow speed) and edit the trans­crip­tion files.

Edit trans­crip­tion files 1.txt, 2.txt, 3.txt to fix errors that can­not be fixed by the glos­sa­ry. Then click DELETE ALL TRANSCRIPTION FILES, and upload them again. Click again CREATE A SET OF CAPTION FILES. This will pro­duce the final forms of sub­title files in the three for­mats (srt, sbv, vtt).

When cap­tions are crea­ted in “vtt” (WebVTT) sub­title for­mat, options are pro­vi­ded to change the colour of text in sec­tions enclo­sed by <b>, <i> and <u> tags :

Colour names will be accep­ted if com­pliant with stan­dard HTML color names. Cur­rent­ly, these colours are dis­played (on Mac) by Chrome, Ope­ra, Brave brow­sers, yet nei­ther Fire­fox nor Safa­ri. In addi­tion, as shown above, seve­ral video players do not yet reco­gnise CSS « ::cue » for­mat­ting.

Note that this pro­ce­dure also pro­du­ced a file “AseemMalhotra-JoeRogan-hms.txt” which contains the whole set of cap­tions once cor­rec­ted by replace-en.txt and preg_replace-en.txt. Rename it for ins­tance AseemMalhotra-JoeRogan-hms-en.txt. This is the file you will use now for a final edi­ting of the text, or to create trans­la­tions. Here ‘hms’ means that the time­codes are expres­sed in hours, minutes and seconds ins­tead of just seconds ; this is the way most video players dis­play them.

Create subtitles in different languages

To create trans­la­ted sub­titles using Dee­pL Trans­la­tor, it would be a bad idea to send “srt”, “sbv” and “vtt” files direct­ly for trans­la­tion. This is because they contain sub­titles that are spread over seve­ral frames (due to the 15-word limit). This can lead to inac­cu­rate trans­la­tions. It is the­re­fore bet­ter to work with trans­crip­tion files, as they contain sub­titles seg­men­ted by breath units, which make more sense to the auto­ma­tic trans­la­tor.

So, we need to recons­truct a unique trans­crip­tion file by mer­ging 1.txt, 2.txt and 3.txt, to which glos­sa­ry search-replace rules will be applied. To this effect, you can use « AseemMalhotra-JoeRogan-hms-en.txt » which you down­loa­ded ear­lier. You may also do the same by a single click on but­ton COMBINE SEQUENTIALLY THESE TRANSCRIPTIONS TO SINGLE FILE. The name of the file crea­ted by this pro­cess will always be new_transcription.txt — down­load it to see an example. Let’s use this name for the fol­lo­wing expla­na­tions.

You may notice that HTML tags for ita­lics, bold, empha­si­zed or strong text have been repla­ced with non-stan­dard tags [i], [/i], [b] and [/b]. The rea­son is that Dee­pL Trans­la­tor tends to delete or modi­fy few HTML tags. These tags will auto­ma­ti­cal­ly be res­to­red to the stan­dard HTML for­mat when pro­du­cing cap­tion files.

Of course, manual sty­lis­tic edi­ting of new_transcription.txt is man­da­to­ry before trans­la­ting it. If you are not a native English spea­ker, you will appre­ciate the help of Gram­mar­ly. Note that it offers the option of seve­ral variants of the lan­guage : Bri­tish, Ame­ri­can, Indian, Cana­dian and Aus­tra­lian English.

Open new_transcription.txt in a plain-text edi­tor, copy its contents and paste it into Dee­pL Trans­la­tor, after choo­sing the tar­get lan­guage. (You may need to run a pre­mium ver­sion if the text is long.) Then, copy the trans­la­tion and save it as a text file, e.g. transcription-fr.txt.

Wha­te­ver the auto­ma­tic trans­la­tion tool, since the source text is a trans­crip­tion of natu­ral speech, which means incom­plete sen­tences, mis­sing or repea­ted words, etc., the result is like­ly to be poor. Big-data trans­la­tion tools tend to guess mis­sing frag­ments, which leads to errors. The­re­fore, the trans­la­tion of trans­crip­tions must be care­ful­ly edi­ted by native spea­kers. For ins­tance, this file is the raw ver­sion of transcription-fr.txt and that one its final ver­sion — after hours of final edi­ting by hand !

In this example, a Spa­nish trans­la­tion is also visible, but transcription-es.txt is the raw, une­di­ted, ver­sion crea­ted by Dee­pL Trans­la­tor. Native rea­ders of Spa­nish should sub­mit revi­sed ver­sions…

It might be a good idea to use ChatGPT for these trans­la­tions, adding sui­table sty­lis­tic spe­ci­fi­ca­tions, but its cur­rent free ver­sion (3.5) has a too-small limit on the length of the text.

Now you need to create cap­tion files in the three sub­title for­mats using this (unique) trans­crip­tion file. Click DELETE ALL TRANSCRIPTION FILES and DELETE ALL GLOSSARY FILES, then upload transcription-fr.txt and click on the CREATE A SET OF CAPTION FILES but­ton.

Key­hole heart sur­ge­ry ???

You’re almost there ! Howe­ver, you still need to cor­rect trans­la­tion errors, par­ti­cu­lar­ly in rela­tion to tech­ni­cal or scien­ti­fic terms that Dee­pL Trans­la­tor may have misun­ders­tood. A typi­cal example in this inter­view is “key­hole heart sur­ge­ry” (time 56.3 seconds) which was trans­la­ted “chi­rur­gie car­diaque par trou de ser­rure”!

To fix this (and other) errors, you should create a spe­ci­fic glos­sa­ry file, e.g. replace-fr.txt. It would contain the fol­lo­wing rewrite rule :

A more gene­ral ver­sion of this rule is pro­gram­med, using a regu­lar expres­sion, in preg-replace-fr.txt. It replaces both « chi­rur­gie d’ur­gence de trou de ser­rure » and « chi­rur­gie trou de ser­rure » with « chi­rur­gie car­diaque mini­ma­le­ment inva­sive (key­hole heart sur­ge­ry) ». The same pro­blem occur­red with Spa­nish and Ita­lian trans­la­tions, as the trans­la­tor is unfa­mi­liar with the ori­gi­nal English expres­sion. It is also safe to replace “car­diac” with “car­dio­vas­cu­lar” as these are not equi­va­lent in Roman lan­guages.

For regu­lar expres­sion geeks : the same regu­lar expres­sion file contains rules crea­ting French che­vrons quotes along with their non-brea­king spaces :

[\"«]\s*([^"^»]+)?\s*[\"»]	«[nbsp]$1[nbsp]»
\s“\s*	 «[nbsp]
\s*”\s	[nbsp]» 

This method is not per­fect because some­times Dee­pL Trans­la­tor for­gets a few ope­ning or clo­sing quotes. This hap­pe­ned only once in the 3‑hour sample video. So, it covers most cases.

Rea­ding the final cap­tion file, first with a text edi­tor and then as real sub­titles with VLC, will give you the oppor­tu­ni­ty to cor­rect errors, pre­fe­ra­bly using glos­sa­ries and regu­lar expres­sion rules, other­wise in the source trans­crip­tion file new_transcription.txt.

Multi-language subtitle mixing

Once sub­titles have been trans­la­ted into dif­ferent lan­guages, it is pos­sible to dis­play two (or more) lan­guages toge­ther at the bot­tom of the video. This has been done on the video shown as an example.

Remem­ber that we have two trans­crip­tion files contai­ning all the English and French sub­titles. Their time­codes are iden­ti­cal because they were crea­ted by Deep­Trans­cript and left unchan­ged by Dee­pL Trans­la­tor.

Upload the English trans­crip­tion, then the French trans­crip­tion which will be rena­med 001.txt and 002.txt res­pec­ti­ve­ly. If the time­codes of 001.txt and 002.txt are iden­ti­cal, the fol­lo­wing will be dis­played :

Then upload the English and French glos­sa­ries (in the same order). These will be rena­med replace_001.txt and replace_002.txt res­pec­ti­ve­ly. You can do the same with regu­lar expres­sion files that will be rena­med preg_replace_001.txt, preg_replace_002.txt, and optio­nal­ly with the non-brea­king rule files which will be rena­med no_break_001.txt and no_break_002.txt. As you might guess, each glos­sa­ry, preg-replace and no-break file will be applied to the trans­crip­tion file with the same num­ber. Other lan­guage ver­sions (and their res­pec­tive glos­sa­ries) can be added at this stage.

You can apply simple HTML for­mats sup­por­ted by video players : ita­lics or bold. This makes it easier to draw atten­tion to the lan­guages in the video. Here we have cho­sen “ita­lic” for the English text and no for­mat­ting for the French text.

If “ita­lic” is selec­ted, ita­lic text will be conver­ted to bold, and vice ver­sa.

An optio­nal token, by default « ~•~ », can be set to create blank lines sepa­ra­ting lan­guage ver­sions. Leave it emp­ty to remove these emp­ty lines, an option which is gene­ral­ly satis­fac­to­ry when ver­sions have dif­ferent colours. In the cur­rent “vtt” (WebVTT) for­mat, colour is only applied to bold or ita­lic text (see above), which is not opti­mal.

As two (or more) sub­titles will be dis­played within the same frame, it may be use­ful to reduce the maxi­mum length of each sub­title. For bilin­gual sub­titles, we gene­ral­ly set the limit to 15 words.

At last, click on the CREATE A SET OF CAPTION FILES BY SUPERIMPOSING THESE TRANSCRIPTIONS but­ton.

Subtitles in consecutive languages

This is the case of a video in which seve­ral lan­guages have been used conse­cu­ti­ve­ly in dif­ferent parts. It is easy to deal with this situa­tion : seg­ment the MP3 sound file into frag­ments contai­ning only one lan­guage. Trans­cribe and trans­late them sepa­ra­te­ly. Then upload them in alpha­be­ti­cal order, crea­ting 001.txt, 002.txt, etc.

Create a glos­sa­ry for each lan­guage and upload the glos­sa­ry files in the order they are nee­ded : replace_001.txt, replace_002.txt, etc. The same glos­sa­ry may need to be uploa­ded seve­ral times if that lan­guage appears in dif­ferent frag­ments.

If a glos­sa­ry is mis­sing, the pre­vious one will be used. For example, if trans­crip­tion file 005.txt does not find replace_005.txt, it will use replace_004.txt – or the next non-emp­ty pre­ce­ding one. The same applies to regu­lar expres­sion files. Note that this is the case when you are dea­ling with a sequence of trans­crip­tion files with a single glos­sa­ry and/or regu­lar expres­sion file.

Speakers and turn-taking

The first column of the CSV tables pro­du­ced by Deep­Trans­cript contains a variable cal­led ‘chan­ne­lId’ which we have so far igno­red. This column can even be dele­ted without dis­tur­bing the Cap­tion Mana­ger pro­cess. By default, each of its cells contains the num­ber ‘0’. We will now use it to spe­ci­fy the spea­kers, or rather the changes of spea­kers, name­ly the turn-taking.

Our conven­tion is that a value of ‘0’ (or an emp­ty cell) means “no change”. You need to assi­gn a tag to each spea­ker. The sug­ges­ted method is to use whole num­bers : 1, 2, 3… The ini­tials of the spea­kers can also be used to this effect. Spaces will be auto­ma­ti­cal­ly repla­ced by unders­cores ‘_’.

You don’t need to fill all the cells with spea­ker tabs. Just fill in the cell where the spea­ker starts to speak. The zeros will take care of kee­ping the infor­ma­tion.

Then load the edi­ted trans­crip­tion file (tabu­la­ted text for­mat) into the Cap­tion mana­ger page. The pro­gram will create and dis­play a list of spea­ker tags, along with edi­table fields where you can enter the full names of these spea­kers. For example, in the video Michel Onfray – ‘Théo­rie de Jésus’, three spea­kers have been tag­ged ‘1’, ‘2’, ‘3’ and their full names have been ente­red in the cor­res­pon­ding fields — see pic­ture.

These full names will be saved in your pro­ject’s set­tings when you create sub­titles or trans­crip­tion files. (For geeks : they are also saved as a ses­sion variable…)

The full name will appear at the begin­ning of the sub­title in ‘square bra­ckets’ at each turn. Ano­ther options is ‘unders­core’, which may bene­fit of set­ting a dif­ferent colour for under­li­ned text.

Sub­title that men­tions the name of the next spea­ker

Delete fragments and/or insert silences

It is often the case that a video that has been sub­tit­led needs to be edi­ted. In par­ti­cu­lar, we may want to delete a frag­ment and/or insert a silence. To do this, load the trans­crip­tion file, go to the bot­tom of the page, and set the times or dates of the begin­ning and end of the frag­ment to be dele­ted. Also, spe­ci­fy the dura­tion of the silence that will replace this frag­ment, in case there is one.

A trace of this pro­cess would be as fol­lows :

Down­load the resul­ting new_transcription file in either time (seconds) or hh:mm:ss for­mat.

For a clean cut, the exact break points should coin­cide with the begin­ning and end of the first and last cap­tions to be dele­ted. We had set the start to approxi­ma­te­ly 00:00:30 and the end at approxi­ma­te­ly 00:00:40. The start date falls within the inter­val of a cap­tion with time codes 00:00:28.500 to 00:00:34.798. This means that the actual start date of the dele­ted frag­ment should be 00:00:28.500, which is 1.5 seconds ear­lier. The end date falls within the inter­val of a cap­tion with time codes 00:00:37.600 to 00:00:44.700. The­re­fore, the end date of the dele­ted frag­ment should be 00:00:44.700, which is 4.7 seconds later. These are the exact values that need to be used when edi­ting the video file.

The dates of the sub­titles fol­lo­wing the dele­ted frag­ment have been increa­sed by 7 seconds as spe­ci­fied. Simi­lar­ly, when edi­ting the video file, a 7‑second blank frag­ment must be inser­ted.

A blank cap­tion star­ting at 00:00:25.500 and ending at 00:00:47.700 has been added for conve­nience. It can be com­ple­ted with text or dele­ted later.

This pro­ce­dure can be used to insert a silence without dele­ting a frag­ment : sim­ply enter the desi­red posi­tion of the silence as both the start and end date of the “dele­ted” frag­ment.

Of course, if you are sub­tit­ling in more than one lan­guage, each lan­guage trans­crip­tion file should be edi­ted with exact­ly the same para­me­ters.

Change timecodes

This fea­ture is very simi­lar to the pre­ce­ding one.

Enter the start and end dates (or times) of the frag­ment you want to modi­fy and the num­ber of seconds to add to its time­codes. This « Add » num­ber can be nega­tive and in floa­ting-point for­mat.

The trace will show changes in red and if you are satis­fied, you can down­load the modi­fied file with its time codes in seconds or hh:mm:ss.

Create an index

Once a WebVTT cap­tion file has been crea­ted, it is easy to create an index of the contents with active HTML links poin­ting at pre­cise moments in the video. This has been done on my page Aseem Mal­ho­tra inter­view.

To this effect, a spe­ci­fic page has been crea­ted, named “AseemMalhotra-JoeRogan.php”, which contains the code of the Plyr.io media player in a PHP envi­ron­ment. This file has been uploa­ded to the “video” fol­der. The <source> ele­ment has been modi­fied as fol­lows :

<source src="https://lebonheurestpossible.org/cloud/AseemMalhotra-JoeRogan.mp4#t=<?php echo $t; ?>"  type="video/mp4">

Variable $t is cap­tu­red from the URL, allo­wing for either seconds or time (hh:mm:ss) for­mat :

if(isset($_GET['t'])) {
    $t = $_GET['t'];
    if(is_integer(strpos($t,":"))) {
        $timeParts = explode(':', $t);
        $seconds = 0;
        if(count($timeParts) === 2)
            $seconds += $timeParts[0] * 60 + $timeParts[1];
        elseif (count($time1Parts) === 3)
            $seconds += $timeParts[0] * 3600 + $timeParts[1] * 60 + $time1Parts[2];
        $t = $seconds;
        }
    }
else $t = 0;

So, for ins­tance, link 02:23:33 opens a new win­dow and plays imme­dia­te­ly the refer­red frag­ment. This link can easi­ly be copied and pas­ted on a remote HTML/Javascript page :

<a onclick="window.open('https://lebonheurestpossible.org/video/AseemMalhotra-JoeRogan.php?t=02:23:33','Malhotra','width=1200,height=700'); return false;" href="https://lebonheurestpossible.org/video/AseemMalhotra-JoeRogan.php?t=02:23:33">02:23:33</a> The triangle that moves the mountain

A bet­ter imple­men­ta­tion also sends lan­guage infor­ma­tion to the video player to dis­play the appro­priate sub­title ver­sion. A link to the same frag­ment 02:23:33 with Spa­nish sub­titles by default would look like this :

<a onclick="window.open('https://lebonheurestpossible.org/video/AseemMalhotra-JoeRogan.php?t=02:23:33&amp;lang=es','Malhotra','width=1200,height=700'); return false;" href="https://lebonheurestpossible.org/video/AseemMalhotra-JoeRogan.php?t=02:23:33&amp;lang=es">02:23:33</a> El triángulo que mueve la montaña

using the fol­lo­wing code in “AseemMalhotra-JoeRogan.php”:

if(isset($_GET['lang'])) {
$lang = $_GET['lang'];
}
else $lang = '';
$langs = array("fr","es","it","en");
$all_tracks = '';
foreach($langs AS $thislang) {
switch($thislang) {
case "fr": $label = "ENG - FRA"; break;
case "es": $label = "ENG - ESP"; break;
case "it": $label = "ENG - ITA"; break;
case "en": $label = "ENG"; break;
}
if($thislang <> "en") $andlang = "-".$thislang;
else $andlang = '';
$track = "<track kind=\"subtitles\" src=\"https://lebonheurestpossible.org/wp-content/uploads/AseemMalhotra-JoeRogan-en".$andlang.".vtt\" srclang=\"".$thislang."\" label=\"".$label."\"";
if($thislang == $lang) $track .= " default";
$track .= " />";
$all_tracks .= $track;
}
?>

<video id="bb-video" controls style="width: 100%;" poster="https://lebonheurestpossible.org/poster-malhotra-rogan/" autoplay>
<source src="https://lebonheurestpossible.org/cloud/AseemMalhotra-JoeRogan.mp4#t=<?php echo $t; ?>" type="video/mp4">
<?php echo $all_tracks; ?>
<p>
Your browser doesn't support HTML video. Here is a
<a target="_blank" href="https://lebonheurestpossible.org/cloud/AseemMalhotra-JoeRogan.mp4">link to the video</a> instead.
</p>
</video>

<script src="https://cdn.plyr.io/3.6.8/plyr.js"></script>
<link href="https://cdn.plyr.io/3.6.8/plyr.css" rel="stylesheet" />

<script>
document.addEventListener('DOMContentLoaded', () => {
var player = new Plyr('bb-video', {
controls: ['rewind','play','fast-forward','progress','volume','captions','settings','fullscreen'],
seekTime: 5,
captions: { active: true }
});
});
</script>

Sharing editorial work

Access to your works­pace is gran­ted or denied based on your IP num­ber. If you change loca­tion while wor­king on a pro­ject, you must be able to access it from a dif­ferent IP num­ber in the connec­tion. This applies to part­ners wor­king on the same pro­ject.

To enable this, Cap­tion mana­ger dis­plays a secret key that you can copy and send to your guest edi­tor. The edi­tor will open Cap­tion Mana­ger on their side, paste the secret key to the form and click but­ton “GO!”. Beware that after three unsuc­cess­ful tries their IP will be bla­ck­lis­ted ! Contact the admin if this hap­pens…

The content of your works­pace is retai­ned for 48 hours. Each time you (or a guest edi­tor) access it, a new 48-hour per­iod is gran­ted. If left unu­sed after this per­iod, the works­pace will be auto­ma­ti­cal­ly dele­ted.

Example

Below is the video (dura­tion 3 hours) of an inter­view with Dr Aseem Mal­ho­tra, auto­ma­ti­cal­ly trans­cri­bed with Deep­Trans­cript, revi­sed with the help of Gram­mar­ly, and trans­la­ted to French with the help of Dee­pL Trans­la­tor. This pro­cess takes advan­tage of these big data plat­forms so that it requires a mini­mum of manual inter­ven­tion. In prac­tice, a care­ful edi­ting work is requi­red to fina­lise the cap­tions — and to create lexi­cal rules that can be used for future work.

The video is dis­played by the stan­dard Guten­berg video player. After that, other players based on Word­Press plu­gins will be shown.

Video of Dr Aseem Mal­ho­tra inter­vie­wed by Joe Rogan, 23 April 2023
Stan­dard Guten­berg HTML5 video player in Word­Press
With English or/and French sub­titles
This video is dis­played from a Google Cloud source.
Select lan­guage on video

On the bot­tom right of the frame, click the ver­ti­cal three per­iods, then point at “Options” and click flags to select lan­guages. Sor­ry for the use of coun­try flags, but lan­guage flags are not avai­lable in Uni­code…

➡ This is an ongoing pro­cess : only the first two hours have been revi­sed, so far, to show what can be achie­ved with a few manual cor­rec­tions. The last hour is almost “raw”, only pro­du­ced by the auto­ma­tic tools.

This stan­dard Guten­berg video player requires no spe­cial ins­tal­la­tion, but it has one major draw­back for its use with tech­ni­cal and/or forei­gn-lan­guage pod­casts : the lack of rewind and for­ward but­tons that allow you to skip approxi­ma­te­ly 10 seconds at a time.

More video players (script-based)

Below are two players ins­tal­led as scripts using a CDN. Be aware that they are dis­played dif­fe­rent­ly on dif­ferent brow­sers and/or sys­tems. It is a good idea to check that all requi­red options work cor­rect­ly on mobile phones.

Video­js HTML5 Player is an advan­ced pro­ject in terms of options. With the help of ChatGPT ! I was able to place the elap­sed time dis­play at the bot­tom left of the frame. In the fol­lo­wing example, I could set the back­ground colour and opa­ci­ty, font fami­ly, and change these set­tings in full-screen mode, but the font size does not yet work. This issue is being dis­cus­sed on the forum.

Apart from the font size issue, which will hope­ful­ly be resol­ved soon, a major draw­back of this player is that it does not apply colours set by « ::cue » selec­tors in the WebVTT file. Its advan­tage over the stan­dard Guten­berg player is the exis­tence of (pro­gram­mable) skip but­tons.

Ano­ther power­ful tool, my favou­rite at the moment, is the Plyr.io media player. It misses skip but­tons on seve­ral brow­sers, but left-right arrows allow back­wards-for­ward jumps of about 2 minutes on some brow­sers, and ± 5 seconds on others, as ins­truc­ted by the seek­Time para­me­ter. In addi­tion, skip but­tons are visible on iPhones, although they skip the time by 10 or 15 seconds, depen­ding on the context.

<style>
.plyr__subtitles {
  vertical-align: bottom !important;
}
</style>

<video id="bbvideo" controls style="width: 100%;" poster="https://lebonheurestpossible.org/poster-malhotra-rogan/">
  <source src="https://lebonheurestpossible.org/cloud/AseemMalhotra-JoeRogan.mp4#t=0"  type="video/mp4" />
  <track kind="subtitles" src="https://lebonheurestpossible.org/wp-content/uploads/AseemMalhotra-JoeRogan-en-fr.vtt" srclang="enfr" label="ENG - FRA" default />
<track kind="subtitles" src="https://lebonheurestpossible.org/wp-content/uploads/AseemMalhotra-JoeRogan-en-es.vtt" srclang="es" label="ENG - ESP">
<track kind="subtitles" src="https://lebonheurestpossible.org/wp-content/uploads/AseemMalhotra-JoeRogan-en-it.vtt" srclang="it" label="ENG - ITA">
  <track kind="subtitles" src="https://lebonheurestpossible.org/wp-content/uploads/AseemMalhotra-JoeRogan-en.vtt" srclang="en" label="ENG" />
 <p>
    Your browser doesn't support HTML video. Here is a
    <a target="_blank" href="https://lebonheurestpossible.org/cloud/AseemMalhotra-JoeRogan.mp4" rel="noopener">link to the video</a> instead.
  </p>
</video>

<script src="https://cdn.plyr.io/3.6.8/plyr.js"></script>
<link href="https://cdn.plyr.io/3.6.8/plyr.css" rel="stylesheet" />

<script>
  document.addEventListener('DOMContentLoaded', () => {
    var player = new Plyr('bbvideo', {
      controls: ['rewind','play','fast-forward','progress','volume','captions','settings'],
seekTime: 5,
      captions: { active: true }
    });
});
</script>

➡ Note expres­sion « #t=0 » in the <source> ele­ment. This is the code nee­ded to start the video from a defi­ned point, as shown below.

More video players (plugins)

Below are a few players ins­tal­led as Word­Press plu­gins. Some of them do not have rewind and fast for­ward (skip) but­tons, or these but­tons are used to jump to the pre­vious or next video track in a play­list.

WPlyr video player has all requi­red fea­tures, but it only dis­plays video files sto­red on a local source, name­ly this web­site (embar­ked MP4 file). Trying the same with a Google Cloud source, it doesn’t work. This will place an exces­sive load on the site when many users are wat­ching its video(s). For this rea­son it is not dis­played here.

CP Media Player has a very clear dis­play of sub­title texts, nota­bly in the full screen mode. It had a conflict with the MEKS audio player used on this site, but this was resol­ved by adding an extra para­me­ter to the short­code, which yiel­ded :

Unfor­tu­na­te­ly, the cur­rent ver­sion (1.1.0) of CP Media Player does not (yet?) have rewind/forward (skip) but­tons. In addi­tion, there is a large, unwan­ted white space at the bot­tom of the frame after a return from full screen.

Warning

The confi­den­tia­li­ty of the data you pro­cess with this ser­vice is not gua­ran­teed : someone sha­ring your Inter­net access (IP address) could find it and export the content. This content (your works­pace) is howe­ver auto­ma­ti­cal­ly dele­ted after 48 hours of non-use. Fur­ther­more, you can click DELETE ALL FILES but­tons at any time.

Recommander

Écrire un commentaire...

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. Découvrez comment les données de vos commentaires sont traitées.

Translate - Traduire