Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Picketlaw1 on April 01, 2020, 07:34:13 PM

Title: Garbled Audio
Post by: Picketlaw1 on April 01, 2020, 07:34:13 PM
I'm running version 2.7.5 in Avidemux. I have an Mp4 video file I obtained from my mobile phone and opened it on Avidemux. I wanted to save the video in MPEG4(xvid) and the sound in MP3(lame) with the MP4 Muxer, after having rotated the video, used sws resize to change its size and add black borders so I can append to an existing video. All went well so I saved the video and sound but when I opened the saved video my sound was garbled. I have tried it by separating the sound from the original video then adding it to a video only file but the result was the same. Any suggestions as to where I'm going wrong?
Title: Re: Garbled Audio
Post by: eumagga0x2a on April 01, 2020, 08:27:56 PM
Is the audio track in mono? If yes, this is a known issue, on my todo list.

If the audio track has more channels, have you verified that the issue persists with the latest nightly? --> https://avidemux.org/nightly/
Title: Re: Garbled Audio
Post by: Picketlaw1 on April 01, 2020, 10:13:15 PM
You're correct, the track is in mono. Any suggestions how I could get around the problem?
Title: Re: Garbled Audio
Post by: eumagga0x2a on April 01, 2020, 10:31:59 PM
The sound should be broken only in Avidemux, i.e. you can't edit the saved file, but it should play fine in video players. The issue affects AFAIR only mp3.
Title: Re: Garbled Audio
Post by: dosdan on April 01, 2020, 10:34:05 PM
Quote from: Picketlaw1 on April 01, 2020, 10:13:15 PM
You're correct, the track is in mono. Any suggestions how I could get around the problem?

As a simple workaround, before loading the MP4 with a single (mono) channel in ADM, use FFMPEG to duplicate the audio channel. (The video stream is copied, so no video quality loss.) This is an extremely quick operation. The resultant MP4 has "2ch" audio, rather than "stereo", because both channels in the audio stream will be the same.

ffmpeg -i mono_audio.mp4 -c:v copy  -ac 2 2ch_audio_test.mp4

The new MP4 will be slightly larger:
02/04/2020  08:25 AM        33,279,119 mono_audio.mp4
02/04/2020  08:39 AM        33,559,911 2ch_audio_test.mp4


BTW, I didn't have a MP4 with a single (mono) audio channel to test with, so I used a similar FFMPEG command line, but with "-ac 1", to create one.

Dan.
Title: Re: Garbled Audio
Post by: eumagga0x2a on April 01, 2020, 10:41:56 PM
In Avidemux, enabling remixing to stereo in audio filters when re-encoding the audio track in the original video should do the trick too. But I assume that it is unnecessary as long as the resulting video doesn't need to be edited in Avidemux.
Title: Re: Garbled Audio
Post by: Picketlaw1 on April 02, 2020, 09:45:34 AM
Many thanks for your replies - very much appreciated from a novice!! I'll try your suggestions and see how I get on. Stay safe from Covid-19 - not nice!
Title: Re: Garbled Audio
Post by: eumagga0x2a on April 02, 2020, 01:56:16 PM
Should be fixed now by [demuxers/Mp4] Fix wrong number of channels for mono MP3 audio tracks, verify MP3 byterate (https://github.com/mean00/avidemux2/commit/006519694fff5ba6ed13bf14b48e8dd83bd2d768), please try a future nightly.
Title: Re: Garbled Audio
Post by: Picketlaw1 on April 02, 2020, 06:00:42 PM
eumagga0x2a many thanks for an amazing amount of work - I feel very humbled! However, being a novice I'm not very sure what I should do now!
Title: Re: Garbled Audio
Post by: Picketlaw1 on April 02, 2020, 06:22:19 PM
I found the revised Avidemux programme on Nightly automated builds, downloaded the 64 bit package, tried it and it worked!! I am so thankful!!