bare minimum installation mp3/ogg

The place for "I can't figure out how to..." questions.
Post Reply
chris_blues
User
Posts: 8
Joined: Wed Sep 30, 2015 12:15 am
Are you a spambot?: no
Contact:

bare minimum installation mp3/ogg

Post by chris_blues » Wed Sep 30, 2015 12:33 am

Hi there!

First thanks a lot for your outstanding work! I just made a few tests and I am very impressed!

So, now I'd like to strip getID3 down to the bare minimum. Here are my thoughts:
  • delete all files from /getid3 except getid3.php getid3.lib.php module.audio.mp3.php and module.audio.ogg.php
    => mp3 and ogg reading is all I need.
Anything else I should keep? Or throw out?

I'm hoping to bring down processing times, so I wonder, are there any settings I should be aware of? Actually getID3 gives me much more information, than I need. Only the $getID3["tags"] section would be quite enough. You propably reckon, that I haven't sifted through the code yet, just looked into getid3.php and some demos, and couldn't get much out of it at a first glance. It takes a lot of time to understand it, looking at your modular approach... :)
So any hints are very appreciated!

And on a side-note, I plan to put this into my shop-system I wrote some time ago. Actually I came up with some ideas how to improve this system.
Do you have any objections, if I integrate this into a download/release of this shop software? It's all GPL and non-profit. I haven't begun work on the integration yet, I'm just planning to and thought it would be the polite thing to do - to ask you creator(s) if it's ok.

You can find my site in my profile. --------->

Thanks again!
chris

James Heinrich
getID3() v1 developer
Posts: 1430
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: bare minimum installation mp3/ogg

Post by James Heinrich » Thu Oct 01, 2015 1:53 pm

You can delete any unused modules to save space, but they won't affect processing time either way. Modules are not loaded unless they're needed.
If you delete the module.tag.*.php files you will end up with no tag data at all, which is not what you're looking for I think.

getID3 provides for some speed improvement by not processing the tags (see public settings in getID3 object), but that sounds like the inverse of what you want to do.

You could potentially instantiate your own getid3_id3v2 object (and/or getid3_id3v1 and/or getid3_lyrics3) after analyzing the file to see what tags are in the file... but then you'd be more or less at what getID3 is doing. You could potentially save the analysis time of the audio portion of the file at the expense of writing a bunch of your own code.

getID3 does return a lot of information, but in many cases the information you don't want is a byproduct of the same work that would be required to find the information you do want. In MP3 files the tags are completely separate from the audio data, in Ogg files they're an integral part of the file.

getID3 is GPL so should be compatible with whatever GPL project you want to put it in.

chris_blues
User
Posts: 8
Joined: Wed Sep 30, 2015 12:15 am
Are you a spambot?: no
Contact:

Re: bare minimum installation mp3/ogg

Post by chris_blues » Sat Oct 03, 2015 12:44 pm

Thanks James!

I should have known, that if there is a modular system at work, then it might be modular! (In the sense, that the modules get loaded only when needed.) Sorry.

So, I'll go ahead and include this awesome piece of code into my application.

Thanks for your explanations!

Best regards!
chris

chris_blues
User
Posts: 8
Joined: Wed Sep 30, 2015 12:15 am
Are you a spambot?: no
Contact:

Re: bare minimum installation mp3/ogg

Post by chris_blues » Mon Oct 05, 2015 2:56 pm

One more thing:

Is reading an mp3 faster than reading an ogg? Or the other way around?

James Heinrich
getID3() v1 developer
Posts: 1430
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: bare minimum installation mp3/ogg

Post by James Heinrich » Mon Oct 05, 2015 3:03 pm

That probably depends on the file.
A "clean" MP3 with no tags and a header frame (added by some encoders showing average bitrate and similar data) would probably parse faster than most Ogg files.
On the other hand, it's entirely possible to have large amounts of metadata in an ID3v2 tag, and an ID3v1 tag, and an APE tag, and a Lyrics3 tag, and have some corruption in the audio portion that getID3 has to work around, and parsing that would take longer than your average Ogg file.
Of course, in either case we're talking differences in the order 0.1s or so, but if you're scanning thousands of file I suppose it could make a difference.

Best answer: experiment and see using your hardware and selection of files.

chris_blues
User
Posts: 8
Joined: Wed Sep 30, 2015 12:15 am
Are you a spambot?: no
Contact:

Re: bare minimum installation mp3/ogg

Post by chris_blues » Mon Oct 05, 2015 3:12 pm

Ok, thanks, I'll do that! :)

chris_blues
User
Posts: 8
Joined: Wed Sep 30, 2015 12:15 am
Are you a spambot?: no
Contact:

Re: bare minimum installation mp3/ogg

Post by chris_blues » Sun Oct 11, 2015 11:55 pm

For your information:

I released a first alpha of my web-player, which includes getID3(). Take look at the player in action here: https://musicchris.de/index.php?page=media

The download is here: https://musicchris.de/download/cbplayer.tar.gz

...turns out, getID3() is the fastest component. (I left it as is.) The slowest is, of course is the net. Takes forever to load large amounts of data.
Just to let you know, where else your baby gets to work... :o)

Thanks!
chris

James Heinrich
getID3() v1 developer
Posts: 1430
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: bare minimum installation mp3/ogg

Post by James Heinrich » Mon Oct 12, 2015 1:09 am

You can cross-post that in this forum if you like:
viewforum.php?f=10

Post Reply