Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-05T04:30:16.513Z
Answers.LastActivityDate: 2021-08-05T04:30:16.513Z
Answers.UserDisplayName: Abdullah Ibn Fulan
Body: <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>
  
Tags: <video><ffmpeg><encoding><subtitles>
Title: Extract subtitles in time range using ffmpeg
UserDisplayName: superpupervlad
ThreadText: # 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 <start time> -to <end time> -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
  
  ```
  
  
  ---
  
  