<p>The answer is contained in this SE answer <a href="https://unix.stackexchange.com/a/388148/551103">https://unix.stackexchange.com/a/388148/551103</a></p>
<p>You use two <code>-ss.</code> Before the input: <code>-ss ${starting_timestamp_minus_10s}</code>. After the input: <code>-ss 10</code>.</p>
<p>i.e.</p>
<pre class="lang-bash prettyprint-override"><code>ffmpeg -ss ${starting_timestamp_minus_10s} -i input_file -ss 10 output_file
</code></pre>

CC BY-SA 4.0
2023-04-20T06:41:11.047Z
2023-04-20T06:47:38.270Z
2023-04-20T06:47:38.270Z
Tom Huntington
<p>I use ffmpeg because I want to do video editing without re-encoding. I only know the bare bones options for this though:</p>
<pre><code>ffmpeg -i input.mp4 -ss 00:00:30 -to 00:05:00 -acodec copy -vcodec copy output.mp4
</code></pre>
<p>The audio, for the output of the above command, starts at 30 seconds, however this video only starts at the next i-frame after the 30 second mark, sometimes this might even be around 33 seconds.</p>
<blockquote>
<p>Using -ss as input option together with -c:v copy might not be accurate since ffmpeg is forced to only use/split on i-frames. Though it will—if possible—adjust the start time of the stream to a negative value to compensate for that. Basically, if you specify &quot;second 157&quot; and there is no key frame until second 159, it will include two seconds of audio (with no video) at the start, then will start from the first key frame. So be careful when splitting and doing codec copy. <a href="https://trac.ffmpeg.org/wiki/Seeking" rel="nofollow noreferrer">https://trac.ffmpeg.org/wiki/Seeking</a></p>
</blockquote>
<p>This is quite annoying, to have audio playing and be waiting for the video.</p>
<p>Is there a way to seek the audio to the same timestamp as the first video time?</p>

CC BY-SA 4.0
2022-09-28T22:29:21.057Z
Did you ever find a solution to this issue? I'm encountering the same problem.
ACPrice
CC BY-SA 4.0
2022-09-28T22:35:23.400Z
@ACPrice no perhaps you should ask on a different stackexchange site
Tom Huntington
CC BY-SA 4.0
2023-04-20T06:41:29.187Z
@ACPrice I figured out the answer
Tom Huntington
<ffmpeg>
ffmpeg clipping: video splits on i-frames but not audio
Tom Huntington
# ffmpeg clipping: video splits on i-frames but not audio

(Asked by: username_0 on 2022-03-23)

I use ffmpeg because I want to do video editing without re-encoding. I only know the bare bones options for this though:
ffmpeg -i input.mp4 -ss 00:00:30 -to 00:05:00 -acodec copy -vcodec copy output.mp4

The audio, for the output of the above command, starts at 30 seconds, however this video only starts at the next i-frame after the 30 second mark, sometimes this might even be around 33 seconds.

Using -ss as input option together with -c:v copy might not be accurate since ffmpeg is forced to only use/split on i-frames. Though it will—if possible—adjust the start time of the stream to a negative value to compensate for that. Basically, if you specify "second 157" and there is no key frame until second 159, it will include two seconds of audio (with no video) at the start, then will start from the first key frame. So be careful when splitting and doing codec copy. https://trac.ffmpeg.org/wiki/Seeking

This is quite annoying, to have audio playing and be waiting for the video.
Is there a way to seek the audio to the same timestamp as the first video time?

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Did you ever find a solution to this issue? I'm encountering the same problem.  
> **username_0**: @username_1 no perhaps you should ask on a different stackexchange site  
> **username_0**: @username_1 I figured out the answer  

---

## 1 answers

### Answer by username_0 on 2023-04-20. Score: 0 | Accepted answer

The answer is contained in this SE answer https://unix.stackexchange.com/a/388148/551103
You use two -ss. Before the input: -ss ${starting_timestamp_minus_10s}. After the input: -ss 10.
i.e.
ffmpeg -ss ${starting_timestamp_minus_10s} -i input_file -ss 10 output_file


---

