Audio file metadata?

Do you have a question? Post it now! No Registration Necessary

Threaded View
This is, I guess, a more general Linux question, but as I'm working
on the Pi...

Is there any program that will let me edit the metadata in (in this
case) an Ogg-Vorbis file?  I can use Audacity, but that involves
loading (and translating) the file, just to write it out again
so I can edit a typo in the artist's name!  I assume there's
negligible degradation in going from compressed Ogg to Audacity
raw and back again, but it's slow and tedious.

I was surprised -- and pleased -- to find that 'exiftool' that I use
on my photos reads the metadata, but it can't rewrite the file.

[FTR, I have a project to digitize some of my old 45s, and it turns
out that my early Pi B, with 'arecord' and a USB audio link works
really nicely for that.  The Pi, wired into other stuff, is on the
other side of the room from my turntable, so I need to control the
Pi from my PDA via wifi (hence can't use Audacity directly), but
it's all fairly efficient.]

    -- Pete --


Re: Audio file metadata?
On 26/05/2020 07:28, Pete wrote:
Quoted text here. Click to load it

On the command line, you might try ffmpeg. I found this example which  
will probably also work for ogg:

ffmpeg -hide_banner -loglevel warning -i input.mp3 -metadata title="The  
Title You Want" -metadata artist="The Artist" -metadata album="Name of  
the Album" -c:a copy output.mp3

The "-c:a copy" part instructs ffmpeg to make a direct copy instead of  
transcoding the file using some default audio encoder settings. Both  
that and the metadata options must go inbetween the input and output  
file names. See "man ffmpeg".

Other programs I found support only mp3, have not been updated in a  
decade or are rather convoluted, using their own database as an  
intermediate step (update tags in the db, write out to files).

Re: Audio file metadata?
On 2020-05-26, A. Dumas wrote:
Quoted text here. Click to load it

Yes, this will work on pretty much any container format you'll now
meet except for mpc (which approximately nobody uses any more, and a
good thing too).

If you want to _read_ metadata, perhaps to edit them elsewhere before
writing them back:

ffprobe -hide_banner -show_format -print_format json [filename]

may be your friend.


Re: Audio file metadata?
Pete wrote:

Quoted text here. Click to load it

Sounds like you want an ID3 tag editor, e.g.

<https://www.ubuntupit.com/top-15-best-music-tag-editor-software-for-linux-system/

Presume at least some of these are available on rPi?

Re: Audio file metadata?
On 26/05/2020 06:28 am, Pete wrote:
Quoted text here. Click to load it

Best one I've found is kid3 - kid3-qt and kid3-cli
It's in the apt repository.


--  

Chris Elvidge, England

Re: Audio file metadata?
On Tue, 26 May 2020 05:28:13 +0000, Pete wrote:

Quoted text here. Click to load it
I generally use easytag whenever I need to edit tags on music files.  
Its a graphical program that edits tags in music files: that's all it  
does. It works well under Fedora/XFCE and is available for Raspbian.  
Understands ogg, though I usually use it for MP3 and FLAC.

May be slight overkill for dealing with individual tracks: it works  
really well when dealing with albums and other collections of track files  
which have one or more tags in common, e.g. artist, composer, album title.


--  
Martin    | martin at
Gregorie  | gregorie dot org


Re: Audio file metadata?
Quoted text here. Click to load it

Thanks, everyone, for the suggestions.  Seems there are several
good choices.  I'll probably go with ffmpeg for now, as I don't
have to install anything, and it's only the occasional typo I
want to correct.  As I'm editing the audio with Audacity, the
original text gets added there.

While I'm here, I have another question...  I play back the files
several ways, but I was amused/startled/slightly-horrified that
when I use vlc, it pops up an image of an album cover for many
of the files!  What is it using to find that?  Some of the metadata
I added, I suppose.  Must be going to the cloud...

    -- Pete --


Re: Audio file metadata?
On 2020-05-26, Pete wrote:
Quoted text here. Click to load it

Yup, it'll search on metadata if you let it; there are various
services that offer lookups along these lines.

One player I use on Android insists on tagging anything from The
Esoteric Order of Roleplayers with this chap:

https://versetracker.com/sites/default/files/rapper-pictures/e/esoteric.jpg

so one can't really regard it as _reliable_.

Re: Audio file metadata?
On a sunny day (Tue, 26 May 2020 21:43:16 -0000 (UTC)) it happened Roger

Quoted text here. Click to load it

If it is only a tIping error
I can easily change things like typos with 'hexedit'
 # hexedit hcam_1_890.ts

Use tab to go to alphanum side
overwrite
save

hexedit file.ts
00000000   47 40 11 10  00 42 F0 28  00 01 C1 00  00 FF 01 FF  00 01 FC 80  17 48 15 01  06 46 46 6D  70 65 67 0C  52 54 53 50  20 53 65 73  73 69 6F 6E  B5 B3 2A 58  G@...B.(.............H...FFmpeg.RTSP Session..*X
00000030   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  ................................................
00000060   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  ................................................
00000090   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  47 40 00 10  ............................................G@..
000000C0   00 00 B0 0D  00 01 C1 00  00 00 01 F0  00 2A B1 04  B2 FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  .............*..................................
000000F0   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  ................................................
00000120   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  ................................................
00000150   FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  47 50 00 10  00 02 B0 17  ........................................GP......
00000180   00 01 C1 00  00 E1 00 F0  00 1B E1 00  F0 00 06 E1  01 F0 00 27  A0 D9 10 FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  FF FF FF FF  ...................'............................

You can even do it with joe text editor.



Re: Audio file metadata?
Quoted text here. Click to load it

The cover art may be embedded in the actual media file, essentially
it is another form of tag. I know easytag allows art to be added,
not familarvwith the other options. It isn't looking them anywhere,
nor is it unique, my phone and even my TV do exactly the same thing
if the art is there in the first place.

--  
Andrew Smallshaw
snipped-for-privacy@sdf.org

Re: Audio file metadata?
Quoted text here. Click to load it

Not in this case... unless somehow the image was imbedded in an ancient
45! (:-))  These are all files I've digitized directly from the original
vinyl.  The tags are ones I added myself, not always even exactly what's
on the label.

    -- Pete --


Re: Audio file metadata?
On Wed, 27 May 2020 03:48:04 +0000, Andrew Smallshaw wrote:

Quoted text here. Click to load it

There may be a tag for cover art but AFAIK its not supported by Easytag.

EasyTag doesn't care if you lob a suitable sized image into thre same  
directory ad the track files its happy to ignore it and LMS is quite  
happy to display .JPG or .PNG images on the relevant wab pages, just as  
my old Touch is happy to display them on its screen. The file used to  
have to be called 'folder.jpg' but I think it'll accept any name now.  


--  
Martin    | martin at
Gregorie  | gregorie dot org


Re: Audio file metadata?

Quoted text here. Click to load it

I have/use Easytag 2.1.7 for mass renaming/mp3 tag editing and it does
indeed support embedded pictures in mp3s -- it's on the next tab
across from "Common" tags, and marked "Pictures". You can add or
remove pictures from the file, or save out a copy of the embedded
pic.

Quoted text here. Click to load it

If you use the "Pictures" tab option to do so, it will not ignore it, it  
will embed it in the file, then every player that supports  
this stuff will see it (hopefully!)

As to the OP -- I also use "id3v2" for command line dumping/manipulating
of metadata in audio files.
--  
--------------------------------------+------------------------------------
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk

Re: Audio file metadata?
On Wed, 27 May 2020 14:47:13 +0100, Mike wrote:

Quoted text here. Click to load it
Sure, but thats at the track level - I just checked to make sure.

However, I thought the OP was asking about album art.

This is fine which is fine for BBC Radio programs and other long  
recordings ("cabin Pressure", Radio 3 Concerts of sound-desk recordings  
of whole sets), but would be decidedly painful if you rip CDs at the  
track level, because:  

(a) very few, if any, albums have a different image for each track

(b) putting the same image in every track does little but chew up
    masses of disk space if you like high resolution images.


--  
Martin    | martin at
Gregorie  | gregorie dot org


Re: Audio file metadata?

Quoted text here. Click to load it

Correct, the orig question was about editing the metadata in an Ogg/Vorbis
file (not an Ogg/Vorbis *album* ;) and the later observation was that
VLC was popping a picture when listening to some of the *tracks*.

Quoted text here. Click to load it

True. All I can say is that where a number of MP3 tracks of individual
songs from an album exhibit this behaviour in VLC, it's because the
album cover is embedded in each one.  

No need for a different image for each track, although that would be  
possible.

Quoted text here. Click to load it

True, but since when was efficiency a thing any more?

The image that VLC is showing me for .mp3 files are the same images
shown in Easytag, and those images are embedded as metadata in each  
individual mp3 file.

Yeah, I could strip them out to save some disc space, but I don't
bother.
--  
--------------------------------------+------------------------------------
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk

Re: Audio file metadata?
On 26/05/2020 23:40, Pete wrote:
Quoted text here. Click to load it

It's a setting: look up track info/album art online, yes or no. Often it  
gets the right info just by looking at a directory with a certain number  
of tracks of a certain length. (And by going online, submitting that  
info and getting something relevant back from the database.) Most widely  
used, I think: https://en.wikipedia.org/wiki/CDDB

Re: Audio file metadata?
Quoted text here. Click to load it

Ahh, yes I found the setting in VLC preferences.  Now set to "Manual".

I don't see how it can be using CDDB or kin, though, from the description
in WP.  The ID seems to be formed by the length and order of tracks
in an album, but my files are all single tracks, and probably only
approximately the length of the original as I usually put a brief
silence before and after.  I rather hope it's not using a Shazam
type audio signature derived from the track itself!

Veering a bit off-topic, I listen a lot to Radio Caroline and its Flashback
(again usually via the Pi) and they both use the 'ACRCloud' service to
provide a playlist of their tracks.  This often staggers me completely
with its ability to accurately name the most obscure song and then,
equally strangely, to quite fail to identify the most familiar one!
(It does use a signature derived from the first few seconds of audio.)

    -- Pete --


Re: Audio file metadata?
Quoted text here. Click to load it
So, to close this out...

To satisfy my curiosity, in the end I did some tcpdumping, and found
that vlc is querying 'mb.videolan.org' (aka goldeneye.videolan.org)
for the data.  The query it sends uses the 'Artist' and 'Title' tags
I supplied when I created the file.  The answers seem to come back
from musicbrainz.org.`

Which means it's all open-source stuff, And I was chuffed to see
that the html headers videolan returns all include good old
"X-Clacks-Overhead: GNU Terry Pratchett" (:-))

    -- Pete --


Re: Audio file metadata?

Quoted text here. Click to load it

Ah, I see why my VLC has never done that to me (it only shows artwork  
physically embedded in the mp3 as metadata) :-

Tools/Preferences/Interface

"Privacy/Network Interaction"/Album Art Download Policy  

[x] "Manual Download Only"  
[ ] "When track starts playing"  
[ ] "As soon as track is added"

Either I switched that off on first install, or the default was "don't do that".
--  
--------------------------------------+------------------------------------
Mike Brown: mjb[-at-]signal11.org.uk  |    http://www.signal11.org.uk

Re: Audio file metadata?
Quoted text here. Click to load it

Yep.  (I think) I've verified that it doesn't do any database queries
if it's set to 'Manual...'  It seems to need restarting to change a
preference setting, which was fooling me a bit yesterday.  But I'm
pretty sure it was set to "When track starts playing" when I first
looked, and I'm also sure I never set it before.

I was also puzzled by there not being any apparent download of the
art, but of course it's being cached (~/.cache/vlc/art/arturl).
I still haven't figured out what the IDs in that directory connect
to -- they aren't visible in any of the other downloaded data.

I'm much happier not having all my music selections broadcast to
the cloud (:-/), though I guess they're only actually being used
to locate the cover art.

    -- Pete --


Site Timeline