Closed ffatgit closed 6 years ago
Thanks. The problem would happen only on VBR MP3 files with no VBR header, where getID3 had to scan through the entire file to build an accurate VBR bitrate. When it got to the end of the file it reported a false error. Fixed in https://github.com/JamesHeinrich/getID3/commit/8553baf78653075a9b34687fa732a95399fd2f57
Hello James; thank you very much for the fast fixing. Is it right, that I only have to copy in minimum the file getid3.php to my instance in the folder getid3?
Greetings Frank
getid3.php is the basic framework. You will almost certainly need getid3.lib.php for everything, and then you will also need the module(s) for the file format(s) you want to analyze. If you're examining MP3 files then you must have module.audio.mp3.php, but you really should also have all the tag modules (module.tag.id3v2.php, module.tag.id3v1.php, module.tag.apetag.php, module.tag.lyrics3.php) because those can appear on MP3 files and if they're not properly parsed first then you may get incorrect results on the MP3 audio portion.
Hello James, first of all big thank you for your excellent work (I use it in my O!MPD)!
I still have a problem with this issue: when I use your demo.browse.php
to read tags from file attached by ffatgit, everything is now OK: there is no info about errors. But when I use this simple code:
<?php
require_once('getid3/getid3/getid3.php');
$getID3 = new getID3;
$getID3->encoding = 'UTF-8';
$getID3->encoding_id3v1 = 'ISO-8859-1';
$getID3->option_tag_id3v1 = false;
$getID3->option_tag_id3v2 = true;
$getID3->option_tag_lyrics3 = false;
$getID3->option_tag_apetag = true;
$getID3->option_tags_process = true;
$getID3->option_tags_html = false;
$getID3->option_extra_info = true;
$getID3->option_save_attachment = true;
$getID3->option_md5_data = false;
$getID3->option_md5_data_source = false;
$getID3->option_sha1_data = false;
$getID3->option_max_2gb_check = null;
$file_d = '/mnt/media/nas/_DSD/tw/corr.mp3';
$ThisFileInfo = $getID3->analyze($file_d);
getid3_lib::CopyTagsToComments($ThisFileInfo);
if (!empty($ThisFileInfo['error'])) {
echo implode("<br>", $ThisFileInfo['error']);
}
?>
where corr.mp3
is ffatgit's file, error is still reported:
Invalid MPEG audio header (54 41 47 41 ) at offset 11151064
Could you give me please some hints, what I'm doing wrong? Many thanks.
This is probably your problem:
$getID3->option_tag_id3v1 = false;
$getID3->option_tag_lyrics3 = false;
If tags at the end of the file (usually ID3v1, sometimes APE, rarely Lyrics3) aren't stripped off the end of the file then they will appear as appended invalid audio data (which, technically, they are, we just understand certain tags can be there by convention). Even if you don't actually need the ID3v1/APE/Lyrics3 data you should let getID3 check for it.
Thank you for very fast answer - that did a trick for that file. I changed default settings in my project as you suggested and updated whole my music library. Unfortunately update stopped on following file:
01. Annie Lennox - Why.mp3.zip
Unfortunately it is also not possible to read tags from this file using demo.browse.php
. When I change $getID3->option_tag_id3v1
back to false
my program properly reads tags from this file.
Would you help, please?
Sorry, I don't see any problem with your sample file. It seems to be a standard CBR320 MP3 file with ID3v1 and ID3v2 (with attached cover art). No errors are reported in demo.browse.php What problem are you having?
Thanks - your answer suggested me something: I tried this on another server and there were no problem with reading tags from my file. So apparently my main server (based on LEDE) is missing something - probably a php-mod. Do you have a list of required php modules?
getID3 has low PHP requirements, it's more likely you're missing the module.tag.id3v1.php from your one server installation.
Unfortunately it's not the problem - I have this module. I took a look into it, did some tests and found the problem. It lies in iconv
function in ID3v1 encoding detection hack. Every time I try to execute iconv('KOI8-R', 'KOI8-R','test')
or iconv('Windows-1251', 'Windows-1251','test')
script stops to execute: in browser Bad Gateway The process did not produce any response
is displayed and in php_errors.log
following line appears:
PHP Notice: iconv(): Unknown error (0)
It's surely something wrong with my installation.
But then I started to wonder why, in spite of having mb_convert_encoding
up and running, program keeps to execute part with iconv
? My idea is that $value
in general doesn't have to be a string type, while returned values from incov
and mb_convert_encoding
functions are the strings. So I changed ===
to ==
in lines 73 and 76 and it started to work. Am I on right path?
You could try removing the "@" error-suppression on the mb_convert_encoding and iconv functions and see if PHP gives any useful error messages?
I did my tests without @
and with the following options:
error_reporting(E_ALL);
@ini_set('display_errors', -1);
That gave me PHP Notice: iconv(): Unknown error (0)
in log. Additionally I found the following in dmesg
:
php-cgi[29600]: segfault at 8fa33d69 ip b740532f sp bf9674e0 error 4 in iconv.so[b7400000+8000]
This happens only on my router:
When I move to other machines (QNAP NAS; RasPi3) everything is OK. So it's look like it's a problem with iconv library on LEDE. Unfortunately no newer version of this lib is available for my installation. Finally I decided to move my http server to RasPi - now it works flawless.
Thank you for your time and help.
我在上传文件到 我的springbooot idea编译 target
包下面,我使用
System.out.println(AudioUtil.getMp3Duration("/media/tina/Hitachi/springboot/tina-im/target/classes/static/1.mp3"));
报以下错误,本身有文件的
org.jaudiotagger.audio.exceptions.InvalidAudioFrameException: No audio header found within1610520063991.mp3
at org.jaudiotagger.audio.mp3.MP3AudioHeader.
@xiao-ma-nong this is PHP GetID3 library, not Java. So we have no idea what is wrong in your log.
哦哦,抱歉
------------------ 原始邮件 ------------------ 发件人: "Pavel Starosek"<notifications@github.com>; 发送时间: 2021年1月13日(星期三) 下午3:11 收件人: "JamesHeinrich/getID3"<getID3@noreply.github.com>; 抄送: "╰早《…》應該♀放手╯"<3121831267@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [JamesHeinrich/getID3] [Issue] "invalid mpeg audio header" in each file (#163)
@ xiao-ma-nong这是PHP GetID3库,而不是Java。因此,我们不知道您的日志中有什么问题。
— 您收到此邮件是因为有人提到您。 直接回复此电子邮件,在GitHub上查看,或取消订阅。
Hello James, I have an issue in the software o!mpd, that uses your great piece of software. In my test files (ripped with Rhythmbox V3.3 on a 64 Bit Ubuntu 16.04 LTS os) there is found a "invalid mpeg audio header" in each file. After reporting this issue a feedback from the developer of o!mpd says, that is probaly an issue in getID3. So please could you check the example file in co-working with getID3. Is there an issue in the software OR (what is the next possible reason to the situation:) is ther something "wrong" with my files (ID3 tagging).
Screenshot:
Zipped-Sample track in format MP3: Tremonti (2018) - A Dying Machine - 11. As The Silence Becomes Me.zip
please check out the original post of the issue in the o!mpd Github repo. https://github.com/ArturSierzant/OMPD/issues/68
Thank you very much! Frank