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.
Title: Re: Audio desync when editing mp4 file in copy mode
Post by: Hatsune on June 09, 2026, 04:20:45 AM
I'm using Avidemux 2.8.1 and the x264 codec + MP4 Muxer container. Firstly, there's no autosave for the current project – if the power goes out, everything goes. Another major issue: after processing the video, the audio becomes out of sync. This out-of-sync behavior increases over time. If the film is 2 hours long, the audio will be 2-3 seconds late at the end. The "Progressive High@L3" profile may be to blame. The "mp4" container and the timeline, which weren't available in older versions, may also be to blame. But even with the timeline set to its minimum, the audio still stutters. The video was tested on an LG-22MA53 TV. With Avidemux 2.7.4, the audio doesn't stutter. For example, download "Titanic" in 640x360 quality from kinovasek.net. Open the file in the program and save it with the following settings: Video - COPY, Audio - COPY, Format - MP4 Muxer. After this, the movie will play with out-of-sync audio. It turns out that only the MP4 container was changed, causing the audio to be out-of-sync. Now, repeat the same steps with "Titanic" in Avidemux 2.7.4, and the audio will be normal. Why? What am I doing wrong?