VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 56
Thread
  1. I'm trying to encode an ac3 file to an aac file. I've seen other people doing this, but are they all running linux? Does neroaacenc only support wav input for windows?
    Quote Quote  
  2. Yes only PCM Wav , or stdin pipe

    Or you can use some GUI like megui
    (it will do the command line stuff in the background)
    Quote Quote  
  3. I see, thanks, what do you think of using ffmpeg to do it?
    Quote Quote  
  4. Yes you can pipe ffmpeg to neroaacenc
    Quote Quote  
  5. Oh, could you explain how to do that?
    Quote Quote  
  6. same as any other pipe in ffmpeg

    It's probably easier for you to use a GUI if you're not already familiar with the syntax

    e.g

    Code:
    ffmpeg -i input.ac3 -acodec pcm_s32le -ac 6 -ar 48000 -f wav - | neroAacEnc -if - -q 0.4 -ignorelength -of output.mp4
    use neroaacenc -help for the encoding options; in this example I used 1pass q=0.4
    Quote Quote  
  7. I'm familiar with the syntax, I just didn't know how to pipe, but I can see now that it's very simple. Would this produce a lower quality end product than just using ffmpeg's aac encoders? The only reason I ask is because I remember seeing someone say that neroaacenc is better than ffmpeg. Is neroaacenc better than ffmpeg?
    Quote Quote  
  8. Originally Posted by ROBO731 View Post
    I'm familiar with the syntax, I just didn't know how to pipe, but I can see now that it's very simple. Would this produce a lower quality end product than just using ffmpeg's aac encoders? The only reason I ask is because I remember seeing someone say that neroaacenc is better than ffmpeg. Is neroaacenc better than ffmpeg?

    Yes nero is clearly better than the AAC encoders ffmpeg uses . Even I can tell the difference (and I'm far from an audiophile)

    But there were a few different versions commonly included with various distributed ffmpeg binaries; libvo-aacenc, libavcodec aacenc, etc... and they all sucked, but not sure about newest one by VisualOn , it might be better? not sure

    The other AAC encoder you might want to check is apple AAC (qaac or qtaac) , it scores slightly higher than nero on ABX testing
    https://sites.google.com/site/qaacpage/
    Quote Quote  
  9. Thanks, I see that I'd have to pipe it again to use the apple codec. Is there a better way to pipe than using ffmpeg? I'm just trying to find the best, most efficient way to do this.
    Quote Quote  
  10. If you're happy with ffmpeg, then just use that to pipe. But I suppose you could use mencoder. eac3to is another one is commonly used

    Personally, I can't tell much of quality difference between nero and qaac. The so called "experts" apparently can .
    Quote Quote  
  11. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    NeroAacEnc has the biggest initial audio delay ever ,
    therefore it's not recommended for the (occasional) reencode of movie audio tracks.
    OTOH, qaac has a --no-delay option, to whom this may interest.
    Quote Quote  
  12. Originally Posted by El Heggunte View Post
    NeroAacEnc has the biggest initial audio delay ever ,
    therefore it's not recommended for the (occasional) reencode of movie audio tracks.
    Typically ~ 35-40ms for nero
    Typically ~25-30ms for qaac


    OTOH, qaac has a --no-delay option, to whom this may interest.
    This is a bad option IMO, it adds silence, then cuts off audio frames, but sometimes cuts too many off (audio often comes a few ms early now compared to the original, and you lose real audio samples - not fixable by a muxer delay) . You have to fiddle back and forth with adding a --delay in addition to --no-delay to get it perfect and not lose part of your audio track
    Quote Quote  
  13. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Thanks for the input, PDR

    Regarding qaac's --no-delay thing, you have a point, no discussion about it.

    But now I think it's important to point out that Nero and qaac are NOT the only toys on the block

    If one doesn't mind using higher bitrates for the same quality, they can give a try to fhgaacenc, enc_aacplus, or even faac (all of these generate smaller audio delays than NeroAacEnc, IIRC)
    Last edited by El Heggunte; 25th Jul 2013 at 01:22. Reason: better wording
    Quote Quote  
  14. here some code I wrote to compute the encoder delay
    Code:
    if (heaac) { //HE-AAC
      if (nero) {
        encoderDelay = int(2336 * 2000 / audioOutputSampleRate.toDouble() + 0.5);
      } else if (qaac) {
        encoderDelay = int(2585 * 2000 / audioOutputSampleRate.toDouble() + 0.5);
        mkvDelayFix = encoderDelay; // mkvmerge only compensates some of the delay
        mkvDelayFix -= int(2112 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      } else if (fhg) {
        encoderDelay = int(794 * 2000 / audioOutputSampleRate.toDouble() + 0.5);
      }
    } else if (heaacv2) { //HE-AAC V2
      if (nero) {
        encoderDelay = int(2808 * 2000 / audioOutputSampleRate.toDouble() + 0.5);
      } else if (qaac) {
        encoderDelay = int(2585 * 2000 / audioOutputSampleRate.toDouble() + 0.5);
        mkvDelayFix = encoderDelay;
        mkvDelayFix -= int(2112 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      } else if (fhg) {
        encoderDelay = int(794 * 2000 / audioOutputSampleRate.toDouble() + 0.5);
      } else { //faac/fdk/...
        encoderDelay = int(2048 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      }
    } else {  //AAC LC
      if (nero) {
        encoderDelay = int(2624 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      } else if (qaac) {
        encoderDelay = int(2112 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      } else if (fhg) {
        encoderDelay = int(1600 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      } else {  //faac/fdk/..
        encoderDelay = int(2048 * 1000 / audioOutputSampleRate.toDouble() + 0.5);
      }
    }
    effectiveDelay = QString::number(inputDelay - encoderDelay);
    btw. depending on the encoder and the muxing tool you have to compensate this delay or not, since some encoders write this delay in the headers so that some muxers can compensate for it. Also the delay depends on whether aac-lc/-he/-hev2 and which sample rate is used,... -> the whole thing isn't totally trivial, but was discussed over at doom9 quite a bit

    Cu Selur
    Quote Quote  
  15. I see, thanks for letting me know, I'm somewhat new to encoding and I had no idea that there would be any kind of delay.
    Quote Quote  
  16. Banned
    Join Date
    Oct 2004
    Location
    Freedonia
    Search Comp PM
    The pertinent question here is not HOW do you do this but WHY do you even want to in the first place?

    1) If you are under the impression that MP4 containers require AAC audio, please note that this hasn't actually been true for years now. AC3 is acceptable in an MP4 container.
    2) If you are under the impression that using AAC will actually make your original AC3 audio "better", then you are very mistaken.
    3) If you have some software/hardware player that requires this, then maybe you should consider getting something that doesn't require it.

    Note that if you use AAC audio that sync problems are possible because (in my opinion) the format foolishly allows for things like VFR that probably should never be supported at all. I'm not saying that you will definitely have a sync problem, I'm just saying that if you don't understand what you are doing very well in converting that it might be possible for it to happen. Not likely, but theoretically possible.

    Given all the crap listed above to do this correctly, is this really something that you must do?
    Quote Quote  
  17. Originally Posted by ROBO731 View Post
    I see, thanks for letting me know, I'm somewhat new to encoding and I had no idea that there would be any kind of delay.
    99% of the time it's not going to be a problem. Only superhuman hearing can discern anything <40ms

    There was a problem discussed in another thread when somebody had issues with timing when uploading to youtube. Since it re-encodes the AAC to AAC, the delay compounded. But even a 70-80ms delay is hardly noticable to most people




    Originally Posted by jman98 View Post

    Note that if you use AAC audio that sync problems are possible because (in my opinion) the format foolishly allows for things like VFR that probably should never be supported at all. I'm not saying that you will definitely have a sync problem, I'm just saying that if you don't understand what you are doing very well in converting that it might be possible for it to happen. Not likely, but theoretically possible.

    VFR = variable frame rate. It's not a property of AAC, but rather a property of timestamps. For example , you could use AC3 with VFR in a MP4 container

    If you really mean VBR (variable bit rate), then that's not an issue either for playback. Only a possible issue when editing (you also have the option of using CBR for AAC, IRRC some encoders like FAAC only allow CBR)
    Quote Quote  
  18. Only superhuman hearing can discern anything <40ms
    he-aac v2 can easily get a larger delay than 40ms, with in example 48kHz you would get (2808 * 2000 / 48000) a delay of 122ms, which should be noticeable.
    Quote Quote  
  19. Originally Posted by Selur View Post
    he-aac v2 can easily get a larger delay than 40ms, with in example 48kHz you would get (2808 * 2000 / 48000) a delay of 122ms, which should be noticeable.

    Yes, that would be noticable

    But have you seen this happen in real life ? Or just theoretial. I used to use it for low bitrate flash videos. Never seen a delay that large
    Quote Quote  
  20. Yes, I have seen this in real life. (To be frank, another user in the german doom9/gleitz forum noticed this and during my testing which muxer is compensating this or not i did produce some files which even larger delays,...)
    Quote Quote  
  21. How are you measuring it ? I noticed some decoders might be a few +/- 10 or so ms different (there is a range of values in different programs, but they should be consistent in terms of larger or smaller delay with respect to the same testing samples)

    I just ran a few tests on a few samples, it's definitely larger, in the area of ~70ms . I've never seen it >100ms
    Quote Quote  
  22. Back then I used a specially modified file and compared the wave fronts in avisynth.
    (did the whole thing at the beginning of last year, so not so sure any more,.. posted the detailed method I used to see the delay back then over in the german doom9 forum if I remember correctly; sadly the page is inactive atm.)
    Quote Quote  
  23. So I'm using this command and getting this error:

    Code:
    "D:\ffmpeg-20130724-git-436616f-win64-shared\bin\ffmpeg.exe" -i "D:t1.ac3" -acodec pcm_s16be -ac 6 -ar 48000 -f s16be - | "D:\qaac_2.19\x64\refalac64.exe" --rate keep --gapless-mode 2 --threading --fname-from-tag --raw --raw-channels 6 --raw-rate 48000 --raw-format S16B
    @pause
    D:\>"D:\ffmpeg-20130
    724-git-436616f-win64-shared\bin\ffmpeg.exe" -i "D:\t1.ac3" -acodec pcm_s16be -ac 6 -ar 48000 -f s16be - | "D:\qaac_2.19\x64\refalac64.exe" --rate keep --gapless-mode 2 --thread
    ing --fname-from-tag --raw --raw-channels 6 --raw-rate 48000 --raw-format S16B
    Input file name is required.
    ffmpeg version N-54921-g436616f Copyright (c) 2000-2013 the FFmpeg developers
    built on Jul 24 2013 18:09:42 with gcc 4.7.3 (GCC)
    configuration: --disable-static --enable-shared --enable-gpl --enable-version3
    --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --ena
    ble-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --e
    nable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-lib
    modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
    r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --en
    able-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --e
    nable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
    libavutil 52. 40.100 / 52. 40.100
    libavcodec 55. 19.100 / 55. 19.100
    libavformat 55. 12.102 / 55. 12.102
    libavdevice 55. 3.100 / 55. 3.100
    libavfilter 3. 81.103 / 3. 81.103
    libswscale 2. 4.100 / 2. 4.100
    libswresample 0. 17.103 / 0. 17.103
    libpostproc 52. 3.100 / 52. 3.100
    [ac3 @ 000000000074d4e0] Estimating duration from bitrate, this may be inaccurat
    e
    Input #0, ac3, from 'D:\t1.ac3':
    Duration: 02:12:56.00, start: 0.000000, bitrate: 448 kb/s
    Stream #0:0: Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
    Output #0, s16be, to 'pipe:':
    Metadata:
    encoder : Lavf55.12.102
    Stream #0:0: Audio: pcm_s16be, 48000 Hz, 5.1, s16, 4608 kb/s
    Stream mapping:
    Stream #0:0 -> #0:0 (ac3 -> pcm_s16be)
    Press [q] to stop, [?] for help
    av_interleaved_write_frame(): Invalid argument
    Press any key to continue . . .
    I did some searching, but people seem to have many different reasons and situations which caused the error. I think it might be a timestamp issue though.
    Quote Quote  
  24. not sure if this is the cause, but "D:\Users\Robert\Desktop\qaac_2.19\x64\refalac 64.e xe" has a space too much
    Quote Quote  
  25. Hmm, there's no gap.
    Quote Quote  
  26. strange, the formating of you post changed for me,..
    looking at:
    Code:
    "D:\ffmpeg-20130724-git-436616f-win64-shared\bin\ffmpeg.exe" -i "D:t1.ac3" -acodec pcm_s16be -ac 6 -ar 48000 -f s16be - | "D:\qaac_2.19\x64\refalac64.exe" --rate keep --gapless-mode 2 --threading --fname-from-tag --raw --raw-channels 6 --raw-rate 48000 --raw-format S16
    the path to the input seems 'strange' but in your output-quotes the path is fine,...

    btw. might be a problem with the ac3 file and running it through delaycut might help with that
    Quote Quote  
  27. I think the problem is the ffmpeg pipe syntax ; try -acodec pcm_f32le -f wav

    The thing with spaces is a message board display issue - it affects some browsers but not others

    I think code boxes prevent it code /code
    Quote Quote  
  28. or '-f raw' instead of '-f s16be'
    Quote Quote  
  29. Originally Posted by Selur View Post
    strange, the formating of you post changed for me,..
    looking at:
    Code:
    "D:\ffmpeg-20130724-git-436616f-win64-shared\bin\ffmpeg.exe" -i  "D:t1.ac3" -acodec pcm_s16be -ac 6 -ar 48000 -f s16be - |  "D:\qaac_2.19\x64\refalac64.exe" --rate keep --gapless-mode 2  --threading --fname-from-tag --raw --raw-channels 6 --raw-rate 48000  --raw-format S16
    the path to the input seems 'strange' but in your output-quotes the path is fine,...

    btw. might be a problem with the ac3 file and running it through delaycut might help with that
    Delaycut didn't help.

    Originally Posted by poisondeathray View Post
    I think the problem is the ffmpeg pipe syntax ; try -acodec pcm_f32le -f wav

    The thing with spaces is a message board display issue - it affects some browsers but not others

    I think code boxes prevent it code /code
    The thing is I want to output to raw pcm because pcm_s16be isn't supported by the wave format, or so it tells me when I tried it.

    Originally Posted by Selur View Post
    or '-f raw' instead of '-f s16be'
    It says that raw isn't a suitable output format.
    Last edited by ROBO731; 25th Jul 2013 at 11:09. Reason: Updated information.
    Quote Quote  
  30. Originally Posted by ROBO731 View Post
    The thing is I want to output to raw pcm because pcm_s16be isn't supported by the wave format, or so it tells me when I tried it.
    The problem is the endianess le vs. be , and I don't know if you can pipe -f raw for audio

    -acodec pcm_s16le -f wav ; just change the input commands for refalac64 instead of raw
    Last edited by poisondeathray; 25th Jul 2013 at 11:16.
    Quote Quote  



Similar Threads