<p>Correction: instead of</p>

<pre><code>ffmpeg -i output-audio.mp4 -i output-video.mp4 test-combine.mp4
</code></pre>

<p>it should be</p>

<pre><code>ffmpeg -i output-audio.mp4 -i output-video.mp4 -shortest output-combine.mp4
</code></pre>

<p>Kind of answer:</p>

<pre><code>ffmpeg -i output-video.mp4 -itsoffset 0.033333 -t 9.966666 -i output-audio.mp4  output-combine.mp4
</code></pre>

<p>seems to do the job, although the result differs in file-size slightly from an direct extraction (direct is bigger than combine) done with</p>

<pre><code>ffmpeg -accurate_seek -ss 30 -t 10 -i input.mp4 output-direct.mp4
</code></pre>

CC BY-SA 4.0
2018-05-13T13:51:01.007Z
2018-05-13T13:51:01.007Z
Earl of Sandwich
<p>When extracting audio and video separately from a mp4 and recombining again </p>

<pre><code>ffmpeg -accurate_seek -ss 30 -t 10 -i input.mp4 -vn output-audio.mp4
ffmpeg -accurate_seek -ss 30 -t 10 -i input.mp4 -an output-video.mp4
ffmpeg -i output-audio.mp4 -i output-video.mp4 output-combine.mp4
</code></pre>

<p>the three mp4-s have different length according to ffprobe:</p>

<pre><code>ffprobe output-video.mp4
Duration: 00:00:10.00, start: 0.000000, ...
ffprobe output-audio.mp4
Duration: 00:00:10.03, start: 0.033333, ...
ffprobe output-combine.mp4
Duration: 00:00:10.08, start: 0.033333, ...
</code></pre>

<p>when combining audio and video with <code>-shortest</code></p>

<pre><code>ffmpeg -i output-audio.mp4 -i output-video.mp4 test-combine.mp4
</code></pre>

<p>the length is</p>

<pre><code>ffprobe output-combine.mp4
Duration: 00:00:10.04, start: 0.033333, ...
</code></pre>

<p>How can the start-offset (0.033333) be avoided so that all parts have the same length and the original part can be restored by combining audio and video?</p>

CC BY-SA 4.0
2018-05-13T13:25:53.537Z
Share full log of `ffmpeg -i input.mp4`
Gyan
<video><ffmpeg><audio><mp4>
ffmpeg: How to avoid "start: 0.033333" when extraction audio from mp4
Earl of Sandwich
# ffmpeg: How to avoid "start: 0.033333" when extraction audio from mp4

(Asked by: username_0 on 2018-05-13)

When extracting audio and video separately from a mp4 and recombining again 
ffmpeg -accurate_seek -ss 30 -t 10 -i input.mp4 -vn output-audio.mp4
ffmpeg -accurate_seek -ss 30 -t 10 -i input.mp4 -an output-video.mp4
ffmpeg -i output-audio.mp4 -i output-video.mp4 output-combine.mp4

the three mp4-s have different length according to ffprobe:
ffprobe output-video.mp4
Duration: 00:00:10.00, start: 0.000000, ...
ffprobe output-audio.mp4
Duration: 00:00:10.03, start: 0.033333, ...
ffprobe output-combine.mp4
Duration: 00:00:10.08, start: 0.033333, ...

when combining audio and video with -shortest
ffmpeg -i output-audio.mp4 -i output-video.mp4 test-combine.mp4

the length is
ffprobe output-combine.mp4
Duration: 00:00:10.04, start: 0.033333, ...

How can the start-offset (0.033333) be avoided so that all parts have the same length and the original part can be restored by combining audio and video?

**Tags:** video, ffmpeg, audio, mp4

> **Comments:**
> **username_1**: Share full log of `ffmpeg -i input.mp4`  

---

## 1 answers

### Answer by username_0 on 2018-05-13. Score: 0

Correction: instead of
ffmpeg -i output-audio.mp4 -i output-video.mp4 test-combine.mp4

it should be
ffmpeg -i output-audio.mp4 -i output-video.mp4 -shortest output-combine.mp4

Kind of answer:
ffmpeg -i output-video.mp4 -itsoffset 0.033333 -t 9.966666 -i output-audio.mp4  output-combine.mp4

seems to do the job, although the result differs in file-size slightly from an direct extraction (direct is bigger than combine) done with
ffmpeg -accurate_seek -ss 30 -t 10 -i input.mp4 output-direct.mp4


---

