<p>The <code>-ss</code> and <code>-to</code> flag specifies start time and end time in format hh:mm:ss. Here goes the code</p>
<pre><code>ffmpeg -i original_video.mp4 -ss &lt;start time&gt; -to &lt;end time&gt; -c:s copy cropped_sub.srt
</code></pre>
<p>This extract first subtitle stream in between start and end time in cropped_sub.srt. And now combining cropped files.</p>
<pre><code>ffmpeg -i cropped_video.mp4 -i cropped_sub.srt -c copy cropped_combined.mp4
</code></pre>

CC BY-SA 4.0
2021-08-05T04:30:16.513Z
2021-08-05T04:30:16.513Z
Abdullah Ibn Fulan
<p>I have original video (with subs) and cropped version of it (without subs). I need to add subtitles from original video into cropped in appropriate time range.</p>
<p>I think the best way to do is:</p>
<ol>
<li>Extract subtitles from <code>$start</code> to <code>$end</code>. I found this command <code>ffmpeg -i Movie.mkv -map 0:s:0 subs.srt</code>. But</li>
</ol>
<ul>
<li>I don't know how to specify time</li>
<li>Will data in subs.srt be correct? Since I want to add subs to cropped vesrion, time of all subs needed to be <code>$original_time - $start</code>.</li>
<li>It extract only one track</li>
</ul>
<ol start="2">
<li>Add subs.srt to cropped video.</li>
</ol>

<video><ffmpeg><encoding><subtitles>
Extract subtitles in time range using ffmpeg
superpupervlad
# Extract subtitles in time range using ffmpeg

(Asked by: username_0 on 2021-05-08)

I have original video (with subs) and cropped version of it (without subs). I need to add subtitles from original video into cropped in appropriate time range.

I think the best way to do is:

1. Extract subtitles from `$start` to `$end`. I found this command `ffmpeg -i Movie.mkv -map 0:s:0 subs.srt`. But

* I don't know how to specify time
* Will data in subs.srt be correct? Since I want to add subs to cropped vesrion, time of all subs needed to be `$original_time - $start`.
* It extract only one track

2. Add subs.srt to cropped video.

**Tags:** video, ffmpeg, encoding, subtitles


---

## 1 answers

### Answer by username_1 on 2021-08-05. Score: 0

The -ss and -to flag specifies start time and end time in format hh:mm:ss. Here goes the code
ffmpeg -i original_video.mp4 -ss  -to  -c:s copy cropped_sub.srt

This extract first subtitle stream in between start and end time in cropped_sub.srt. And now combining cropped files.
ffmpeg -i cropped_video.mp4 -i cropped_sub.srt -c copy cropped_combined.mp4


---

