April 18, 2021, 05:09:10 PM



[FIXED] AAC Encoder Problem on v2.6 Build r8494

Started by xpmule, May 29, 2013, 10:35:38 PM

Previous topic - Next topic


May 29, 2013, 10:35:38 PM Last Edit: June 01, 2013, 08:10:34 AM by xpmule
So i recently grabbed about 10 gigs of videos from a torrent online and i re-encoded the audio from AC3 5.1 448kbps to AAC Stereo (128kbps) only to notice long after i deleted the source files that every single video was screwed up really bad.
I have done this before with out any problems so i don't know what the problem was / is..
Sometimes i re-encode audio on videos i download from 6 channel to stereo because i only have a stereo setup
and 5.1 or 6 channel audio etc is often mixed down at a drastically low volume compared to stereo sources on my PC.
(i have tried using FFDShow and LAV for loudness EQ but i use my Realtek HD Audio driver for this now)

I made a script (attached to topic) that sets the container to mp4 (like the original files) and then i made it set video to copy
and then i made the script set remix to stereo in the audio properties.
The end result is LOT of videos with almost all of one channel of audio missing or almost totally missing.
I noticed the volume level was WAY too low and figured it was the amp or cables etc but i can see clearly
through all digital pc sources that the right hand channel is almost gone except for random spikes of 1/2 of 100 level
and the left channel is like half way up the scale and i have to blast the volume super high to hear anything
and i also checked the balance on my amp and nothing is coming out of one side.
(no other video(s) has this issue either and i have a 100's of gig's many encoded with Avidemux)

I have been using Avidemux the old version and the new version mostly for this specific purpose for years.
I have had this problem once before but it was a long time ago and i think it was on 2.5 maybe.

So this sucks because the download took forever and i was hoping to make the content more appropriate for me needs.
smaller file size and good audio levels for a stereo setup (left + right only)
So i am going to have to re-download a crap load of videos because what i got now is wrecked and useless :(
Figured i should mention this even though there is nothing i can do about it now.. next time ill leave it alone lol

I mentioned what build i was using in the topic title and i will try and add the full script to this post if any one wants to check this issue out. I was using a QTscript with the .admjs extension that i originally made to convert audio + video, but
I was loading my script from the (windows) GUI 'custom' menu and once it loaded i manually switched the video encoder setting to 'COPY' and then i selected save video.
lastly i will be grabbing the source videos again so later i can provide a sample for testing if needed.
Hope i can save some people some hassles or help identify a bug (maybe in my script ???)

Thanks for reading ;)


8494 is pretty old, could you recheck with a more recent version ?

Jan Gruuthuse

May 30, 2013, 08:23:46 AM #2 Last Edit: May 30, 2013, 09:11:49 AM by Jan Gruuthuse
What mean says above.

you might have a look at mean's script: [2.6.4] Convert a whole folder

current avidemux is 2.6.4 branch. I'm not that an expert with scripting.
You do know that videos can have multi tracks with multiple channels. Also some ac3 track can be DTS and that could cause an issue to.
When using a saved project Tinypy, I found that parameters are better passed on.
Load one video, set audio and video codec and parameters you need. Now save the project: Main Menu: File: Tinypy Project: Save As Project. Give it a name that suits you like ac3toStereo. Here a sample how to load the project file in script:
for FIL in `ls *mp4 | sort` ; do
  avidemux3_qt4 --force-alt-h264 --load "$FIL" --run ac3toStereo.py --save ${FIL%.*}.avi --quit

set avidemux="C:\Program Files\Avidemux 2.6\avidemux3.exe"
for %%f in (*.mp4) do %avidemux% --force-alt-h264 --load "%%f" --run ac3toStereo.py --save "%%f.avi" --quit

windows: could need some tweaking in the set above: for avidemux name and location.

You need to edit ac3toStereo.py first. It is explained here: 2.6 audio track switching in job.py


May 30, 2013, 12:22:10 PM #3 Last Edit: May 30, 2013, 12:27:49 PM by xpmule
thanks for the reply ..and Jan ;)
I will try the newest build.
Normally i would grab the newest build from http://avidemux.razorbyte.com.au/
but that seems to be gone now and it is also still linked to from the main Avidemux page.
I have a bunch of bookmarks so i will check them and look at other topics to see where to get the builds now..
I see the stickied topic lol
Already had it bookmarked as my 2nd choice :)

Also i'm not sure how the scripting can be a problem because all it's doing is setting the same options as using the GUI.
So from AC3 5.1 converted to Stereo does in fact work but one of the channels is almost gone leaving me with only the left with output.
Nothing unusual about what i did its a standard thing to do and didn't require any special scripting i think.
Not only that but the scripting i used was mostly copied and pasted from the official scripts. (the audio parts were for sure)
But Jan i will look into what you suggested and see if that helps at all.

Jan Gruuthuse

32-bit installer can be found here:
then update by downloading from nightly. 7zip unpack and replace the installed content with unpacked

64-bit windows not aware if installer is currently available?


Ok i did some quick checking and figured i would post back what i found so far and thanks again Jan :)

That is a uncensored sample it's from the TV show Tosh.0 22 seconds long
I hope that is ok to post, since its less than 30 seconds i hope its ok to post that.
I realized that i did not re-encode all the videos so that one i uploaded is untouched as i got it.

Anyway i did a manual install from the nightly link x64 on Win 7 (2.6.4 build 8704)
The first thing i noticed is my appdata / roaming /avidemux scripts didn't show up
in the custom menu in the GUI and they did when i changed the extension to .js
but then they failed to run with an error message in the log file.
So i figured who cares about the scripts lets just run this manually for testing..
I loaded the sample video uploaded selected .mp4 and then selected FAAC / 128 / remix to stereo
and saved and i can see the exact same problem i mentioned earlier so i thought i should try out the LAV option too
and that also produced the exact same problem i mentioned..
I did find it a bit strange that FAAC produced a video that MediaInfo reported as 118kbps
and the LAV AAC re-encode produced a video that reported 58.6 kbps even though both times i selected 128 kbps.

Lastly i will add in case the info is useful that i only use the LAV x64 codec package with Icaros for thumbnails
And i only use x64 WMC + x64 WMP current versions. I have no other codec packs installed etc.
I have LAV set to play all content be it avi or mkv or mp4 etc
Starting to wonder if its maybe something with the source video that is causing a problem.

Jan Gruuthuse

May 30, 2013, 01:18:12 PM #6 Last Edit: May 30, 2013, 01:31:09 PM by Jan Gruuthuse
In ubuntu avidemux does not recognize AC3 5.1, it shows as AC3 stereo for Bonus 1.mp4. It saved ok to stereo FAAC / 128 / without remix to stereo


May 30, 2013, 01:48:04 PM #7 Last Edit: May 30, 2013, 02:06:21 PM by xpmule
so i tried re-encoding with out using the Remix to stereo option
and i tested the video and once again i see no audio on the right side channel.
the sound level is only coming out of the left side and nothing from the right.
I checked to see if using that option made any difference and it did not..
I used BeyondCompare to do a hex comparison of the re-encode with and with out remix to Stereo
and both videos came out binary exact, not 1 byte different.

Jan can you see or hear anything coming out of the right channel after the re-encoding of the audio ?
I have been checking with the LAV codec audio status tray icon tool and also with my ears by changing the balance.
I think something is there but its almost non existent on one side and on the other its normal.
Make me wonder if Avidemux during the process is maybe mapping the center channel to the right side etc
I don't know how Avidemux does all that though behind the scenes.

edit: 1
I just tried encoding to MP3 and i see the same problem but now the missing channel is the left not right side. weird !

edit: 2
I tried saving the audio with menu option "save audio" and the encoder option was set to MP3 with no other options set.
I launched it (sample.mp3) with Winamp (using it owns audio decoders) at that too had the Left channel missing like earlier..
Saving to MKV instead of MP4 didn't change anything either.

Jan Gruuthuse

May 30, 2013, 02:07:23 PM #8 Last Edit: May 30, 2013, 02:14:54 PM by Jan Gruuthuse
confirmed left audio only

original has 5.1 tracks, however only stereo in this sample:

Jan Gruuthuse


May 31, 2013, 11:15:23 PM #10 Last Edit: May 31, 2013, 11:20:39 PM by xpmule
cool i'll try out that newer build and good detective work.
i wished "Spek" would be able to show individual channels.
(that is what i use to view spectrums usually)
If i understood your reply i think what your saying is that although the sample
is in fact a 5.1 channel audio clip there is nothing to hear in 3 of the channels
because they are empty right ?

hmm r8704 is now the only build for 32/64 win on the nightly server.
i'll just wait a while and check back at some point.. no rush here on anything.

Thanks a lot for your help Jan :)

Jan Gruuthuse

Quote from: xpmule on May 31, 2013, 11:15:23 PM
cool i'll try out that newer build and good detective work.
i wished "Spek" would be able to show individual channels.
(that is what i use to view spectrums usually)
If i understood your reply i think what your saying is that although the sample
is in fact a 5.1 channel audio clip there is nothing to hear in 3 of the channels
because they are empty right ?
Was silent in the sample you provided.
Audacity: drag and drop video on it and most audio is extracted. Tip from user styrol do install their FFmpeg import/export library. And while you're at it LAME MP3 encoder (export) to.


Ok i noticed the newer build is available now too :)
Thanks for the tip on Audacity i have used that before but didn't get into it much.

Just tried the new build on the sample and is does seem fixed like you said :)
I also noticed the settings behavior changed..
Before hand if you picked the codec and saved Stereo was default
now it retained the multi channel audio so i did a another encoding
and that time i selected remix to stereo and it seemed to work perfect now hooray lol

only thing i am scratching my head about now though is why MediaInfo reports slightly
different bit-rates though .. for example this newest test encode on the sample provided
a video with 118kbps @ Stereo and if i selected only FAAC with no remix stereo option it reported
132kbps at 5.1. although if its close enough then i don't care lol