Avidemux Forum

Avidemux => Windows => Topic started by: Bangaio on June 03, 2017, 05:12:28 PM

Title: Audio desync when editing mp4 file in copy mode
Post by: Bangaio on June 03, 2017, 05:12:28 PM
avidemux_r170603_win64Qt5_424.zip

When editing the mp4 file in copy mode, the audio becomes desynced. (MP4v2 muxer)
mp4 file is from a livestream captured in ts and then converted to mp4 in copy mode (both using ffmpeg)

I tried editing the .ts file without converting to mp4, but avidemux hanged when trying to open it. And in my experience editing .ts files causes audio dropouts anyway.

I don't know if this is an issue of the video or of avidemux, since it doesn't happen with every video.

Files (mp4 original, mp4 edited, ts original):
https://mega.nz/#!bNdCAIaB!zhpqd6FQtDUgitLJRH9t6umZ10PBaP-_KML6CGkDg3k

Thanks in advance!

Title: Re: Audio desync when editing mp4 file in copy mode
Post by: eumagga0x2a on June 03, 2017, 07:24:54 PM
A few observations:

Title: Re: Audio desync when editing mp4 file in copy mode
Post by: Bangaio on June 07, 2017, 05:19:23 PM
- Yes to convert to mp4 in ffmpeg you have to add the aac_adtstoasc filter, forgot to mention that.

- How can i bypass the refineFps() option?

- I been editing other videos from the same livestream and -1300ms shift seems to work pretty well most of the time, so that's good.

Thanks.
Title: Re: Audio desync when editing mp4 file in copy mode
Post by: eumagga0x2a on June 07, 2017, 05:34:23 PM
Quote from: Bangaio on June 07, 2017, 05:19:23 PM
- How can i bypass the refineFps() option?

This is possible only if you build Avidemux from source yourself (which implies that you use either Linux or macOS): In avidemux_plugins/ADM_demuxers/Mp4/ADM_mp4.cpp in the function MP4Header::refineFps add

    return true;

straight after the opening curly bracket and (re)build Avidemux.