Answers.Body: <p>The <strong>order of the parameters</strong> is very important on <code>ffmpeg</code>.<br>
  Try this:</p>
  
  <pre><code>ffmpeg -ss 00:36:18 -i input.mp4 -vcodec copy -acodec copy -to 00:39:50 output.mp4
  </code></pre>
  
  <p>It seems that setting the <code>-ss</code> parameter <strong>before</strong> <code>-i</code> sets a keyframe at the beginning of the newly generated video.<br>
  Or so I understand from the Wiki page <a href="https://trac.ffmpeg.org/wiki/Seeking" rel="noreferrer">here</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-17T17:55:37.580Z
Answers.Text: Minor note: That's the wiki, not the [official documentation](https://ffmpeg.org/documentation.html). The wiki articles are written by users to supplement the docs, so they may contain less accurate information.
Answers.UserDisplayName: llogan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-11-07T17:24:49.790Z
Answers.Text: This was the answer which helped me to solve the issue.
Answers.UserDisplayName: Amessihel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-17T15:07:33.940Z
Answers.LastActivityDate: 2015-10-17T19:07:00.350Z
Answers.LastEditDate: 2015-10-17T19:07:00.350Z
Answers.UserDisplayName: Sopalajo de Arrierez
Answers.Body: <p>The video freezes because you aren't cutting at an <a href="https://en.wikipedia.org/wiki/Video_compression_picture_types" rel="nofollow">I-frame</a>, while using stream-copy mode. You'll have to re-encode the video, or choose a different start point, which happens to be an I-frame.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-17T12:47:29.003Z
Answers.Text: Is there any way to easily locate an I-frame in order to perform the cutting with `ffmpeg`?
Answers.UserDisplayName: Sopalajo de Arrierez
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-17T13:43:15.907Z
Answers.Text: See this - http://stackoverflow.com/a/17688356
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-17T15:08:23.437Z
Answers.Text: Thanks you, but this other one solved my day: https://trac.ffmpeg.org/wiki/Seeking (just change the order of `-ss` in the command line).
Answers.UserDisplayName: Sopalajo de Arrierez
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-29T06:07:21.173Z
Answers.LastActivityDate: 2015-09-29T07:32:44.243Z
Answers.LastEditDate: 2015-09-29T07:32:44.243Z
Answers.UserDisplayName: Gyan
Answers.Body: <p>What works for me was:</p>
  <p><code>ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c:v libx264 -c:a aac cut.mp4</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-01-20T16:29:37.967Z
Answers.LastActivityDate: 2023-01-20T16:30:03.907Z
Answers.LastEditDate: 2023-01-20T16:30:03.907Z
Answers.UserDisplayName: YodaCode
Body: <p>I use this to cut a part out of a mp4 file:</p>
  
  <pre><code>ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:36:18 -to 00:39:50 output.mp4
  </code></pre>
  
  <p>It works good but the video image is always freezed in the beginning for 1 second.</p>
  
  <p>Doesnt matter which video file I try and cut a part out of, it takes like 1 second before the video start.</p>
  
  <p>Heres an example: <div class="youtube-embed"><div>
                  <iframe width="640px" height="395px" src="https://www.youtube.com/embed/nhRTwhFc7Os?start=0"></iframe>
              </div></div></p>
  
  <p>Why?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-18T12:41:05.800Z
Comments.Text: It seems your youtube link is down, could you please keep the example live such that the question remains useful for future visitors?
Comments.UserDisplayName: Saaru Lindestøkke
Tags: <ffmpeg>
Title: ffmpeg, first second of cut video part freezed
UserDisplayName: gorschitsa
ThreadText: # ffmpeg, first second of cut video part freezed
  
  (Asked by: username_0 on 2015-09-29)
  
  I use this to cut a part out of a mp4 file:
  
  ```
  ffmpeg -i input.mp4 -vcodec copy -acodec copy -ss 00:36:18 -to 00:39:50 output.mp4
  
  ```
  
  It works good but the video image is always freezed in the beginning for 1 second.
  
  Doesnt matter which video file I try and cut a part out of, it takes like 1 second before the video start.
  
  Heres an example:
  
  Why?
  
  **Tags:** ffmpeg
  
  > **Comments:**
  > **username_1**: It seems your youtube link is down, could you please keep the example live such that the question remains useful for future visitors?  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2015-10-17. Score: 9
  
  The **order of the parameters** is very important on `ffmpeg`.  
  Try this:
  
  ```
  ffmpeg -ss 00:36:18 -i input.mp4 -vcodec copy -acodec copy -to 00:39:50 output.mp4
  
  ```
  
  It seems that setting the `-ss` parameter **before** `-i` sets a keyframe at the beginning of the newly generated video.  
  Or so I understand from the Wiki page [here](https://trac.ffmpeg.org/wiki/Seeking).
  
  > **Comments:**
  > **username_3**: Minor note: That's the wiki, not the [official documentation](https://ffmpeg.org/documentation.html). The wiki articles are written by users to supplement the docs, so they may contain less accurate information.  
  > **username_4**: This was the answer which helped me to solve the issue.  
  
  ---
  
  ### Answer by username_5 on 2015-09-29. Score: 4
  
  The video freezes because you aren't cutting at an [I-frame](https://en.wikipedia.org/wiki/Video_compression_picture_types), while using stream-copy mode. You'll have to re-encode the video, or choose a different start point, which happens to be an I-frame.
  
  > **Comments:**
  > **username_2**: Is there any way to easily locate an I-frame in order to perform the cutting with `ffmpeg`?  
  > **username_5**: See this - http://stackoverflow.com/a/17688356  
  > **username_2**: Thanks you, but this other one solved my day: https://trac.ffmpeg.org/wiki/Seeking (just change the order of `-ss` in the command line).  
  
  ---
  
  ### Answer by username_6 on 2023-01-20. Score: 2
  
  What works for me was:
  
  `ffmpeg -ss 00:01:00 -i video.mp4 -to 00:02:00 -c:v libx264 -c:a aac cut.mp4`
  
  
  ---
  
  