Skip to content

Instantly share code, notes, and snippets.

@cjLGH
Last active December 18, 2021 21:37
Show Gist options
  • Save cjLGH/3dce5cda76722ab3557d124c93f6acb5 to your computer and use it in GitHub Desktop.
Save cjLGH/3dce5cda76722ab3557d124c93f6acb5 to your computer and use it in GitHub Desktop.
ffmpeg and ffprobe commands

m4b to mp3

ffprobe commands

$ ffprobe file.m4b
ffprobe version N-94058-g756dd98 Copyright (c) 2007-2019 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.11) 20160609
  configuration: --prefix=/home/cjLGH/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/cjLGH/ffmpeg_build/include --extra-ldflags=-L/home/cjLGH/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/cjLGH/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      56. 29.100 / 56. 29.100
  libavcodec     58. 53.100 / 58. 53.100
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3656f00] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'file.m4b':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    title           : title
    artist          : artist
    album           : album
    genre           : genre
    comment         : comment
    copyright       : copyright
    album_artist    : album_artist
  Duration: 12:34:56.78, start: 0.000000, bitrate: 130 kb/s
    Chapter #0:0: start 0.000000, end 66.919000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 66.919000, end 1111.678000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 1111.678000, end 1346.432000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 1346.432000, end 2653.855000
...

ffmpeg commands

$ ffmpeg -ss 0.000000 -to 1111.678000 "file.m4b" -acodec libmp3lame -ar 22050 -ab 64k "file.mp3"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment