VideoHelp Forum




+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 66
  1. Originally Posted by hello_hello View Post
    This is how foobar2000 decoded the audio. The first AAC track looks okay, but the second one, not so much.

    By the way, you can import the audio with Audacity directly (I assume there's a Mac version) and it'll do the same thing... decode and import in the wave file channel order... so regardless of the codec and the channel order it uses, if they're not the same after they're imported into Audacity, something's wrong.


    DTS
    Image
    [Attachment 86854 - Click to enlarge]


    AAC1
    Image
    [Attachment 86855 - Click to enlarge]


    AAC2
    Image
    [Attachment 86856 - Click to enlarge]
    From what I see in your attachments the apple one is doing it wrong. I guess the -ac 8 is not working properly at all, just gimmicking and forcing not losing that lost channel, but not putting the proper information into them.

    I think for now is safe to say that I will not use apple for 7.1 encoding for the moment and just fraunhofer.

    Please make sure you notice, that the channel layout is different in all the three!! not just apple and fraunhofer but DTS too:

    The channel layout info using mediainfo of the 1st stream (fraunhofer) is: C L R Ls Rs Lb Rb LFE
    The channel layout info using mediainfo of the 2nd stream (apple) is: C L R Ls Rs Lw Rw LFE
    The channel layout info using mediainfo of the 3rd stream (native DTS) is: C L R LFE Lb Rb Lss Rss

    LFE is in different possition in DTS!! So is Fraunhoffer still correct based on your captures?
    Last edited by eddy89; 6th May 2025 at 09:36.
    Quote Quote  
  2. Originally Posted by eddy89 View Post
    LFE is in different possition in DTS!! So is Fraunhoffer still correct based on your captures?
    Yes it's correct. The channels are decoded and remapped from whatever order the codec uses to the wave file channel order, so as long as the order is the same after it's imported into Audacity, it's okay.

    Don't take the channel order displayed by MediaInfo as too much of an indication everything is okay. The channels could still be swapped around, or empty, as MediaInfo just displays the order it sees in the audio data, or if there's no data it probably assumes. The only way to be 100% sure everything is okay is to physically compare the decoded DTS to the decoded AAC by opening them with Audacity etc so they're both decoded in wave file order. Plus MediaInfo appears to be displaying the "encoding" channel order, which is not the same as the channel order used when it's decoded.

    By the way, -strict 1 is only needed for decoding, and it's only to ensure the different types of 7.1ch audio are decoded correctly, and now I think about it, it doesn't actually effect 7.1ch (rear), which is the home theatre channel order.
    Back when I was experimenting with 7.1ch audio and the various AAC encoders, the only way to be sure what was happening was to ensure the audio was always decoded "correctly", so -strict 1 was needed to make sure ffmpeg only decoded the audio according to the specs, without applying the "hack".

    In the thread I linked to I referred to the way 7.1ch audio was encoded by ffmpeg and Nero etc as a "hack" as the encoders would encode 7.1ch (rear) as 7.1ch (front), then decode it as rear so the channel order would be correct on playback. Technically it's still a "hack", but I don't know if it matters. Home theatre systems are all 7.1ch (rear), so they probably decode 7.1ch as rear even when it's encoded as front. I don't actually know though, given my own system is stereo as I'm not a fan of surround sound.
    Quote Quote  
  3. Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    LFE is in different possition in DTS!! So is Fraunhoffer still correct based on your captures?
    Yes it's correct. The channels are decoded and remapped from whatever order the codec uses to the wave file channel order, so as long as the order is the same after it's imported into Audacity, it's okay.

    Don't take the channel order displayed by MediaInfo as too much of an indication everything is okay. The channels could still be swapped around, or empty, as MediaInfo just displays the order it sees in the audio data, or if there's no data it probably assumes. The only way to be 100% sure everything is okay is to physically compare the decoded DTS to the decoded AAC by opening them with Audacity etc so they're both decoded in wave file order. Plus MediaInfo appears to be displaying the "encoding" channel order, which is not the same as the channel order used when it's decoded.

    By the way, -strict 1 is only needed for decoding, and it's only to ensure the different types of 7.1ch audio are decoded correctly, and now I think about it, it doesn't actually effect 7.1ch (rear), which is the home theatre channel order.
    Back when I was experimenting with 7.1ch audio and the various AAC encoders, the only way to be sure what was happening was to ensure the audio was always decoded "correctly", so -strict 1 was needed to make sure ffmpeg only decoded the audio according to the specs, without applying the "hack".

    In the thread I linked to I referred to the way 7.1ch audio was encoded by ffmpeg and Nero etc as a "hack" as the encoders would encode 7.1ch (rear) as 7.1ch (front), then decode it as rear so the channel order would be correct on playback. Technically it's still a "hack", but I don't know if it matters. Home theatre systems are all 7.1ch (rear), so they probably decode 7.1ch as rear even when it's encoded as front. I don't actually know though, given my own system is stereo as I'm not a fan of surround sound.
    Oh thanks sir. Amazing info here.
    I don't understand the meaning of 7.1 front and rear. Could you please develop on it? I am completely clueless about it.
    The only 7.1 files I could want to encode are always coming from Blu-ray (standard and UHD) movies. Could they come in both front and rear configurations? If so, should I find another kind of DTS file -which comes with different 7.1 configuration- for testing it the same way I did with Ex-machina? Please let me know what I should look for if needed. I wanna make sure every DTS encode to AAC should work/played perfectly fine after conversion.

    Just wanna make sure I understand everything, so please let me know if I am right with the following statements:

    a) For now I should just encode with AAC Fraunhofer for 7.1 and avoid Apple, as Fraunhofer does it always correctly.
    b) The following command line for encoding it is correct and does not need any more crucial options than this (independently of choosing VBR/CBR or bitrate amount):
    Code:
    ffmpeg -i audio.dts -c:a libfdk_aac -b:a 512k -ar 48000 71fdkcbr512k.aac
    c) If I do it with the previous mentioned approach in the previous two statements, I will not lose any other information I could need afterwards (apart from passing from lossless to lossy but this was obvious) and I can safely delete the original DTS files as wouldn't be needed anymore and are quite big in size.
    d) I think Plex player is based on its own ffmpeg. So, I should be fine reproducing the AAC encoded audio with it even though I don't see any "strict 1" flag in its configuration for playing aac. (With this one I wanted to make sure that anything I encode it will always be played correctly, as otherwise, the previous statement would be false).

    Two last questions:
    e) Can I apply the same logic of DTS with Dolby TrueHD with Dolby Atmos (.thd files) for encoding into AAC? I could provide an example for .thd files with another file like I did with the Ex-machina and DTS (I can use "Drive", for example). Let me know if you want me to do it.
    f) For DTS 5.1 configuration is there any problem when encoded in AAC or even AC3? I pretty much did AC3 until now and using with Shutter Encoder -which uses ffmpeg to convert-, which I pretty much ending up with the exactly same result as if I open in audacity -ffmpeg too- and save it as AC3.

    Thank you very much!
    Quote Quote  
  4. @ hello_hello,
    Where does the "-strict 1" go in the ffmpeg code ?

    For example:
    ffmpeg -i -strict 1

    ffmpeg -i -c:a aac_at -aac_at_quality 0 -aac_at_mode cbr -b:a 320k -strict 1

    ffmpeg -i -c:a -strict 1 aac_at -aac_at_quality 0 -aac_at_mode cbr -b:a 320k

    ffmpeg -i -c:a aac_at -strict 1 -aac_at_quality 0 -aac_at_mode cbr -b:a 320k
    Quote Quote  
  5. @ cholla, is just for decoding (I guess, playing), not for encoding.
    Quote Quote  
  6. Code:
     -strict            <int>        ED.VA...... how strictly to follow the standards (from INT_MIN to INT_MAX) (default normal)
         very            2            ED.VA...... strictly conform to a older more strict version of the spec or reference software
         strict          1            ED.VA...... strictly conform to all the things in the spec no matter what the consequences
         normal          0            ED.VA......
         unofficial      -1           ED.VA...... allow unofficial extensions
         experimental    -2           ED.VA...... allow non-standardized experimental things
    This is global option so it can be placed anywhere (i usually place such global option before input).
    Usually it is fine to leave it at default state.
    Quote Quote  
  7. Originally Posted by eddy89 View Post
    I don't understand the meaning of 7.1 front and rear. Could you please develop on it?
    The AAC spec followed, or created, a standard for theatres, where instead of 2 pairs of surround/rear speakers, the extra pair of speakers were added between the front stereo speakers, if I remember correctly, so there's still only a single pair of surround speakers, with an option for a mono rear speaker at the back, I think. So that's what's referred to as 7.1ch front or 7.1ch wide.

    Home theatre 7.1ch uses "rear", so the extra speakers are rear surround. Because theatre 7.1ch added the extra pair of speakers at the front, between the stereo speakers, if the default channel order is used for home theatre, the front stereo speakers end up at the sides, and the side surround channels end up in the front speakers, or something like that.

    So for a long time AAC encoders used the "front" channel order, but remapped the channels when the AAC was decoded so the channels ended up in the correct speakers. QAAC adds PCEs to the encoded audio. They can be used to specify non-standard channel layouts such as 7.1ch rear. I can't remember which other encoders do the same.

    Originally Posted by eddy89 View Post
    The only 7.1 files I could want to encode are always coming from Blu-ray (standard and UHD) movies. Could they come in both front and rear configurations? If so, should I find another kind of DTS file -which comes with different 7.1 configuration- for testing it the same way I did with Ex-machina? Please let me know what I should look for if needed. I wanna make sure every DTS encode to AAC should work/played perfectly fine after conversion.
    I've only ever seen 7.1ch rear on Bluray.

    Originally Posted by eddy89 View Post
    a) For now I should just encode with AAC Fraunhofer for 7.1 and avoid Apple, as Fraunhofer does it always correctly.
    I haven't tested it, but it seems to be fine. It's probably using the "hack" though, encoding rear as front.

    Originally Posted by eddy89 View Post
    b) The following command line for encoding it is correct and does not need any more crucial options than this (independently of choosing VBR/CBR or bitrate amount):
    Code:
    ffmpeg -i audio.dts -c:a libfdk_aac -b:a 512k -ar 48000 71fdkcbr512k.aac
    It seems fine, but I've never used libfdk_aac. I use QAAC almost all the time, and fortunately I usually downmix 7.1ch to 5.1ch for encoding, so I shouldn't have encoded much 7.1ch incorrectly with QAAC.

    Strict 1 only tells ffmpeg to decode 7.1ch "front" correctly, or according to the original spec for 7.1ch, instead of assuming it's "rear" and remapping the channels. There's no real need for it in a home theatre system.

    Originally Posted by eddy89 View Post
    Two last questions:
    e) Can I apply the same logic of DTS with Dolby TrueHD with Dolby Atmos (.thd files) for encoding into AAC? I could provide an example for .thd files with another file like I did with the Ex-machina and DTS (I can use "Drive", for example). Let me know if you want me to do it.
    f) For DTS 5.1 configuration is there any problem when encoded in AAC or even AC3? I pretty much did AC3 until now and using with Shutter Encoder -which uses ffmpeg to convert-, which I pretty much ending up with the exactly same result as if I open in audacity -ffmpeg too- and save it as AC3.
    Yes, the same logic should apply to 7.1ch audio regardless of the codec it comes in. I'm not aware of there being any problems with 5.1ch. I think DTS uses the rear/back channels for 5.1 surround, and AC3 uses the side channels for 5.1ch surround, but encoders should accept either rear/back or side as the 5.1 surround channels and encode it correctly (I'm referring to the rear or side channels in the wave file channel order, as the wave file channel order doesn't have channels named "surround" such).

    Originally Posted by eddy89 View Post
    Thank you very much!
    You're welcome.
    I've reported the QAAC bug, so hopefully it'll be fixed fairly soon.
    https://github.com/nu774/qaac/issues/115

    Edit: For future reference, here's a screenshot of the Matrix Mixer DSP I use with foobar2000. The order the channels are listed in at the top is the wave file channel order.

    Image
    [Attachment 86863 - Click to enlarge]
    Last edited by hello_hello; 6th May 2025 at 15:46.
    Quote Quote  
  8. Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    I don't understand the meaning of 7.1 front and rear. Could you please develop on it?
    The AAC spec followed, or created, a standard for theatres, where instead of 2 pairs of surround/rear speakers, the extra pair of speakers were added between the front stereo speakers, if I remember correctly, so there's still only a single pair of surround speakers, with an option for a mono rear speaker at the back, I think. So that's what's referred to as 7.1ch front or 7.1ch wide.

    Home theatre 7.1ch uses "rear", so the extra speakers are rear surround. Because theatre 7.1ch added the extra pair of speakers at the front, between the stereo speakers, if the default channel order is used for home theatre, the front stereo speakers end up at the sides, and the side surround channels end up in the front speakers, or something like that.

    So for a long time AAC encoders used the "front" channel order, but remapped the channels when the AAC was decoded so the channels ended up in the correct speakers. QAAC adds PCEs to the encoded audio. They can be used to specify non-standard channel layouts such as 7.1ch rear. I can't remember which other encoders do the same.
    Good stuff, great info. Not sure if I understand everything (don't know what a PCE is).

    Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    The only 7.1 files I could want to encode are always coming from Blu-ray (standard and UHD) movies. Could they come in both front and rear configurations? If so, should I find another kind of DTS file -which comes with different 7.1 configuration- for testing it the same way I did with Ex-machina? Please let me know what I should look for if needed. I wanna make sure every DTS encode to AAC should work/played perfectly fine after conversion.
    I've only ever seen 7.1ch rear on Bluray.
    Great, less problems if there is just one case.

    Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    a) For now I should just encode with AAC Fraunhofer for 7.1 and avoid Apple, as Fraunhofer does it always correctly.
    I haven't tested it, but it seems to be fine. It's probably using the "hack" though, encoding rear as front.
    You have tested the one I encoded myself, right? The one you said it seems right, first AAC in Ex Machina.

    Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    b) The following command line for encoding it is correct and does not need any more crucial options than this (independently of choosing VBR/CBR or bitrate amount):
    Code:
    ffmpeg -i audio.dts -c:a libfdk_aac -b:a 512k -ar 48000 71fdkcbr512k.aac
    It seems fine, but I've never used libfdk_aac. I use QAAC almost all the time, and fortunately I usually downmix 7.1ch to 5.1ch for encoding, so I shouldn't have encoded much 7.1ch incorrectly with QAAC.
    It is supposed to be almost on pair with the apple one, and much better than the ffmpeg native, which I am sure I will not use as is rated as the worse one.

    Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    Two last questions:
    e) Can I apply the same logic of DTS with Dolby TrueHD with Dolby Atmos (.thd files) for encoding into AAC? I could provide an example for .thd files with another file like I did with the Ex-machina and DTS (I can use "Drive", for example). Let me know if you want me to do it.
    f) For DTS 5.1 configuration is there any problem when encoded in AAC or even AC3? I pretty much did AC3 until now and using with Shutter Encoder -which uses ffmpeg to convert-, which I pretty much ending up with the exactly same result as if I open in audacity -ffmpeg too- and save it as AC3.
    Yes, the same logic should apply to 7.1ch audio regardless of the codec it comes in. I'm not aware of there being any problems with 5.1ch. I think DTS uses the rear/back channels for 5.1 surround, and AC3 uses the side channels for 5.1ch surround, but encoders should accept either rear/back or side as the 5.1 surround channels and encode it correctly (I'm referring to the rear or side channels in the wave file channel order, as the wave file channel order doesn't have channels named "surround" such).
    Great will do another movie file for you to have a look with a .thd file and aac encodings

    Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    Thank you very much!
    You're welcome.
    Well, thanks again

    Originally Posted by hello_hello View Post
    I've reported the QAAC bug, so hopefully it'll be fixed fairly soon.
    https://github.com/nu774/qaac/issues/115
    In the post with the link of Ex-machina file, I posted the command line I use for the AAC encodes with Fraunhofer and Apple, which can be seen I am using ffmpeg, and not QAAC.
    I am in macOS, and I am not using QAAC at all (this is a tool for Windows), the apple encoder works straight away in ffmpeg on macOS specifying aac_at as encoder.
    So I guess, the bug you reported to fix on QAAC is not solving anything in my case, right? I plan to keep using ffmpeg as encoder tool and QAAC as a tool for windows does not make any sense in my particular case, I think.
    I guess the bug is on the Apple library itself, and not in the tool I guess, and if there is any tool failing for me right now, should be ffmpeg and not QAAC.
    Not sure, if I am not understanding you properly and QAAC is where has to be fixed in my case too. Please clarify.

    Originally Posted by hello_hello View Post
    Edit: For future reference, here's a screenshot of the Matrix Mixer DSP I use with foobar2000. The order the channels are listed in at the top is the wave file channel order.

    Image
    [Attachment 86863 - Click to enlarge]
    Sorry, don't know anything about the Matrix you are talking about, and why this could be a future reference. As you can see my knowledge of all of this, is non existent .

    I don't use foobar2000 and just use Plex player instead, as is the best player that suits my needs across a lot of devices. So foobar2000 is not an option for me.

    Thanks once more
    Last edited by eddy89; 6th May 2025 at 22:44.
    Quote Quote  
  9. Originally Posted by eddy89 View Post
    Good stuff, great info. Not sure if I understand everything (don't know what a PCE is).
    It stands for "program configuration element", i think, but it just specifies the channel layout.

    Originally Posted by eddy89 View Post
    Sorry, don't know anything about the Matrix you are talking about, and why this could be a future reference. As you can see my knowledge of all of this, is non existent .
    It was only for reference to show the channel order for wave files, as if you decode multichannel audio, the channels should be mapped to correctly match the appropriate wave file channels, in the same order. It was easier to post a screenshot than search for the correct wave file channel order via google.

    For example, if you open any 5.1ch audio with Audacity, the channels should always be imported in the following order, no matter what order they're encoded in, as it's the channel order for wave files.

    FL, FR, FC, LFE, BL, BR (back for surround left and right)

    Sorry, I keep forgetting you're not using QAAC. According to the info here, the macOS includes a command line thingy for re-encoding audio as AAC, so maybe try taking ffmpeg out of the equation to see what happens.
    Last edited by hello_hello; 7th May 2025 at 03:14.
    Quote Quote  
  10. Originally Posted by hello_hello View Post
    Originally Posted by eddy89 View Post
    Sorry, I keep forgetting you're not using QAAC. According to the info here, the macOS includes a command line thingy for re-encoding audio as AAC, so maybe try taking ffmpeg out of the equation to see what happens.
    According to the info here, the macOS includes a command line thingy for re-encoding audio as AAC, so maybe try taking ffmpeg out of the equation to see what happens.
    The command line tool is called afconvert, but it doesn't work with DTS files as an input.
    So the only hope is ffmpeg, I guess.
    Last edited by eddy89; 8th May 2025 at 01:27.
    Quote Quote  
  11. You could try converting the DTS to an intermediate wave file with ffmpeg, or something lossless like flac, then convert that output to AAC.

    Actually... it'd be easier to decode it as a wave file with ffmpeg, but pipe it directly to afconvert. I often use ffmpeg for decoding and piping audio to something else for encoding. Normally I'd create the appropriate command line and save it as an encoder preset for foobar2000, but you could run it manually, however it's done on a mac. This example should decode any audio and pipe it QAAC for encoding on a Windows PC, but it's just an example as I know nothing about command lines for a mac.

    cmd.exe /d /c c:\encoders\ffmpeg\ffmpeg.exe -i - -ignore_length true -c:a pcm_f32le -f wav - | c:\encoders\QAAC\qaac.exe --ignorelength -s --no-optimize --no-delay -V 91 -o %d -

    I remembered that you're not using QAAC, but I still need to mention it again.
    The 7.1ch surround issue has been fixed.
    nu774 said he thinks the bug first appeared in version 2.83. Apparently QAAC 2.82 was okay, so at least it's only been messing up the 7.1 surround channels since October, and it should be back to normal for QAAC 2.85
    Quote Quote  
  12. Originally Posted by hello_hello View Post
    You could try converting the DTS to an intermediate wave file with ffmpeg, or something lossless like flac, then convert that output to AAC.

    Actually... it'd be easier to decode it as a wave file with ffmpeg, but pipe it directly to afconvert. I often use ffmpeg for decoding and piping audio to something else for encoding. Normally I'd create the appropriate command line and save it as an encoder preset for foobar2000, but you could run it manually, however it's done on a mac. This example should decode any audio and pipe it QAAC for encoding on a Windows PC, but it's just an example as I know nothing about command lines for a mac.

    cmd.exe /d /c c:\encoders\ffmpeg\ffmpeg.exe -i - -ignore_length true -c:a pcm_f32le -f wav - | c:\encoders\QAAC\qaac.exe --ignorelength -s --no-optimize --no-delay -V 91 -o %d -

    I remembered that you're not using QAAC, but I still need to mention it again.
    The 7.1ch surround issue has been fixed.
    nu774 said he thinks the bug first appeared in version 2.83. Apparently QAAC 2.82 was okay, so at least it's only been messing up the 7.1 surround channels since October, and it should be back to normal for QAAC 2.85
    Pipe-ing although is an option does not seem to be the best of the options outthere. Will try it though.
    @ hello_hello, Could you please do me a favor? Could you please open an issue in ffmpeg the same way you did for qaac, and maybe they would try to solve it too? Thank you very much
    Last edited by eddy89; 8th May 2025 at 14:46.
    Quote Quote  
  13. Piping is probably the best method much of the time. If you use a GUI for decoding and re-encoding, the GUI probably sends the audio to the encoder via a pipe. The result should be the same either way, except there's no intermediate wave file written to your hard drive. Normally lossy audio is decoded as 32 bit float and sent to the encoder that way, which is what " -c:a pcm_f32le -f wav" in the ffmpeg command line I posted does. It tells ffmpeg to output the audio as 32 bit float in wave file format. If the encoder needs to be supplied with the channel layout and ffmpeg doesn't do it automatically, you should be able to specify it with afconvert's --channellayout argument.

    I assume I can't test aac_at for ffmpeg on Windows, but while something does appear to be going wrong, I'm not sure why it's happening. I am fairly sure specifying -ac 8ch is a bad idea, as it's likely to specify the 8 channel layout, which doesn't include an LFE channel, as it has a mono rear channel instead.

    7.1ch rear
    C L R Ls Rs Rls Rrs LFE
    8ch
    C L R Ls Rs Rls Rrs Cs

    Could you try re-encoding the attached mp4 first? It simply contains a recording of someone naming each channel, and as they're named the voice should be heard in that channel. I can use foobar2000's output meter to verify the channels are correct, but failing that is there an output meter you can use while playing the sample on your mac. Can Plex display one or is there an App you can download? If not you could import the encoded audio into Audacity and check it that way. The channels should be imported in this order and the spoken channel names should be in the appropriate channel.

    FL, FR, FC, LFE, RearSL, RearSR, SL, SR
    Image Attached Files
    Quote Quote  
  14. Originally Posted by hello_hello View Post
    I assume I can't test aac_at for ffmpeg on Windows, but while something does appear to be going wrong, I'm not sure why it's happening. I am fairly sure specifying -ac 8ch is a bad idea, as it's likely to specify the 8 channel layout, which doesn't include an LFE channel, as it has a mono rear channel instead.
    I think you should. I don't have windows, but I think there are ways to use aac_at on windows for sure.

    Originally Posted by hello_hello View Post
    7.1ch rear
    C L R Ls Rs Rls Rrs LFE
    8ch
    C L R Ls Rs Rls Rrs Cs

    Could you try re-encoding the attached mp4 first? It simply contains a recording of someone naming each channel, and as they're named the voice should be heard in that channel. I can use foobar2000's output meter to verify the channels are correct, but failing that is there an output meter you can use while playing the sample on your mac. Can Plex display one or is there an App you can download? If not you could import the encoded audio into Audacity and check it that way. The channels should be imported in this order and the spoken channel names should be in the appropriate channel.

    FL, FR, FC, LFE, RearSL, RearSR, SL, SR
    When you talk about Output meter, you mean VU meter? Plex does not have it, neither VLC.
    The mp4 you provided is not being able to be played in VLC (plex does not have anything like that and vlc neither), while every DTS/Dolby Atmos 7.1 audio was possible... (audicity plays it with no problem and I guess is correct, it sounds good...).

    I am confused, what way do you want me to encode it?
    a) ffmpeg aac_at?
    b) afconvert with the piping?
    c) both?

    Please let me know and I will do it for you.
    Thanks

    By the way, I don't understand your command line of the piping:
    Code:
    cmd.exe /d /c c:\encoders\ffmpeg\ffmpeg.exe -i - -ignore_length true -c:a pcm_f32le -f wav - | c:\encoders\QAAC\qaac.exe --ignorelength -s --no-optimize --no-delay -V 91 -o %d -
    What are the 3 red hyphen?? EDIT2: "-" is the same as "pipe:", gotcha.

    Even though I was not able to make it work in either a) or b). I need help
    Last edited by eddy89; 10th May 2025 at 17:46.
    Quote Quote  
  15. "-" in the command line specifies the input and output, used as a substitute for stdin and stdout when piping. "|" is where the pipe is created.
    I assume for QAAC the input file is specified as the final argument, and %d is a placeholder for the destination file name. It's from a foobar2000 encoder preset I created, but I wouldn't have expected it to work on a mac. CMD.exe is a Windows thing. I don't know anything about creating a mac command line though so it was just an example.

    Anyway, the idea was to re-encode the file I uploaded, then import the re-encoded version into Audacity to check the channels are all present and in the correct order. It's not always easy to tell with a normal multichannel file as it's not always obvious if channels have been swapped.

    If something isn't right after you convert it to AAC again with the Apple encoder, the idea was to first convert it to a wave file with ffmpeg then convert the wave file to AAC using afconvert (as you said it won't accept a dts file as the input) and hopefully discover if the problem is ffmpeg or afconvert.

    I can't get the mp4 I uploaded to play in VLC either. I don't know why as MPC-HC plays it. Maybe it's because it's HE-AAC.
    I've attached the same audio below as wave and flac files. You should be able to convert one of them to AAC instead.
    Image Attached Files
    Last edited by hello_hello; 9th May 2025 at 06:45.
    Quote Quote  
  16. Originally Posted by hello_hello View Post
    I can't get the mp4 I uploaded to play in VLC either. I don't know why as MPC-HC plays it. Maybe it's because it's HE-AAC.
    I could not play the .mp4 with VLC either.
    I believe the problem is this:
    Fraunhofer IIS MPEG-4 Audio Encoder 03.02.15_MPEGScbr_hdaac
    From what I read about VLC is it does not play hdaac.
    Decoding

    VLC supports AAC and HE-AAC through the libraries libfaad and libavcodec.

    The FAAD module supports Main (Main, LC, SSR), LD, ER, LTP, SBR and PS.
    It should decode AAC, HeAAC and HeAACv2 streams. It should not decode HD-AAC/AAC-SLS or AAC-ELD streams.

    The avcodec module supports Main (Main, LC), LTP, SBR and ALS.
    My MPC-HC is set to use LAV decoders & played the .mp4.
    Quote Quote  
  17. Originally Posted by hello_hello View Post
    "-" in the command line specifies the input and output, used as a substitute for stdin and stdout when piping. "|" is where the pipe is created.
    I assume for QAAC the input file is specified as the final argument, and %d is a placeholder for the destination file name. It's from a foobar2000 encoder preset I created, but I wouldn't have expected it to work on a mac. CMD.exe is a Windows thing. I don't know anything about creating a mac command line though so it was just an example.

    Anyway, the idea was to re-encode the file I uploaded, then import the re-encoded version into Audacity to check the channels are all present and in the correct order. It's not always easy to tell with a normal multichannel file as it's not always obvious if channels have been swapped.

    If something isn't right after you convert it to AAC again with the Apple encoder, the idea was to first convert it to a wave file with ffmpeg then convert the wave file to AAC using afconvert (as you said it won't accept a dts file as the input) and hopefully discover if the problem is ffmpeg or afconvert.

    I can't get the mp4 I uploaded to play in VLC either. I don't know why as MPC-HC plays it. Maybe it's because it's HE-AAC.
    I've attached the same audio below as wave and flac files. You should be able to convert one of them to AAC instead.
    Sorry for the delay buddy.
    First, wanna mentioned that I didn't need the wav/flac files, I am an ******* and I was doing it wrong. So I encoded with the first one (mp4) you sent. If you want me to do it with wav or flac, let me know and I will do it again.

    Find attached 3 files here:
    1) fraunhoffer with ffmpeg
    Command line:
    Code:
    ffmpeg -i 7.1auditionOutLeader_v2_rtb.mp4 -c:a libfdk_aac -b:a 512k -ar 48000 fraunhofer_ffmpeg.aac
    2) apple (aac_at) with ffmpeg
    Command line:
    Code:
    ffmpeg -i 7.1auditionOutLeader_v2_rtb.mp4 -c:a aac_at -b:a 512k -ac 8 apple_ffmpeg.aac
    3) apple with afconvert (native from apple)
    Command line:
    Code:
    afconvert -f m4af -d aac -s 0 -b 512000 -q 127 7.1auditionOutLeader_v2_rtb.mp4 apple_afconvert.m4a
    All of them CBR 512K

    With afconvert there was a warning after the conversion:
    Code:
    *** warning: Transcoding multichannel audio may not handle channel layouts correctly (0)
    Thanks
    Last edited by eddy89; 21st May 2025 at 14:03.
    Quote Quote  
  18. @hello_hello Any conclusions?
    Quote Quote  
  19. Sorry, the real world has been fairly demanding this week.

    apple_afconvert and fraunhofer_ffmpeg seem fine.

    apple_ffmpeg has the front stereo channels in the surround speakers and apart from the LFE channel, the rest of the channels seem to be empty. I have no idea what the problem might be.
    Quote Quote  
  20. I tested the files with my Denon 7.1 receiver.
    apple_afconvert and fraunhofer_ffmpeg had 5 channel & LFE.
    There was no audio for the "rear surround L or R". It was like there was no audio for these speakers.

    On my PC I could hear the narration for those channels in "rear surround L or R" VLC & Audacity .
    My PC only has a 2 channel system.

    Audacity also shows audio for them.
    Quote Quote  
  21. Originally Posted by hello_hello View Post
    Sorry, the real world has been fairly demanding this week.

    apple_afconvert and fraunhofer_ffmpeg seem fine.

    apple_ffmpeg has the front stereo channels in the surround speakers and apart from the LFE channel, the rest of the channels seem to be empty. I have no idea what the problem might be.
    Thanks for the info hello_hello. The problem is what cholla is saying below, missing channels again?

    Originally Posted by cholla View Post
    I tested the files with my Denon 7.1 receiver.
    apple_afconvert and fraunhofer_ffmpeg had 5 channel & LFE.
    There was no audio for the "rear surround L or R". It was like there was no audio for these speakers.

    On my PC I could hear the narration for those channels in "rear surround L or R" VLC & Audacity .
    My PC only has a 2 channel system.

    Audacity also shows audio for them.
    Hey Cholla, so hello_hello is saying apple_afconvert and fraunhofer_ffmpeg are fine with all the channels in place and in correct order, and you are saying that is NOT fine? Something is missing? There is something on your 7.1 system that maybe does not work with this configuration maybe?

    I thought I was starting to see the light at the end of the tunnel, but now I am very confused again. I would never imagined that 7.1 were such an issue.
    Last edited by eddy89; 16th May 2025 at 20:49.
    Quote Quote  
  22. @ eddy89, I will try some differeny settings for the Denon receiver & see if I can hear the "rear surround L or R". On regular movies & other videos I hear sound from the "rear surround L or R".
    I usually do not have a file that tells me the specific speaker it should be coming from.
    Quote Quote  
  23. I don't understand what's happening with the apple_ffmpeg sample.
    If I decode with -strict 0, which means ffmpeg is free to ignore the AAC spec while decoding, the front left and right channels end up in the surround channels. For -strict 1 the front left and right are in the correct channels, but either way there's no surround audio (the channels are blank).

    The other two samples certainly appear to have the channels in the correct places. I can only go by what I'm seeing on foobar2000's output meter or when I load the audio into Audacity as I only have a stereo system myself, but if I don't let the player downmix it to stereo I can still hear all the channels, so I assume my sound card is downmixing it correctly.

    Original
    Image
    [Attachment 87030 - Click to enlarge]


    apple_afconvert and fraunhofer_ffmpeg
    Image
    [Attachment 87031 - Click to enlarge]


    apple_ffmpeg
    Image
    [Attachment 87032 - Click to enlarge]
    Last edited by hello_hello; 16th May 2025 at 23:40.
    Quote Quote  
  24. Thanks hello_hello and cholla.
    Let's see if cholla comes with a solution to be able to play the files properly in his/her 7.1 system.
    Quote Quote  
  25. I need to explain my connections to my receiver .
    I accidentally damaged the USB input to my Denon receiver a long time ago so I can not play anything USB in.
    I usually use my Bluray settop player's USB input for file on a USB drive & output HDMI from it to my Denon receiver to play video & audio files.
    Apparently this only outputs 5.1 on auto.
    I can play all the speakers from multi channel stereo but that is not surround.
    So the rear speakers were not receiving anything when I tested the files.

    So I booted my HTPC which is HDMI out to the Denon.
    The HTPC is 7.1 PCM. This played the
    apple_afconvert.m4a & fraunhofer_ffmpeg.aac as 7.1.
    The audio came from the correct speakers.

    The apple_ffmpeg.aac played as 3 channel FR,C, & FL speakers.
    These were the files in the audio encodes.zip posted in #47.

    I would like a copy of the original test file the files in the audio encodes.zip were created with.

    I was not sure I still had these test files but thought you might want them.
    Last edited by cholla; 17th May 2025 at 14:08.
    Quote Quote  
  26. I will try again in this post to uplodd the files:
    Image Attached Files
    Quote Quote  
  27. Originally Posted by cholla View Post
    I would like a copy of the original test file the files in the audio encodes.zip were created with.
    The original file that I encoded from is the one in the post #43

    Originally Posted by cholla View Post
    I will try again in this post to uplodd the files:
    File Type: mkv DTS_OBJECT_EMULATOR-thedigitaltheater.mkv (408.80 MB, 1 views)
    File Type: mkv Dolby_Amaze_Lossless-ATMOS-thedigitaltheater.mkv (139.55 MB, 1 views)
    Didn't understand why you uploaded this, or if we were talking about this before. My english is not the best, sorry. I guess it could be usual at some point, thanks.

    Originally Posted by cholla View Post
    The HTPC is 7.1 PCM. This played the
    apple_afconvert.m4a & fraunhofer_ffmpeg.aac as 7.1.
    The audio came from the correct speakers.
    So we could say that afconvert and fraunhofer makes proper useable files and I can use any of them with no problems.
    Unless you tell me anything more to add, I could say we have mission achieved!!

    Now my question would be if you notice more quality in fraunhofer vs afconvert... but I guess could be imperceptible. I could do a test if you want and send you in a movie.

    Thanks guys for your great work, it was a pleasure talking with you and have such a nice and useful conversations!


    P.S:
    Originally Posted by hello_hello View Post
    I don't understand what's happening with the apple_ffmpeg sample.
    In the same way you were able to create an issue with QAAC, are you not able to create an issue for ffmpeg? I think if they could correct it, there would not be any need to use afconvert and could be use in windows (as afconvert is just macOS). Just if you can. My English is not that great to do it myself, to be honest.
    Last edited by eddy89; 17th May 2025 at 20:41.
    Quote Quote  
  28. Originally Posted by eddy89 View Post
    In the same way you were able to create an issue with QAAC, are you not able to create an issue for ffmpeg? I think if they could correct it, there would not be any need to use afconvert and could be use in windows (as afconvert is just macOS). Just if you can. My English is not that great to do it myself, to be honest.
    I couldn't find much info for aac_at, but from what I did find I assumed it only worked on a macOS. If that's correct I have no way to test it.

    I did have a quick play with libfdk_aac though. As I don't normally use ffmpeg directly for audio encoding or downmixing, I'm still not 100% sure I understand how it works, but after a bit of experimenting I think -channel_layout might be the option you need.

    Try it for aac_at to see if you get the correct 7.1ch output that way. Maybe it's already been suggested, but I haven't looked back through the thread yet as I haven't got a lot of time today.

    ffmpeg -i input.mp4 -c:a aac_at -channel_layout '7.1' -b:a 512k output.aac

    By the way, ffmpeg seems happy to take care of any downmixing, so this should combine the surround and rear channels from a 7.1ch input and output 5.1ch.

    ffmpeg -i input.mp4 -c:a libfdk_aac -channel_layout '5.1' -b:a 512k output.aac
    Quote Quote  
  29. Originally Posted by hello_hello View Post
    I couldn't find much info for aac_at, but from what I did find I assumed it only worked on a macOS. If that's correct I have no way to test it.
    The QAAC is the wrapper of apple AAC (which is aac_at) in windows, and I am sure there is a way to use it inside of ffmpeg, there are people reporting using it in windows with no problem. Just need to find a compiled version of ffmpeg with the functionality -same as if you wanna use fraunhofer- because of license issues is not coming with the program) So, it is NOT just working in macOS, as you are using it already with QAAC. Look here, here or here.


    Originally Posted by hello_hello View Post
    I did have a quick play with libfdk_aac though. As I don't normally use ffmpeg directly for audio encoding or downmixing, I'm still not 100% sure I understand how it works, but after a bit of experimenting I think -channel_layout might be the option you need.

    Try it for aac_at to see if you get the correct 7.1ch output that way. Maybe it's already been suggested, but I haven't looked back through the thread yet as I haven't got a lot of time today.

    ffmpeg -i input.mp4 -c:a aac_at -channel_layout '7.1' -b:a 512k output.aac

    By the way, ffmpeg seems happy to take care of any downmixing, so this should combine the surround and rear channels from a 7.1ch input and output 5.1ch.

    ffmpeg -i input.mp4 -c:a libfdk_aac -channel_layout '5.1' -b:a 512k output.aac
    Thanks, but downmixing is not an option for me. This is exactly what I wanted to avoid.
    Quote Quote  
  30. Originally Posted by eddy89 View Post
    The original file that I encoded from is the one in the post #43
    I downloaded it.
    Then tested the conversion with the version of ffmpeg I have.
    It worked correctly with the fraunhoffer libfdk_aac.
    The apple aac_at did even worse for me than you as all I could hear was the Center channel.
    apple aac_at is not the codec to use for this conversion

    Originally Posted by eddy89 View Post
    Didn't understand why you uploaded this, or if we were talking about this before. My english is not the best, sorry. I guess it could be usual at some point, thanks.
    These are good test files for 7.1 receivers. I like to hear music from the channels to determine what I hear.
    Also they should be good test files for conversion to see if the 8 channels work when converted.

    Originally Posted by eddy89 View Post
    So we could say that afconvert and fraunhofer makes proper useable files and I can use any of them with no problems.
    Unless you tell me anything more to add, I could say we have mission achieved!!
    I believe this is correct.

    Originally Posted by eddy89 View Post
    Now my question would be if you notice more quality in fraunhofer vs afconvert... but I guess could be imperceptible.
    To my ears the difference is imperceptible.

    Originally Posted by eddy89 View Post
    I could do a test if you want and send you in a movie.
    What I have is fine . No need for a movie.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!