1

Hi I want to add watermark png image to video with hardcode substitle .srt file at same time what changes i should do the to following line

ffmpeg -i input.mkv -threads 0 -c:v libx264 -crf 28 -preset veryslow -vf "movie=watermark.png [watermark]; [in][watermark] overlay=0:0 [out]" output.mp4

2 Answers 2

2
ffmpeg -i input.mkv -i watermark.png -c:v libx264 -crf 28 -preset veryslow -filter_complex overlay;subtitles=subtitle.srt output.mp4
  • Use -filter_complex when your filter involves more than one input. This is called a complex filtergraph as opposed to a simple filtergraph.

  • Use of the movie multimedia source filter is not required.

Also see:
Official FFmpeg documentation for overlay video filter
Official FFmpeg documentation for subtitles video filter
FFmpeg Wiki: How to burn subtitles into the video

8
  • I get this error when i do this command [Parsed_subtitles_1 @ 000000000437d020] No usable fontconfig configuration file found, using fallback. Commented Jun 4, 2013 at 3:41
  • @Qatarson Please update your question with your ffmpeg command and complete ffmpeg console output. Commented Jun 4, 2013 at 6:08
  • ffmpeg -i input.mp4 -i watermark.png -c:v libx264 -crf 28 -preset veryslow -filter_complex overlay;subtitles=subtitle.srt output.mp4 Commented Jun 4, 2013 at 13:27
  • here command output Commented Jun 4, 2013 at 13:29
  • Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2013-03-26 13:27:16 Duration: 00:01:55.64, start: 0.000000, bitrate: 1825 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x544, 1631 kb/s, 23.98 fps, 23.98 tbr, 48k tbn, 47.95 tbc Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 19 1 kb/s Commented Jun 4, 2013 at 13:30
1

As opposed to @llogan's answer, I had to use a comma (not semicolon)

vid=video.mp4
img=ovelay.png
sub=subtitles.srt
out=output.mp4

ffmpeg -i $vid -i $img -filter_complex "[0:v][1:v] overlay=2:2,subtitles=$sub" $out

Result: https://www.youtube.com/watch?v=RBNMxTXUOaM

(p.s. completely unrelated: I'd rather use -c:v libx265, almost half the size)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.