Hi,
First of all, thank you for getid3 !
Is it possible with getid3 to compute the checksum of a file, ignoring id3/APE informations ? My need is to generate such a checksum to check duplicate files with same audio information but with id3 tags wich are different.
I'd like a very fast algorithm... Is it possible for exemple to obtain very quickly all the positions of the audio frames of the file ? If we have this information, we could easyly get a checksum (md5 or other) of these part.
I found the linux shell cmd "avconv" wich can make something similar (give a CRC of audio frames) :
avconv -i MP3FILE -f crc - 2>/dev/null
But it is not very fast...
Can getid3 be used to compute a checksum of "audio part"
-
- User
- Posts:11
- Joined:Wed Jun 08, 2016 6:20 pm
- Are you a spambot?:no
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
Re: Can getid3 be used to compute a checksum of "audio part"
Yes, for most formats the MD5 and/or SHA1 can be calculated automatically, if you enable the appropriate option on your getID3 object:
https://github.com/JamesHeinrich/getID3 ... hp#L96-L98
for example:
It's not "very" fast, but since that's a subjective description you can try it for yourself and decide.
https://github.com/JamesHeinrich/getID3 ... hp#L96-L98
for example:
Code: Select all
$getid3 = new getID3();
$getid3->option_md5_data = true;
$info = $getid3->analyze($filename);
echo 'MD5: '.$info['md5_data'];
-
- User
- Posts:11
- Joined:Wed Jun 08, 2016 6:20 pm
- Are you a spambot?:no
Re: Can getid3 be used to compute a checksum of "audio part"
So great !!!!!
This is realy faster, and it work as expected. Just beautifull !
For the same mp3 file (10 Mo) the "time" unix command gives :
- an average of 0.7s with avconv
- an average of 0.1s with getid3
So it is 7 times faster ! Thank you so much :)
This is realy faster, and it work as expected. Just beautifull !
For the same mp3 file (10 Mo) the "time" unix command gives :
- an average of 0.7s with avconv
- an average of 0.1s with getid3
So it is 7 times faster ! Thank you so much :)