Author Topic: [FIXED] AAC Encoder Problem on v2.6 Build r8494  (Read 8795 times)

xpmule

  • Newbie
  • *
  • Posts: 33
[FIXED] AAC Encoder Problem on v2.6 Build r8494
« on: May 29, 2013, 10:35:38 PM »
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 ;)
« Last Edit: June 01, 2013, 08:10:34 AM by xpmule »

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10974
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #1 on: May 30, 2013, 08:04:44 AM »
8494 is pretty old, could you recheck with a more recent version ?

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #2 on: May 30, 2013, 08:23:46 AM »
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:
Linux:
Code: [Select]
#!/bin/bash
for FIL in `ls *mp4 | sort` ; do
  avidemux3_qt4 --force-alt-h264 --load "$FIL" --run ac3toStereo.py --save ${FIL%.*}.avi --quit
done

Windows:
Code: [Select]
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
« Last Edit: May 30, 2013, 09:11:49 AM by Jan Gruuthuse »

xpmule

  • Newbie
  • *
  • Posts: 33
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #3 on: May 30, 2013, 12:22:10 PM »
mean
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..
edit:
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.
« Last Edit: May 30, 2013, 12:27:49 PM by xpmule »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #4 on: May 30, 2013, 12:45:37 PM »
32-bit installer can be found here:
http://sourceforge.net/projects/avidemux/files/avidemux/2.6.4/avidemux_2.6.4_win32.exe
then update by downloading from nightly. 7zip unpack and replace the installed content with unpacked
http://www.avidemux.org/nightly/win32/

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

xpmule

  • Newbie
  • *
  • Posts: 33
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #5 on: May 30, 2013, 01:04:18 PM »
Ok i did some quick checking and figured i would post back what i found so far and thanks again Jan :)

http://uploaded.net/file/zhzg9cz9
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

  • Hero Member
  • *****
  • Posts: 6051
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #6 on: May 30, 2013, 01:18:12 PM »
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
« Last Edit: May 30, 2013, 01:31:09 PM by Jan Gruuthuse »

xpmule

  • Newbie
  • *
  • Posts: 33
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #7 on: May 30, 2013, 01:48:04 PM »
interesting..
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.
« Last Edit: May 30, 2013, 02:06:21 PM by xpmule »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #8 on: May 30, 2013, 02:07:23 PM »
confirmed left audio only


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

« Last Edit: May 30, 2013, 02:14:54 PM by Jan Gruuthuse »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #9 on: May 30, 2013, 03:58:47 PM »
seems to be fixed in r8707

xpmule

  • Newbie
  • *
  • Posts: 33
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #10 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 ?

edit:
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 :)
« Last Edit: May 31, 2013, 11:20:39 PM by xpmule »

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6051
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #11 on: June 01, 2013, 04:59:16 AM »
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.

xpmule

  • Newbie
  • *
  • Posts: 33
Re: AAC Encoder Problem on v2.6 Build r8494
« Reply #12 on: June 01, 2013, 08:09:55 AM »
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

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10974
Re: [FIXED] AAC Encoder Problem on v2.6 Build r8494
« Reply #13 on: June 01, 2013, 10:07:40 AM »
AAC is not strict cbr