You are not logged in.

#1 2010-01-09 15:58:54

disturb
Member
Registered: 2009-12-18
Posts: 70

Query mp3 tags from the CLI ?

Been looking for a way to search for mp3 files, based on id3 tags, right from the shell.
Is this possible ?

Offline

#2 2010-01-10 05:00:46

brucebertrand
Member
Registered: 2006-07-24
Posts: 52

Re: Query mp3 tags from the CLI ?

Check out id3tool.  It's in AUR.
http://aur.archlinux.org/packages.php?ID=11492

I'd write a script. A combination of find (or slocate/mlocate/etc...), sed, and id3tool will produce what you want.

Offline

#3 2010-01-10 11:34:38

disturb
Member
Registered: 2009-12-18
Posts: 70

Re: Query mp3 tags from the CLI ?

sounds fun smile
thanks

Offline

#4 2010-01-10 17:07:39

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Query mp3 tags from the CLI ?

You can also use something like mediainfo (in AUR) that covers many formats both audio and video. It produces a lot of information that can be used in scripts.

Audio only:

General
Complete name                    : ./Ekstasis/Wake Up And Dream/Ekstasis - 01 - Providence.m4a
Format                           : MPEG-4
Format profile                   : Base Media / Version 2
Codec ID                         : mp42
File size                        : 10.9 MiB
Duration                         : 6mn 47s
Overall bit rate                 : 225 Kbps
Album                            : Wake Up And Dream
Track name                       : Providence
Track name/Position              : 1
Track name/Total                 : 0
Performer                        : Ekstasis
Encoded date                     : 1998
Tagged date                      : UTC 2007-02-10 17:46:21
Writing application              : FAAC 1.25
Cover                            : Yes

Audio
ID                               : 1
Format                           : AAC
Format/Info                      : Advanced Audio Codec
Format version                   : Version 4
Format profile                   : LC
Format settings, SBR             : No
Codec ID                         : 40
Duration                         : 6mn 47s
Bit rate mode                    : Variable
Bit rate                         : 223 Kbps
Maximum bit rate                 : 319 Kbps
Channel(s)                       : 2 channels
Channel positions                : L R
Sampling rate                    : 44.1 KHz
Stream size                      : 10.8 MiB (99%)
Language                         : English
Encoded date                     : UTC 2007-02-09 22:51:14
Tagged date                      : UTC 2007-02-09 22:51:35

Video:

General
Complete name                    : kali.mp4
Format                           : MPEG-4
Format profile                   : Base Media
Codec ID                         : isom
File size                        : 30.8 MiB
Duration                         : 6mn 51s
Overall bit rate                 : 628 Kbps
Writing application              : Lavf52.39.2

Video
ID                               : 1
Format                           : AVC
Format/Info                      : Advanced Video Codec
Format profile                   : High@L4.0
Format settings, CABAC           : Yes
Format settings, ReFrames        : 16 frames
Codec ID                         : avc1
Codec ID/Info                    : Advanced Video Coding
Duration                         : 6mn 51s
Bit rate mode                    : Variable
Bit rate                         : 403 Kbps
Width                            : 720 pixels
Height                           : 576 pixels
Display aspect ratio             : 5:4
Frame rate mode                  : Variable
Frame rate                       : 9.904 fps
Minimum frame rate               : 9.900 fps
Maximum frame rate               : 99.000 fps
Original frame rate              : 9.900 fps
Standard                         : PAL
Resolution                       : 8 bits
Colorimetry                      : 4:2:0
Scan type                        : Progressive
Bits/(Pixel*Frame)               : 0.098
Stream size                      : 19.8 MiB (64%)
Writing library                  : x264 core 78 r1302 6169a3f
Encoding settings                : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=tesa / subme=10 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=2 / b_bias=0 / direct=3 / wpredb=32 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=21.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00

Audio
ID                               : 2
Format                           : AAC
Format/Info                      : Advanced Audio Codec
Format version                   : Version 4
Format profile                   : LC
Format settings, SBR             : No
Codec ID                         : 40
Duration                         : 6mn 47s
Bit rate mode                    : Variable
Bit rate                         : 223 Kbps
Channel(s)                       : 2 channels
Channel positions                : L R
Sampling rate                    : 44.1 KHz
Stream size                      : 10.8 MiB (35%)
Language                         : English

Offline

#5 2010-01-10 17:49:44

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Query mp3 tags from the CLI ?

If you don't want to use this in scripts, you can simply "ffmpeg -i filename". It's obviously not the intended use but It gives you a lot of info and you don't have to install anything from the AUR.


English is not my native language .

Offline

#6 2010-01-10 17:57:09

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: Query mp3 tags from the CLI ?

Nezmer wrote:

If you don't want to use this in scripts, you can simply "ffmpeg -i filename". It's obviously not the intended use but It gives you a lot of info and you don't have to install anything from the AUR.

The version of FFmpeg in extra has some major bugs with its tag reporting. The last bug report that I filed with FFmpeg had to do with this. It's since been fixed and the version that hit testing today has these fixes. Also, 'ffmpeg -i' is a relatively heavy weight way to read tags. I'd personally use a dedicated tag reader.

Offline

#7 2010-06-12 12:11:59

tri1976
Member
Registered: 2009-09-07
Posts: 152

Re: Query mp3 tags from the CLI ?

similar to mediainfo, you can also use perl-exiftool

Offline

Board footer

Powered by FluxBB