Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delay subtitles in ffmpeg? [closed]

Using ffmpeg, I am burning subtitles to a movie using the following:

ffmpeg -i inputfile.mov -vf "subtitles=subtitles.srt:force_style='Alignment=9,Fontsize=8,Outline=0'" $outputfile.mov

Is there a way of delaying/shifting the subtitles start point? Eg have all the subs start 2 seconds later?

like image 961
friendlygiraffe Avatar asked Sep 06 '19 11:09

friendlygiraffe


People also ask

How to add subtitles to a video using FFmpeg?

If the subtitle is a separate file called subtitle.srt, you can use this command: ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi If the subtitle is embedded in the container video.mkv, you can do this: ffmpeg -i video.mkv -vf subtitles=video.mkv out.avi

How do I map all streams in FFmpeg?

you can use -map 0 to ensure that all streams are copied. If it is not possible with the format, ffmpeg should then error out. -map 0 tells ffmpeg/libav to include all streams, not just those for which you defined convecsion rules. Normally -map is used to define stream mapping - i.e. stream 1 in the input should become stream 0 in the output.

How to remove subtitle stream without re-encoding video and audio shortest command?

To remove subtitle stream without re-encoding video and audio shortest command would be: ffmpeg -i input.mkv -sn -c copy output.mkv

What does-map 0 do in FFmpeg?

Normally -map is used to define stream mapping - i.e. stream 1 in the input should become stream 0 in the output. With just -map 0 you tell ffmpeg/libav to take all streams without shuffling. Show activity on this post. If you just want to do a simple conversion to mp4 you can use VLC.


Video Answer


1 Answers

I'm not sure if this is possible in a single invocation, but you can always generate a delayed version of subtitles.srt,

ffmpeg -itsoffset 2 -i subtitles.srt -c copy subtitles_delayed.srt

and then burn it to the movie.

like image 104
oguz ismail Avatar answered Oct 07 '22 16:10

oguz ismail