[FFmpeg-user] Concatenating audio files results in a file of the wrong length

Carl Eugen Hoyos ceffmpeg at gmail.com
Fri Jun 19 22:38:47 EEST 2020


Am Fr., 19. Juni 2020 um 21:25 Uhr schrieb Stephanye Carrier
<stoozor at gmail.com>:
>
> I have a project that requires me to demux audio from video files, cut
> the audio up in parts, then concatenate the parts back together and
> remux the audio and video together.

This is often not possible because of how audio and video are
interleaved in files.

> However, I am running into an issue where the resulting audio file is
> the wrong length which results in a desync.
>
> ffmpeg -hide_banner -i video.mp4 -vn -acodec copy audio.m4a
> ffmpeg -hide_banner -ss xx:xx:xx -i audio.m4a -to xx:xx:xx -c copy PartX.m4a
> ffmpeg -hide_banner -f concat -safe 0 -i concat.txt -c copy newaudio.m4a

Please remove -hide_banner if you want to support on this mailing list
and provide the command lines you tested together with the complete,
uncut console output.

Filters exist that allow you to cut and re-encode in one operation, this
will avoid the resync.
And if above input file is not the original, use originals instead.

Carl Eugen


More information about the ffmpeg-user mailing list