Tuesday 22 May 2018

FFMPEG burn subtitles while Cutting video


I was looking for issue where if we cut video using -ss flag, video conversion doesn't start. The answer I found suggests to use -ss flag before -i flag to seek video before conversion.


ffmpeg  -ss 01:06:29 -i "input.mp4" -t 00:00:35 -vf "subtitles=sub.srt:force_style='FontSize=32,PrimaryColour=&Hfcc545',scale=462:-1" "output.mp4"

But when I use this approach, subtitles don't get burned to output.



Answer



The subtitles filter only starts when the timecode of the first subtitle is encountered. If you use -ss before -i and the remaining duration is less than the timecode of the first subtitle, then it won't be activated.


Either modify the subtitle so that the first subtitle is one that is set to show after the cutpoint and reduce all timecode references by that amount


--or--


Use -ss after -i, like you were doing before. Note that the conversion does start. What's happening is that FFmpeg decodes all packets and discards them until seek point is reached. The encoding statistics don't start rolling till encoding commences. That only happens when the seek point is reached, which will take some time, depending on how deep your seek point is.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...