VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    I am using libfdk_aac for converting audio in video files. According to ffmpeg manual what it says about libfdk_aac is :- But beware, it defaults to a low-pass filter of around 14kHz. If you want to preserve higher frequencies, use -cutoff 18000. Adjust the number to the upper frequency limit you prefer.
    I always use -ar 44100 for setting up frequency in ffmpeg. What does the cutoff option do ? Will it create any audio quality difference if i use -cutoff ?
    Quote Quote  
  2. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by hss2293 View Post

    I always use -ar 44100 for setting up frequency in ffmpeg. What does the cutoff option do ?

    -ar is the sampling rate, not frequency

    the frequency response is determined by that specific source characteristics . e.g. something like a low quality phone recording might only have low frequencies . A high quality HD audio recording might have full range of frequencies . If you want a better idea of what is going on, view it graphically in an audio editor (e.g. audacity)

    The cutoff option will lowpass above that level; this means those higher frequencies will be eliminated, reducing the quality, but potentially saving bandwidth . At lower bitrates with audio compression, it potentially increases quality, because more data at a given bitrate can be distributed to the lower frequencies where people can distinguish and hear more



    Will it create any audio quality difference if i use -cutoff ?

    Yes, if the source has high frequencies . No if it has only low frequencies (if there wasn't any high frequency data to begin with, there is nothing to "cut off" )
    Quote Quote  
  3. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    Thanks for the info. For example i am converting a 720p video with audio bitrate as 48k using -cutoff 20000 will give me more quality as compared to the audio converted without using cutoff .
    Right ??
    Quote Quote  
  4. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by hss2293 View Post
    Thanks for the info. For example i am converting a 720p video with audio bitrate as 48k using -cutoff 20000 will give me more quality as compared to the audio converted without using cutoff .
    Right ??
    Potentially yes if you use adequate bitrate. In low bitrate range, it might actually lower the quality

    If source doesn't have high frequences, it won't make a difference than the default 14000 cut off
    Quote Quote  
  5. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    I am always converting at bitrate of 48k. Should i use -cutoff at this level of bitrate ?
    Quote Quote  
  6. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by hss2293 View Post
    I am always converting at bitrate of 48k. Should i use -cutoff at this level of bitrate ?
    48kbps 44.1Khz stereo ? aac? I would use a low cutoff . 20000 will probably yield lower quality . If you had higher bitrates , maybe 192kbps or more it would make more sense
    Quote Quote  
  7. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    yes 48kbps 44.1Khz stereo aac. As per your suggestion i should convert this at default level of 14000 cutoff or more lower than this level of cutoff ?
    Quote Quote  
  8. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Likely the default cutoff will sound better. You should test it out yourself
    Quote Quote  
  9. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    Originally Posted by poisondeathray View Post
    Likely the default cutoff will sound better. You should test it out yourself
    I have tested it.. Both have same quality. You couldn't point out any difference when heard. May be some audio tool might show some difference.
    Thanks for your help.
    Quote Quote  
  10. I never had a chance to go thru' lib_fdk_aac and study encoders ringing and harmonics pattern for 1st order, 2nd order, and so on...
    If you want to preserve higher frequencies, use -cutoff 18000. Adjust the number to the upper frequency limit you prefer.
    I would rather suggest try different settings for high-pass filter -cutoff 18000, -cutoff 20000, -cutoff 22000, and also without applying any high-pass filter at all. And use whatever sounds better to you because it also depends how high-pass filter is designed (pros & cons), as well.
    Quote Quote  
  11. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    But are you using LC or HE, HEv2 ? I think cutoff only affects LC for fdk . HE profile would probably sound better at low bitrates

    If you're using -b:a 48k , that implies CBR encoding (also inefficient given the bitrate range) , instead of VBR based quality encoding

    Of course everything discussed here varies according to the source. Complex material will be harder to encode
    Quote Quote  
  12. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    ya m using LC and cbr encofing mode b:a . At a bitrate of 48k LC and HE sounds to be same with not much difference.. Increasing the bitrate will increase the size of the videos. I have also tried nero aac for encoding video at 48k. Quality was same as the libdfk_aac codec so i thought of using fdk as it can be used in ffmpeg.
    Quote Quote  
  13. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Originally Posted by hss2293 View Post
    ya m using LC and cbr encofing mode b:a . At a bitrate of 48k LC and HE sounds to be same with not much difference.. Increasing the bitrate will increase the size of the videos. I have also tried nero aac for encoding video at 48k. Quality was same as the libdfk_aac codec so i thought of using fdk as it can be used in ffmpeg.



    Keep in mind that will vary by source. What kind of content were you encoding? On many sources that don't have many high frequencies, or that have constant complexity - you might not tell much of a difference

    But for sources that have higher frequencies, varying content - choosing HEv2 can make a big difference at that low bitrate because it's VBR (distribution is more efficient than CBR) , and has SBR (it emulates higher frequencies) . Imagine you have a movie. Some action scenes , explosions, some slow scenes, quiet. Instead of wasting bitrate the quiet scenes, VBR can better distribute the bitrate to those areas that need it like the action scenes. You can encode LC with VBR quality (not CBR), but it's difficult to hit an exact bitrate (you have to adjust the number and might overshoot or undershoot). The point is, at that low bitrate (thus filesize), HE, or HEv2 will give you better compression (and quality) than LC

    Even to non audiophiles like me can clearly hear the difference. Often at that bitrate range, LC will have "warble" or warped sounding audio because it cannot distribute bitrate and cover all frequencies - it tries to do everything yet fails because there simply isn't enough bitrate to cover everything. I can post some examples later if you wish



    Even the ffmpeg recommendation is to use HEv2 for <48kbps, HE for 48-80kbps. Generally you only use LC with >96kbps (some people say 128kbps). It's just not good enough at low bitrates, especially on complex content

    https://trac.ffmpeg.org/wiki/GuidelinesHighQualityAudio
    libfdk_aac default LC-AAC profile. Recommended range >= 128Kbps (​http://ffmpeg.org/trac/ffmpeg/wiki/AACEncodingGuide).

    (libfdk_aac or libaacplus) -profile:a aac_he_v2 Usable range <= 48Kbps CBR. Transparency: Does not reach transparency. Use LC-AAC instead to achieve transparency

    (libfdk_aac or libaacplus) -profile:a aac_he Usable range >= 48Kbps and <= 80Kbps CBR. Transparency: Does not reach transparency. Use LC-AAC instead to achieve transparency
    Quote Quote  
  14. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    ya i know vbr is better than cbr at low bitrates but it is quite difficult to control the filesize. I am encoding videos for mobile.. HE-aacv2 might have some compatibility issues with some players as said by ffmpeg manpage. Thats why i decided to use LC instead. Anyways i will experiment using vbr mode and keep an chk on filesize.
    Quote Quote  
  15. Member
    Join Date: Sep 2007
    Location: Canada
    Search Comp PM
    Yes if you have a device target, make sure you use some compatible profile

    opus produces quite good results too on many types of sources (often better than AAC with any profile, it's generally rated the highest qualty by audiophiles for lossy compression) , but not many portable devices support it natively
    Quote Quote  
  16. Member
    Join Date: Oct 2013
    Location: India
    Search PM
    I am trying neroaac now. Whats the command line option for setting up sampling rate ? I got the bitrate setting option -br but cannot find the option for setting sampling rate
    Quote Quote  
  17. vanished El Heggunte's Avatar
    Join Date: Jun 2009
    Location: Misplaced Childhood
    Search Comp PM
    If you need it, you'd better resample the source audio manually, before encoding to AAC.

    FYI, these are the sample rates supported by the AAC spec:

    Code:
    96000 Hz
    88200 Hz
    64000 Hz
    48000 Hz
    44100 Hz
    32000 Hz
    24000 Hz
    22050 Hz
    16000 Hz
    12000 Hz
    11025 Hz
    8000  Hz
    7350  Hz
    Quote Quote  
  18. Originally Posted by El Heggunte View Post
    If you need it, you'd better resample the source audio manually, before encoding to AAC.
    Why? ffmpeg support HQ resampler from SoX.

    Code:
    -af "aformat=sample_fmts=fltp,aresample=resampler=soxr:osr=48000:cutoff=0.95:dither_method=0"
    Quote Quote  
  19. vanished El Heggunte's Avatar
    Join Date: Jun 2009
    Location: Misplaced Childhood
    Search Comp PM
    Because:

    Originally Posted by hss2293
    I am trying neroaac now. Whats the command line option for setting up sampling rate ? I got the bitrate setting option -br but cannot find the option for setting sampling rate
    Quote Quote  
  20. Originally Posted by El Heggunte View Post
    Because:

    Originally Posted by hss2293
    I am trying neroaac now. Whats the command line option for setting up sampling rate ? I got the bitrate setting option -br but cannot find the option for setting sampling rate
    pipe sox to neroaac?

    http://forum.videohelp.com/threads/359518-Normalizing-Multiple-Audio
    http://forum.doom9.org/showthread.php?t=164098
    http://www.hydrogenaud.io/forums/index.php?showtopic=66382&st=0&p=592700&#entry592700
    Quote Quote