Log in

View Full Version : mp4 (x264)with AAC to AVCHD problems


mpholic
27th October 2010, 22:29
Hello, thanks for reading my post.

I am trying to convert a mp4 (x264) video with AAC audio to AVCHD so that I can burn it to a disc and play it on my Blu-ray player.

I tried the current version of AVCHDcoder but apparently there is a bug converting AAC to AC3. The trouble reportedly resides in Faad.exe and is yet to be fixed. I understand that AVCHDcoder is a GUI and uses existing tools to automate the necessary steps.

While we are waiting for the AVCHDcoder to be updated (hopefully) could I possibly receive some guidance on doing this manually?

I did a little research and if I understand it correctly the audio needs to seperated (demux?) from the video converted and then rejoined (remux?).

Could someone in the know outline the steps (and which tools to use) that AVCHD uses to perform it's magic?

I beleive all the tools I need reside in the tools directory along with the other programs installed manually with AVCHDcoder.

If all this is unnecessary and there is another GUI which does mp4 to AVCHD conversion I would appreciate that info also.

Please excuse my ignorance I'm just barely keeping my head above water with some of these things.

Thank You very much

Inspector.Gadget
27th October 2010, 23:12
Post a Mediainfo "Text" view of the file in question in a codebox (Go Advanced to see the button) in a new post in this thread.

Adub
29th October 2010, 06:01
You should be able to the conversion using multiAVCHD. I never have any problems with its output AVCHDs.

mpholic
29th October 2010, 19:50
Yes, multiAVCHD worked. I burned and a disk and it worked great except for one thing. The audio channels seem to be misplaced. Center channel info is coming out of the left main and the right main seems to be coming out of the center channel etc.

I don't know if this is a problem with the origianl audio stream or if it happend during transcoding. Need to check the original.

Thanks

tebasuna51
30th October 2010, 12:33
Yes, please check the original, because the faad output have the channels correctly mapped.

mpholic
2nd November 2010, 03:38
The original file has the audio channels correctly mapped.

The audio conversions implemented by multiAVCHD created the improperly mapped channels. From what I gather by the info provided in a chart at the bottom of this page

http://avisynth.org/mediawiki/GetChannel

the channel numbers vary by format. If the channels are not remapped to accomodate these differences the hardware decoders in your audio equipment eill misdirect these channels.

The solution turned out to be quite simple (it usually is). There is a channel remap option built into the audio section of multiAVCHD. I did not notice this option the first time I used the program, most likely since I saw no need for it at the time.

Once I realized the option was needed and using the info provided by the chart I remapped the channels and all is well.

Note that there is a intermediate step in the audio conversion. It is not a direct conversion from AAC to AC3. According to the log files it is AAC>PCM>AC3. So you will need to remap based on the differences between AAC, WAV and AC3. Specifically you will need to swap Front Right with Front Center and swap Rear Right and LFE.

Thanks

tebasuna51
2nd November 2010, 13:26
I dont know how multiAVCHD make the audio conversion, maybe use a buggy decoder.

Of course to convert an audio format to another always we need decode the first format to uncompressed samples (PCM), but is a decoder task make the appropriate channel map to output PCM samples in the standard WAVE_FORMAT_EXTENSIBLE order.

The encoder must accept this standard order and remap the channels to their internal order.

Inside AviSynth the channel order must be always FL,FR,FC,LFE,BL,BR,... like WAVE_FORMAT_EXTENSIBLE specs.
All the decoders I kow (NicAudio, BassAudio, ffdshow, AC3filter,...) do the job correctly.

Also the actual command line decoders/encoders work fine. To recode AAC to AC3 you can use:
faad -w input.aac | Aften -readtoeof 1 - output.ac3
And the channels are correct mapped despite the different internal channel order.