Answers.Body: <p>Found out that <code>ffmpeg</code> works on the text based subtitle file just as well:</p>
  <pre class="lang-sh prettyprint-override"><code>$ cat subtitles.srt
  1
  00:00:06,000 --&gt; 00:00:20,000
  This is demo subtitle 1
  
  2
  00:00:20,000 --&gt; 00:00:40,000
  This is demo subtitle 2
  
  $ ffmpeg -i subtitles.srt -ss 5 -t 60 -y cut.srt
  
  $ cat cut.srt
  1
  00:00:01,000 --&gt; 00:00:15,000
  This is demo subtitle 1
  
  2
  00:00:15,000 --&gt; 00:00:35,000
  This is demo subtitle 2
  
  $ ffmpeg -i subtitles.srt -ss 10 -t 60 -y cut.srt
  
  $ cat cut.srt
  1
  00:00:10,000 --&gt; 00:00:30,000
  This is demo subtitle 2
  </code></pre>
  <p>Just exactly as what I wanted.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-18T00:41:57.757Z
Answers.LastActivityDate: 2021-09-18T00:41:57.757Z
Answers.UserDisplayName: xpt
Body: <p>I managed to cut the video and keep subtitle in sync by embedding the subtitles in the video:</p>
  <pre><code>$ ffmpeg -i sample-mp4-file.mp4 -hide_banner \
      -vf subtitles=subtitles.srt -ss 0:30:00 -t 1:33:31 \
      OutputVideo.mp4
  </code></pre>
  <p>I'm wonder if it possible to cut subtitle file in accordance / sync with the cut video, instead of embedding them in the video?</p>
  
Tags: <ffmpeg><video><subtitles><sync>
Title: ffmpeg to cut subtitle file in sync with the cut video
UserDisplayName: xpt
ThreadText: # ffmpeg to cut subtitle file in sync with the cut video
  
  (Asked by: username_0 on 2021-09-13)
  
  I managed to cut the video and keep subtitle in sync by embedding the subtitles in the video:
  
  ```
  $ ffmpeg -i sample-mp4-file.mp4 -hide_banner \
      -vf subtitles=subtitles.srt -ss 0:30:00 -t 1:33:31 \
      OutputVideo.mp4
  
  ```
  
  I'm wonder if it possible to cut subtitle file in accordance / sync with the cut video, instead of embedding them in the video?
  
  **Tags:** ffmpeg, video, subtitles, sync
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-09-18. Score: 5 | Accepted answer
  
  Found out that `ffmpeg` works on the text based subtitle file just as well:
  
  ```sh
  $ cat subtitles.srt
  1
  00:00:06,000 --> 00:00:20,000
  This is demo subtitle 1
  
  2
  00:00:20,000 --> 00:00:40,000
  This is demo subtitle 2
  
  $ ffmpeg -i subtitles.srt -ss 5 -t 60 -y cut.srt
  
  $ cat cut.srt
  1
  00:00:01,000 --> 00:00:15,000
  This is demo subtitle 1
  
  2
  00:00:15,000 --> 00:00:35,000
  This is demo subtitle 2
  
  $ ffmpeg -i subtitles.srt -ss 10 -t 60 -y cut.srt
  
  $ cat cut.srt
  1
  00:00:10,000 --> 00:00:30,000
  This is demo subtitle 2
  
  ```
  
  Just exactly as what I wanted.
  
  
  ---
  
  