[FFmpeg-user] CUTTING A VIDEO WITHOUT RE-ENCODING GETS AUDIO OUT OF SYNC

Micael Silva micaelsilva at gmail.com
Sun Sep 1 02:04:18 EEST 2019


On Thu, Aug 29, 2019 at 6:41 PM Alejandro Escudero <
escuderoserrano at hotmail.com> wrote:

> Hi!
>
> I am trying to cut a video file in to parts, without re-enconding the
> video, but i get a video file with non sync audio, how can I solve these
> with out re-encoding since I need a fast way to cut.
>
> I used this command:
>
>
> ffmpeg -i file.mp4 -ss 00:03:00 -t 00:05:00 -c copy part1.mp4
>
> Thanks!
>
>
> Alejandro
>

By my own experience I found that it usually happens because the cut falls
somewhat distant of the next keyframe of the video. The player tries to
play the video track but have to wait until the next keyframe but the audio
start to play immediately, resulting in loss of sync.

Try to cut closeset to the keyframe. Unfortunally I had no recipe for that,
I fixed my cases on the try-and-error method.


More information about the ffmpeg-user mailing list