<p>Apply the subtitles filter before the split. Note that subtitles will be, proportionally, the same size in each output stream.</p>

<p><code>-filter_complex "[0:v]subtitles=sub.srt:force_style='Fontsize=18,MarginV=15',split=2[v480][v720];
[v480]scale=858x480[o480];[v720]scale=1280x720[o720]"</code></p>

CC BY-SA 4.0
2020-05-01T17:55:05.560Z
Sure, but if I want video quality to be lower, I don't want the subtitles quality to degrade, that's why I make subtitles burning after scaling
fantom
CC BY-SA 4.0
2020-05-01T18:18:08.677Z
Then you'll need to apply subtitles twice
Gyan
CC BY-SA 4.0
2020-04-29T13:20:25.423Z
2020-04-29T13:20:25.423Z
Gyan
<p>I want to split input video, scale each stream using different parameters and add subtitles to each output, using the same parameters. I can do it repeating <code>subtitles</code> filter in each chain, can I avoid this duplication?</p>

<pre><code>ffmpeg \
    -i input.mp4
    -filter_complex "[v:0]split=2[v480][v720];
[v480]scale=858x480,subtitles=sub.srt:force_style='Fontsize=18,MarginV=15'[o480];
[v720]scale=1280x720,subtitles=sub.srt:force_style='Fontsize=18,MarginV=15'[o720]" \
    -map [o480] -c:v libx264 -b:v 2000k -bufsize:v 3000k -map 0:a -c:a aac -b:a 128k -ac 2 480.mp4 \
    -map [o720] -c:v libx264 -b:v 4000k -bufsize:v 5000k -map 0:a -c:a aac -b:a 128k -ac 2 720.mp4
</code></pre>

<p>I this example I want to avoid repeating <code>subtitles=sub.srt:force_style='Fontsize=18,MarginV=15'</code>, is it possible?</p>

<ffmpeg>
Same filter in different chains
fantom
# Same filter in different chains

(Asked by: username_0 on 2020-04-29)

I want to split input video, scale each stream using different parameters and add subtitles to each output, using the same parameters. I can do it repeating subtitles filter in each chain, can I avoid this duplication?
ffmpeg \
    -i input.mp4
    -filter_complex "[v:0]split=2[v480][v720];
[v480]scale=858x480,subtitles=sub.srt:force_style='Fontsize=18,MarginV=15'[o480];
[v720]scale=1280x720,subtitles=sub.srt:force_style='Fontsize=18,MarginV=15'[o720]" \
    -map [o480] -c:v libx264 -b:v 2000k -bufsize:v 3000k -map 0:a -c:a aac -b:a 128k -ac 2 480.mp4 \
    -map [o720] -c:v libx264 -b:v 4000k -bufsize:v 5000k -map 0:a -c:a aac -b:a 128k -ac 2 720.mp4

I this example I want to avoid repeating subtitles=sub.srt:force_style='Fontsize=18,MarginV=15', is it possible?

**Tags:** ffmpeg


---

## 1 answers

### Answer by username_1 on 2020-04-29. Score: 1

Apply the subtitles filter before the split. Note that subtitles will be, proportionally, the same size in each output stream.

`-filter_complex "[0:v]subtitles=sub.srt:force_style='Fontsize=18,MarginV=15',split=2[v480][v720];
[v480]scale=858x480[o480];[v720]scale=1280x720[o720]"`

> **Comments:**
> **username_0**: Sure, but if I want video quality to be lower, I don't want the subtitles quality to degrade, that's why I make subtitles burning after scaling  
> **username_1**: Then you'll need to apply subtitles twice  

---

