[FFmpeg-user] Can't get ffpmeg to add subtitles to mp4 files

Moritz Barsnick barsnick at gmx.net
Sat Jan 4 16:16:33 EET 2020


On Sat, Jan 04, 2020 at 09:43:16 +0000, Ashish Jha wrote:
> Try below mentioned command:
>
> ffmpeg -i input.mp4 -filter:v subtitles=subtitle.srt output.mp4
>
> it's working for me.

If you read Richard's mail, you will notice that that is exactly what
he tried. It fails for him though, because his input doesn't have any
video stream, so there's nothing the "subtitles" filter can overlay
onto.

Richard needs to add an artificial video as a base for the subtitles.
This works just fine (without the intermediate my.mp4):

$ ffmpeg -i my.mp3 -f lavfi -i color=color=black,subtitles=my.srt -shortest my.mp4

(The subtitles filter is directly chained with the artificial input
source. It could just as well be given via "-vf" == "-filter:v", but
doesn't need to be in this case.)

Moritz


More information about the ffmpeg-user mailing list