Avidemux Forum

Avidemux => Windows => Topic started by: jimmy on May 10, 2024, 06:27:43 PM

Title: Adding External AC3 6 Channel Audio
Post by: jimmy on May 10, 2024, 06:27:43 PM
Adding an external AC3 6 channel to a project, this has happened several times:

1) open project and save in copy mode 6 channel AC3 audio
2) execute some edits to the video
3) add back in the external, unmolested 6 channel AC3 audio
4) encode both audio and video

The audio becomes muffled, skewed to the right channels.
Encoding the original internal track is fine. The problem is only with adding the external track.

Workaround, use mkvtoolnix, remux the encoded video with the original source file, then encode the audio in avidemux and the result is fine.

Audio samples attached.

https://we.tl/t-vrNluaaFIl
Title: Re: Adding External AC3 6 Channel Audio
Post by: eumagga0x2a on May 14, 2024, 09:58:42 PM
For some reason WeTransfer has marked the samples as already expired (I expected to have time until May 16). I'm sorry for not trying to get them earlier.

Which encoder for which codec do you use in Step 4? Why do you mention encoding video? Is it relevant to the audio (probably channel layout) issue? What is with audio playback after Step 3? Is it already messed up?
Title: Re: Adding External AC3 6 Channel Audio
Post by: jimmy on May 15, 2024, 08:33:26 PM
Thanks for your time.

- I missed the option in WeTransfer to increase the default expiry from 3 to 7 days
- I confirmed the problem with a different video, so mentioning video encoding was not relevant
- I confirmed that the extra step of remuxing, using either mkvtoolnix or avidemux, is required, audio
  quality of the remuxed audio in copy mode is fine, encoding the audio of the remux is fine
- I confirmed that using one step, adding external AC3 6 channel to avidemux and encoding,
  distorts the audio, the external AC3 6 channel needs to be internal before encoding
- so for step 3, remuxing was not an option due to video edits, external audio in copy mode is fine, encoding the external audio is distorted
- the only change I wanted to make to the AC3 6 channel was the gain, all other parameters were unchanged

New sample link:

https://we.tl/t-s0K0vK2JDP

Title: Re: Adding External AC3 6 Channel Audio
Post by: eumagga0x2a on May 16, 2024, 08:01:36 AM
Thank you, got the samples. Please specify which AC3 encoder you used. On Windows, there might be not just the AC3 encoder in libavcodec but also Aften among audio encoder plugins in Avidemux.

Quote from: jimmy on May 15, 2024, 08:33:26 PM- the only change I wanted to make to the AC3 6 channel was the gain

Was it necessary to reproduce the issue? Does re-encoding without any audio filters result in the same messed up channel layout?
Title: Re: Adding External AC3 6 Channel Audio
Post by: jimmy on May 17, 2024, 01:06:01 AM
Quote from: eumagga0x2a on May 16, 2024, 08:01:36 AMspecify which AC3 encoder

AC3 (lav) is the only AC3 option in the drop down list. The second AC3 option was removed quite some time back, no? Only AC3 (lav) in the plugins folder.

Quote from: eumagga0x2a on May 16, 2024, 08:01:36 AMre-encoding without any audio filters result in the same messed up channel layout

Yes, I reproduced the issue using no audio filters.
Title: Re: Adding External AC3 6 Channel Audio
Post by: eumagga0x2a on June 11, 2024, 01:56:26 PM
Should be fixed (https://github.com/mean00/avidemux2/commit/f74ae7f84447e4d85266a881b4d5f2bd13fa7898) now, we were using old channel layout API, partially gone in FFmpeg 6, fully removed in FFmpeg 7.

Refresh of nightlies will be requested once bundled FFmpeg has been successfully upgraded to 7.0.1 (which requires a lot of changes in different parts of Avidemux) and the worst issues identified and solved.

Thank you very much for your report.