0

I currently have ~200 short 30 second teaser youtube video that link to articles.

I am looking for the best way to add captions to these videos. These will eventually go out on social media. Because the videos are short and clear, the youtube default captions are actually quite good.

However, I want the captions to be part of the mp4 file so that when I share it on social networks (uploading the video directly) then the captions appear.

What is the best way to do this? This is the ideas I have so far:

1) I could manually download the captions for each video, then use some service (which one) to merge the captions with the videos, and then post it.

2) I could download the captions for each video, then use the social networks service to add the caption as an add-on, you can do this with fb at least. The downside of this is that it would have to be done again and again for each social network.

This is for a volunteer run non-profit so there is no money to get this stuff done with super expensive software (though we have the adobe suite including premiere).

Any thoughts would be greatly appreciated!

2 Answers 2

1

1) Is probablly the easyest. You can download it from YouTube and merge it in Premiere Pro. Easyest way is to burn it in, so you wont have any struggles with other social media plattforms.

If you have basic programming knowledge, ypu could write a script whoch automatocally downloads and adds the sub titles from YT.

1
0

If you upload the videos to youtube then you can download the transcriptions as srt files. You can then "burn them in" fairly easily with ffmpeg, and just a leeetle bit of shell script. The basic ffmpeg command you need to burn in subtitles to a video file is:

ffmpeg -i input.mp4 -vf subtitles=subs.srt out.mp4

where input.mp4 is your source video, subs.srt is your subtitles and out.mp4 is your output video.

If you have a lot of videos it makes sense to use some sort of scripting to speed up the process. If you're on windows then powershell is a good option (actually it's cross-platform so you can also do this on a mac). Run powershell by hitting Windows-R and typing in powershell.

Say you have a folder of videos and srt files, and each video has an srt file with the same name. You could do this to join them all:

cd "c:\the\path\to\your folder with\the movies"
mkdir "processed"
get-childItem *.mp4|%{
    ffmpeg -i $_ -vf subtitles=($_.name.replace("mp4", "srt")) (".\processed\" + $_.name.replace(".mp4", "_subs.mp4"))
}
  • the first line changes directory to c:\the\path\to\your folder with\the movies. Obviously you replace this with the actuall path to your movie folder (you can drag the folder into the powershell console to have it auto-filled for you)

  • the next line makes a directory called "processed". If we dump the output movies in the same folder as the originals it might confuse the script.

  • then we start a loop. get-childItem (aka ls) means list the contents of the current directory. In this case we only want the items that match something.mp4 so we use *.mp4 where the * is a wildcard. The output of this command is piped to a foreach-object loop. The pipe is represented by the | character, it sends the output of one command to another command. I've used % which is the shorthand for foreach-object.

    What this does is repeat everything inside the {curly braces}, for each member of the list. Inside the curly braces, the current list member that we're working on is represented by the weird looking variable $_. So if the folder contains file1.mp4, file2.mp4, file3.mp4… then $_ will stand for file1.mp4 the first time, file2.mp4 the second and so on.

  • then comes the real hoo-hah. ffmpeg is called, and the -i input is whatever file we're working on this time round.

    The subtitles file has the same name as the video but with a .srt extension. So for the subtitles filter we replace the .mp4 part of the name with .srt. It's in brackets so that powershell knows to do the text replacement before calling the ffmpeg command.

    Same deal for the output file. The relative path to the new processed directory is added to the start, and the text "_subs" is added to the end of the name. So what ffmpeg sees when the input is file1.mp4 is:

    ffmpeg -i file1.mp4 -vf subtitles=file1.srt .\processed\file1_subs.mp4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.