<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>

CC BY-SA 3.0
2015-10-17T17:55:37.580Z
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.
llogan
CC BY-SA 4.0
2020-11-07T17:24:49.790Z
This was the answer which helped me to solve the issue.
Amessihel
CC BY-SA 3.0
2015-10-17T15:07:33.940Z
2015-10-17T19:07:00.350Z
2015-10-17T19:07:00.350Z
Sopalajo de Arrierez
<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>

CC BY-SA 3.0
2015-10-17T12:47:29.003Z
Is there any way to easily locate an I-frame in order to perform the cutting with `ffmpeg`?
Sopalajo de Arrierez
CC BY-SA 3.0
2015-10-17T13:43:15.907Z
See this - http://stackoverflow.com/a/17688356
Gyan
CC BY-SA 3.0
2015-10-17T15:08:23.437Z
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).
Sopalajo de Arrierez
CC BY-SA 3.0
2015-09-29T06:07:21.173Z
2015-09-29T07:32:44.243Z
2015-09-29T07:32:44.243Z
Gyan
<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>

CC BY-SA 4.0
2023-01-20T16:29:37.967Z
2023-01-20T16:30:03.907Z
2023-01-20T16:30:03.907Z
YodaCode
<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>

CC BY-SA 3.0
2015-10-18T12:41:05.800Z
It seems your youtube link is down, could you please keep the example live such that the question remains useful for future visitors?
Saaru Lindestøkke
<ffmpeg>
ffmpeg, first second of cut video part freezed
gorschitsa
# 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.

> **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`


---

