VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. about making a mp3 with ffmpeg and wrong information written in document
    ffmpeg.exe −i 1% −ab 384k xxx.mp3

    1. -aframes number
    it is an irrelevent command for making mp3, is it not?

    2. -ar freq -- Set the audio sampling frequency (default = 44100 Hz).
    this default is a false, ffmpeg.exe takes the source file's frequency and automatically uses it to make mp3. is it not?

    3. −ab bitrate -- Set the audio bitrate in bit/s (default = 64k).
    this default is a false, 128k is the default, is it not?

    4. −ac channels -- Set the number of audio channels (default = 1).
    is this relevant option to make mp3? because i have never heard about using it. so should i remove it from the command line?

    5. so this is all you need to make a mp3.
    A. ffmpeg.exe −i 1% −ab 184k xxx.mp3 or
    B. ffmpeg.exe −i 1% −ab 284k -ar 48000 xxx.mp3 at most

    6. −acodec codec --Force audio codec to codec. Use the "copy" special value to specify that the raw codec data must be copied as is.
    no idea what it is, i will try to ask this in a different post.

    i hope you verify 1. to 5. for me
    Quote Quote  
  2. 1. It does have a function but you probably don't need it. It is more commonly used with video. It will only encode number audio/video frames and then stop.
    2. Yes, unless the encoder doesn't support it.
    3. Default is 64k per channel. So stereo default is 128k.
    4. You can decide if you want mono or stereo. Usually you don't set it and let ffmpeg choose.
    5. ffmpeg -i %1 xxxx.mp3 is all you really need if you are happy with the defaults ffmpeg is choosing.
    6. If your source audio is already mp3 ffmpeg will just copy it. For example if you have an mp3 audio track in an mkv and you want to extract: ffmpeg -i "input.mkv" -c copy "output.mp3". If you don't set "-c copy" (or "-c:a copy" specifically for audio) ffmpeg will re-encode the audio so you lose quality and waste time. ("-codec" and "-acodec" do the same but they are outdated)

    Tip: most of these things can be easily tested by yourself. No need to ask everything on the forum.
    Quote Quote  
  3. Explorer Case's Avatar
    Join Date
    Feb 2004
    Location
    Middle Earth
    Search Comp PM
    1/ -aframes number is an obsolete alias for -frames:a. -aframes limits the output length (end encoding after n frames). I have never used this option myself, though. My small audio-only test with a “150” value, resulted in a 3.9 seconds audio file, so these “frames” would be about 1/38 of a second. Still not sure how it works.

    2/ -ar freq can range from 8000 Hz to 48000 Hz, in pre-defined steps, for MP3 (per MP3 specification). By default (without specifying) ffmpeg will copy sampling rate from source (44100 to 44100; 48000 to 48000) if that is valid, or resample to make it valid (closest, e.g. 192000 to 48000).

    3/ -ab bitrate seems to default to 128k for MP3 conversions for me as well. 64k per channel.

    4/ -ac channels seems to default to 2 channel (stereo) for stereo or multichannel source files.

    5/ Regular bitrates for stereo mp3 are: 128, 160, 192, 224, 256, 320 kbps. Not sure if 184k or 284k are valid numbers, they may get rounded down to a valid number, assuming CBR (constant bitrate). [VBR (variable bitrate) allows one bitrate for one section and a different bitrate for another section, in order to give more definition to complex parts.]

    6/ ffmpeg tries to guess which codec to use for the output by looking at the suffix of the output filename. E.g. ffmpeg will encode to mp3 if you do not specify the audio codec or the output format, and the output filename is xxx.mp3 .
    Last edited by Case; 5th Jun 2017 at 08:58.
    Quote Quote  
  4. Originally Posted by Case View Post
    1/ -aframes number is an obsolete alias for -frames:a. -aframes limits the output length (end encoding after n frames). I have never used this option myself, though. My small audio-only test with a “150” value, resulted in a 3.9 seconds audio file, so these “frames” would be about 1/38 of a second. Still not sure how it works.
    Many audio codecs have frames similar to video frames. These have a certain, often constant, length. mp3 should be 1152 samples per frame. At 44.1kHz that would be: 1000 * (1152 / 44100) ~= 26 (ms) per frame (i.e. 1/38 second).
    Quote Quote  



Similar Threads

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