Print bitrate of each audio file

find . -print0 | xargs -0 -I{} ffmpeg -i "{}" 2>&1 | grep "kb\/s\|Input"
This useful command will help to detect bitrate of each audio file in folder where it will run for.
Sample Output
Input #0, ogg, from './Omega/01. Track 1.opus':
  Duration: 00:03:40.97, start: 0.000000, bitrate: 140 kb/s
Input #0, ogg, from './Omega/01. Track 10.opus':
  Duration: 00:05:38.18, start: 0.000000, bitrate: 127 kb/s
Input #0, ogg, from './Omega/01. Track 11.opus':
  Duration: 00:04:10.09, start: 0.000000, bitrate: 125 kb/s
Input #0, ogg, from './Omega/01. Track 12.opus':
  Duration: 00:05:41.90, start: 0.000000, bitrate: 128 kb/s
Input #0, ogg, from './Omega/01. Track 13.opus':
  Duration: 00:03:53.46, start: 0.000000, bitrate: 125 kb/s

By: Zeben
2018-01-19 03:45:04

These Might Interest You

  • With the -vn switch we make our intentions clear and ask FFmpeg not to bother itself with the video. Next we specify the audio codec copy, which tells FFmpeg to use the same codec to encode the audio, which it uses to decode it. To keep things simple, we'll just keep the sampling and bitrate values the same.

    ffmpeg -i input.mp4 -vn -acodec copy output.m4a
    kev · 2011-09-03 12:09:30 0
  • ffmpeg -i = input file name -s = set frame size, qcif=176x144 -vcodec = force video codec -r = frame-rate [default = 25] -b = bit-rate [200 kb/s] -acodec = force audio codec -ab = audio bitrate in bits/s [64k] -ac = no. of audio channels [1] -ar = audio sampling frequency [44100 Hz] optional: -sameq = use same video quality as source (implies VBR) -f = force format -y = overwrite output files

    ffmpeg -i input.avi -s qcif -vcodec h263 -r 20 -b 180k -acodec libfaac -ab 64k -ac 2 -ar 22050 output.3gp
    mariusbutuc · 2010-04-24 23:01:21 1
  • Batch Convert MP3 Bitrate to xxxkbps, all the new files will be placed in a folder called "save". Please replace xxx with the desired bitrate. WARNING!!! This will erase any tag information; this is where Picard or EasyTAG will come in handy. Show Sample Output

    mkdir save && for f in *.mp3; do lame -b xxx "$f" ./save/"${f%.mp3}.mp3"; done
    o0110o · 2011-05-30 17:19:36 0
  • This commands saves the output in the audio directory. The portion ${file/%avi/mp3} uses bash string replacement to replace the avi to mp3 within the ${file} variable.

    mencoder "${file}" -of rawaudio -oac mp3lame -ovc copy -o audio/"${file/%avi/mp3}"
    fulat2k · 2009-02-15 14:57:54 4

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: