Recent

Author Topic: Recomendations for audio metadata [DONE]  (Read 8398 times)

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Recomendations for audio metadata [DONE]
« on: April 24, 2019, 12:22:09 am »
I'm looking for some unit, library or package to extract metadata from audio files (e.g. IDv3 from mp3).

It must work at least on Linux and, if possible,  *BSD. Bonus points for (in priority order) Windows, Android and MacOS.

It should be able to extract metadata from at least MP3s, OGGs and FLACs. Bonus for tracker (MOD, S3M, IT, etc) and SMF (.MID) files.

Nice, but not imprescindible, if it can also play them :)

Any "bids"?
« Last Edit: May 04, 2019, 09:38:51 pm by lucamar »
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Recomendations for audio metadata?
« Reply #1 on: April 24, 2019, 12:39:44 am »
Have a look at the components TJvID3v1 and TJvID3v2 of JVCL (https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/jvcllaz/). They may fulfill some of your wishes. Tested on Windows and Linux, no idea about others, the code is rather universal, though.

If you don't want to install all JVCL components you can also
- compile runtime package JvCoreLazR
- compile runtime package JvMMLazR
With these you can access these components at runtime.

There are demos in the folders examples/JvID3v1 and examples/JvID3v2 (require installation of the designtime package JvMMLazD)

john horst

  • Jr. Member
  • **
  • Posts: 68
    • JHorst
Re: Recomendations for audio metadata?
« Reply #2 on: April 24, 2019, 01:18:02 am »
UOS can http://wiki.freepascal.org/uos

We have been using UOS. It works. It depends though on what you are trying to do. If you want meta data and play local file, its all good. If you want meta data over a stream that's a different story, prepare to write code.   .
« Last Edit: April 24, 2019, 01:21:04 am by john horst »

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recomendations for audio metadata?
« Reply #3 on: April 24, 2019, 01:21:27 am »
Thanks wp. I have used those in the past with Delphi and they only support MP3s. They are also quite fixed-minded about the exact place and format the metadata must have in the file and are quite unforgiving of the many "errors" lots of other tools (the Windows Media Player comes to mind, don't know why :D ) perpretate on the poor files.

There must something more robust out there: there are media players written in Pascal that show it!

@john horst: Thanks, too. I'll look at it alhough, IIRC, the last time I looked (not many years ago) UOS required quite a lot of third-party libraries, doesn't it? But OK: if it works, it works. I'll test again. Thanks again.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Recomendations for audio metadata?
« Reply #4 on: April 24, 2019, 09:19:27 pm »
Using a sledgehammer to crack a nut - but

   Bass.dll

is realy stable libraray, always developed and free for personal use.
It is NOT open source, but provides APIs for Delphi, C/C++ and Visual Basic.

Works with Linux, Windows and Mac.

A library named Tags is available:
"An extension producing formatted text from the ID3v1/v2, OGG/FLAC, WMA, APE, MP4, and RIFF tags of a BASS stream. C/C++, Delphi, and Visual Basic APIs are included. "

You can download Bass.dll and all extension from https://www.un4seen.com/

You cannot install the library "Tags" without the main Bass.dll - so you are forced to install the basics of an audio player.

If interested and have some questions: I just fiddle around with Bass to write my own audio player (Linux).

Winni




RAW

  • Hero Member
  • *****
  • Posts: 868
Re: Recomendations for audio metadata?
« Reply #5 on: April 24, 2019, 10:30:07 pm »
@lucamar
What about the VLC PLAYER libs?
It's open source and the player can handle different file formats... but I don't know the metadata details ...  :)

Maybe on this site you can find something ???
https://prog.olsztyn.pl/paslibvlc/
« Last Edit: April 24, 2019, 10:35:37 pm by RAW »
Windows 7 Pro (x64 Sp1) & Windows XP Pro (x86 Sp3).

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recomendations for audio metadata?
« Reply #6 on: April 24, 2019, 11:31:28 pm »
Thanks, folks!

Noted all your sugesttions and will be checking them this weekend (gods willing: it's a low priority project :) ).

I have used bass with Delphi too but I made only a "let's-see-if-this-bass-thing-works" mini-mini-player.

Regarding VLC ... well, that's quite a heavy dependency for the simple thing I'm building (I don't think it'll ammount to 200 lines). I'll check anyway: maybe it can be made leaner.

If interested and have some questions: I just fiddle around with Bass to write my own audio player (Linux).

Thanks, Winni; I appreciate it. I tend to wrestle with problems on my own but is nice having someone to whom you can ask as a last ressource.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Recomendations for audio metadata?
« Reply #7 on: April 26, 2019, 02:30:26 pm »
@lucamar

Quote
maybe it can be made leaner

See 'FFInfo4Laz' = read out any Metadata from any Multimedia-File with 'FFmpeg' and Lazarus:
https://forum.lazarus.freepascal.org/index.php/topic,22038.msg208700.html#msg208700
It's written with and for FPC - You may adapt the SourceCode to Your Needs.

BTW: 'FFInfo4Laz' is Part of 'FFPlay4Laz'; the latest Release is here:
https://forum.lazarus.freepascal.org/index.php/topic,26666.msg311955.html#msg311955
Open a MRL with 'FFPlay4Laz' and press <i> -> all Metadata (and much more) will be listed in the ConsoleWindow.
 :)
« Last Edit: April 26, 2019, 05:17:01 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recomendations for audio metadata?
« Reply #8 on: April 26, 2019, 04:14:54 pm »
Thanks, metis! Looks good and i'll test it too. This is turning into a full-scale investigation ;)

But ... same problem with FFMPEG: external libraries which need to be installed and fatten up the release of what is really a rather small tool.

I'd hoped there would exists the equivalent of DExif or FPExif for audio. :'(

Well, I can always try to take a sabatical and write it myself :D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Recomendations for audio metadata?
« Reply #9 on: April 26, 2019, 05:10:50 pm »
@lucamar
Quote
external libraries which need to be installed and fatten up the release
'FFmpeg' doesn't need to be installed; You simply copy the Libs, e.g. into the App's Path.
For Reading out Metadata only, You won't need all FFmpeg-Libs.

Doing it with 'FFmpeg' is rather a Copyright-Problem:
To avoid Copyright-Problems, it's better not to put the Libs into the Release.
You only give the Link, and each User has to download the Libs by himself, just like e.g. 'Audacity' does.

Over the Weekend, I'll check my CodeLibrary, if in Case I find some other Code for You. :)
« Last Edit: April 26, 2019, 05:19:55 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recomendations for audio metadata?
« Reply #10 on: April 26, 2019, 05:44:57 pm »
'FFmpeg' doesn't need to be installed; You simply copy the Libs, e.g. into the App's Path.

Not on Linux (or any other *nix, for that matter) and those systems are the requirement.

Besides, I'm always grumbling about @#$%& Windows programs that install a 100K binary ... and a megaton of libraries to which they make five calls max ... and which another program already has tucked away in its own folder. I'm not going to do the same if I can avoid it ;)

Of course, it would be different if it were just one (or two) short and to the point DLL(s).

As almost everything, I guess it's a matter of personal tastes.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

varianus

  • New Member
  • *
  • Posts: 22
Re: Recomendations for audio metadata?
« Reply #11 on: April 26, 2019, 08:05:38 pm »
For my audio player ovoplayer I've written some code to read and update tags for the most common audio formats.

No dependency on external library, just pascal code.

You can find sources here: https://github.com/varianus/ovoplayer/tree/master/src/ovotag

winni

  • Hero Member
  • *****
  • Posts: 3197
Re: Recomendations for audio metadata?
« Reply #12 on: April 26, 2019, 11:34:40 pm »
@lucamar:

Sometimes my memory is not too bad: There is a german site around Bass.dll and Delphi. Since years unchanged, but he has written ID3-Tags-Code as open source for versions v1, v1.1, v2.2, v2.3 and v2.4. Everything written from the scratch.

The guy  is called Gausi as his website. The Mp3FileUtils can be found here
http://www.gausi.de/mp3fileutils.html

His pages are also available in english.

I hope that the code is not too much outdated.

Winni



lucamar

  • Hero Member
  • *****
  • Posts: 4219
Re: Recomendations for audio metadata?
« Reply #13 on: April 27, 2019, 12:47:25 am »
For my audio player ovoplayer I've written some code to read and update tags for the most common audio formats.

No dependency on external library, just pascal code.

That is what I was hoping to find. Many thanks. Going to clone now :)


Sometimes my memory is not too bad: There is a german site around Bass.dll and Delphi. Since years unchanged, but he has written ID3-Tags-Code as open source for versions v1, v1.1, v2.2, v2.3 and v2.4. Everything written from the scratch.

The guy  is called Gausi as his website. The Mp3FileUtils can be found here
http://www.gausi.de/mp3fileutils.html

His pages are also available in english.

I hope that the code is not too much outdated.

Winni

Thanks, Winni.  I shall visit the site when I have some time.
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.12/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

metis

  • Sr. Member
  • ****
  • Posts: 300
Re: Recomendations for audio metadata?
« Reply #14 on: May 02, 2019, 01:00:06 pm »
Though lucamar found, what he was looking for, here some additional Infos, that might be useful to others...

Quote from: winni
The Mp3FileUtils can be found here
'Mp3FileUtils' is Part of 'Nemp' (= Noch ein Mp3-Player = "yet another mp3-player").
The MainDifference to other Players is, that it's remote-controllable via WLAN (http://www.gausi.de/nemp-features-en.html -> "Nemp Webserver").
This Feature can be used, e.g. for Parties, where the Guests may choose the next Song(s) to be played with their Smartphones (http://www.gausi.de/nemp-features-en.html -> "Nemp as a party player").
The Tracks are put into a Playlist, sorted by how often they have been voted -> (Almost) no more DJ needed at Your Party.
Very nice Idea, like it.  :) :) :)


Quote from: raw
VLC PLAYER ... but I don't know the metadata details
With 'VLC', Metadata can be read out and modified, and furthermore it's all implemented in the
VLC-Package/-Component, that comes with Lazarus - at least with the Windows-Installation, see:
'C:\lazarus\components\vlc'.

For Metadata-Details, see (with Windows-StandardInstallation):
'C:\lazarus\fpc\3.0.4\source\packages\libvlc\src\libvlc.pp' -> Type 'libvlc_meta_t':
Code: [Select]
libvlc_meta_t = (libvlc_meta_Title,libvlc_meta_Artist,
    libvlc_meta_Genre,libvlc_meta_Copyright,
    libvlc_meta_Album,libvlc_meta_TrackNumber,
    libvlc_meta_Description,libvlc_meta_Rating,
    libvlc_meta_Date,libvlc_meta_Setting,
    libvlc_meta_URL,libvlc_meta_Language,
    libvlc_meta_NowPlaying,libvlc_meta_Publisher,
    libvlc_meta_EncodedBy,libvlc_meta_ArtworkURL,
    libvlc_meta_TrackID);


Quote from: lucamar
I guess it's a matter of personal tastes
It's rather a Matter of what You need it for:
Being tired of trying around with diverse Libs or Codes, that sooner or later always reach to a Limit,
I wanted something really fast, universal and reliable for any MediaFormat, including Video (-> No 'UOS', no 'Bass', no 'OvoTag'),
w/o Rewriting tens of thousands of CodeLines, that should support the most common Platforms for Multimedia-Processing, too.
The Best I found up to now for this Purpose is the FFmpeg-Framework.
('VLC' is nice, but too slow and with too much Redundancy for my Needs.)

Quote from: lucamar
it would be different if it were just one (or two) short and to the point DLL(s)
Pretty improbable to find that, but the Following should work:
Take a Lib's Source, disable everything, what You don't need in the Config-File and/or the Export-Headerfile,
and compile that with Smart-Linking. This should produce a minimal Binary, that fits exactly to Your Needs.


@lucamar
See attached 'ExtractMetadataFromAudioFiles.7z' for what I would have found for You:
- No DLL needed, pure (Delphi)PascalCode, but mp3 and wma, only.
- Much less Code than 'OvoTag', but maybe sufficient, just depending on one's Needs.  ;)
« Last Edit: June 03, 2019, 12:51:23 pm by metis »
Life could be so easy, if there weren't those f*** Details.
My FFmpeg4Lazarus = FFPlay4Laz + FFGrab4Laz + FFInfo4Laz

 

TinyPortal © 2005-2018