Find the properties of an mp3 file via command line
5,952
Solution 1
use the command
mp3info -p %a %t file.mp3
%a
for artists%t
for track title
if mp3info is not installed in you system
sudo apt-get install mp3info
Solution 2
If you want a more complete output of the metadata you can use mediainfo or exiftool.
exiftool
To use exiftool simply use the command:
exiftool file.mp3
if it not yet installed, you can install it using:
sudo apt install libimage-exiftool-perl
Output sample:
exiftool 10.\ Trova\ Di\ Danú.mp3
ExifTool Version Number : 10.10
File Name : 10. Trova Di Danú.mp3
Directory : .
File Size : 6.7 MB
File Modification Date/Time : 2009:03:06 02:21:58-03:00
File Access Date/Time : 2017:11:10 09:41:16-03:00
File Inode Change Date/Time : 2017:11:10 09:41:14-03:00
File Permissions : rwxrwxrwx
File Type : MP3
File Type Extension : mp3
MIME Type : audio/mpeg
MPEG Audio Version : 1
Audio Layer : 3
Audio Bitrate : 192 kbps
Sample Rate : 44100
Channel Mode : Joint Stereo
MS Stereo : On
Intensity Stereo : Off
Copyright Flag : False
Original Media : True
Emphasis : None
ID3 Size : 1422
Encoded By :
User Defined URL :
Copyright :
Title : Trova Di Danú
Album : Trova di Danú
Year : 2004
Track : 10
Comment (esl) : Subido por Davisote
Genre : Folk Metal
Composer :
Original Artist :
Artist : Tuatha de Danann
Comment : ICQ 12126479
Date/Time Original : 2004
Duration : 0:04:50 (approx)
mediainfo
To use mediainfo simply use the command:
mediainfo file.mp3
To install it:
sudo add-apt-repository ppa:shiki/mediainfo
sudo apt-get update
sudo apt-get install mediainfo
Output sample:
mediainfo 10.\ Trova\ Di\ Danú.mp3
General
Complete name : 10. Trova Di Danú.mp3
Format : MPEG Audio
File size : 6.65 MiB
Duration : 4mn 50s
Overall bit rate mode : Constant
Overall bit rate : 192 Kbps
Album : Trova di Danú
Track name : Trova Di Danú
Track name/Position : 10
Performer : Tuatha de Danann
Genre : Folk Metal
Recorded date : 2004
Writing library : LAME3.96
Comment : Subido por Davisote / ICQ 12126479
Audio
Format : MPEG Audio
Format version : Version 1
Format profile : Layer 3
Mode : Joint stereo
Duration : 4mn 51s
Bit rate mode : Constant
Bit rate : 192 Kbps
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 6.65 MiB (100%)
Writing library : LAME3.96
Related videos on Youtube
Author by
alberto bianchi
Updated on September 18, 2022Comments
-
alberto bianchi over 1 year
Is it possible, via command line (shell command), to check for properties of a file (like when I right click on a file via Nautilus).
Specifically, given an
mp3
audio file, I would like to know how I can extract the info related totitle
andartist
from the audio section of its properties.-
Admin almost 9 yearsfor your information those(Artist Name/Song Title) are called metadata and not properties.
-