ffmpeg

Command

Filter

  • List available filters
      ffmpeg -filters
    

Option

  • audio bit rate [Kbps]
      -ab 128
    
    • 低いサンプルレートの場合、大きい値は設定できない、
      • 32khz未満の場合は160kbps以上の値は設定不可。
  • audio sampling rate [hz]
      -ar 16000
    
  • the number of channels
      -ac 2
    
    • 1: monoral
    • 2: stereo
  • sampling bit (audio codec)
      -acodec pcm_s24le
      -acodec pcm_16le
      -acodec pcm_u8
    
    • 24 bit: -acodec pcm_s24le
    • 16 bit: -acodec pcm_16le
      • signed int little endian
    • 8 bit: -acodec pcm_u8
      • unsigned int
    • list acodec
        ffmpeg -codecs
      

Example

  • Change sound to stereo 96 khz and 24 bit wav
      ffmpeg -i before.mp3 -ar 96000 -ac 2 -acodec pcm_s24le after.wav
    
    • 音の高さを変えずにスピード変更
  • Reduce speed
      ffmpeg -i ./input.mp3 -filter:a "atempo:0.5" -vn ./output.mp3
    
    • 音の高さを変えずにスピード変更
  • Increase speed
      ffmpeg -i ./input.mp3 -filter:a "atempo:2.0" -vn ./output.mp3
    
  • Higher pitch (assuming your audio is 44.1KHz)
      ffmpeg -i ./input.mp3 -filter:a "asetrate=r=48K" -vn ./output.mp3
    
  • Lower pitch (assuming your audio is 44.1KHz)
      ffmpeg -i ./input.mp3 -filter:a "asetrate=r=36K" -vn ./output.mp3
    

参考