[FFmpeg-user] Subtitles

llee040 at sbcglobal.net llee040 at sbcglobal.net
Tue Mar 8 13:53:25 EET 2022


On Mar 8, 2022, at 5:13 AM, Vincent Meyrignac <vmeyrignac at lendwi.com> wrote:
> 
> Good day.
> 
> What I intend to do is to merge a subtitles file to a video one and get a video file with the subtitles.
> 
> I am using a HP Notebook with CPU Intel(R) Core (TM) i7-7500 CPU@ 2.70GHz 2.90 GHz
>    with    RAM 8,00 Go
>        AMD radeon
>        and with Windows 10 Family 1803
> Ok : it's not very fast to make videos but I am ritired and I got time.
> 
> My FFmpeg is the version in ffmpeg-2022-03-03-git-72684d2c2d-full_build.7z
> properly installed in "C:\Program Files (x86)\FFmpeg" directory
> and I have update the path so that it look like :
> PATH=...;C:\Program Files (x86)\FFmpeg\bin\;...
> 
> My files are say :
> - myvideo.mov : the unsubtitled video file ;
> - myvideo.str : the subtitles file ;
> and I intend to produce :
> - myvideo_st.mp4 : a video file subtitled ;
> 

You may need to change “.str” to “.srt”, but here’s an example of what I use for English subtitles:

ffmpeg -i '/path/to/myvideo.mov' -f srt -i '/path/to/myvideo.srt' -async 1 -codec copy -c:s mov_text -metadata:s:s:0 language=eng -movflags +faststart '/path/to/myvideo_sub.mov’

I use "-movflags +faststart”, but I’m not sure you need them. Before giving up, check to see how many tracks are contained in the output video using Mediainfo or something similar. If the output was produced successfully, check the player compatibility.

L. Lee


More information about the ffmpeg-user mailing list