mp3 not loading

Locked
worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 3:03 am

Hi

we have a problem hope we can get an answer to it.

we using mp3 on our pages sometimes.
we have changed server than all the sudden the mp3 stoped working.
after few tests we have found that file sizes such as 600kb works fine but larger files “5 or 20 mb ” not loading.

there is no errors not so ever.

the mp3 feature was working fine in the old server.
is there specific configurations that we need to check in the new server?

the mp3 feature uses the getID3()

regards

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 12:12 pm

worldobservers wrote:there is no errors not so ever.
Please describe what output getID3->analyze does give you. Run this and tell me what the output is:

Code: Select all

require_once('getid3.php');
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($filename);
echo '<pre>'.htmlentities(print_r($ThisFileInfo, true)).'</pre>';

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 12:45 pm

Hi

where i should insert this code?

regards

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 12:49 pm

Nowhere, just create a small test file, call it whatever you want. This is just to test what errors getID3 is reporting.

Of course you'll have you point the require_once to the correct path to getid3.php, and make sure that $filename points to an MP3 file on your server.


Maybe you can also post the code that you're currently using to call getID3?

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 12:58 pm

Hi

pls see attached if this is the one.

regards
Attachments
podcast.modifier.php
(1.33 KiB) Downloaded 394 times

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 1:05 pm

Sure, you can add some debugging output in that file, between the last two lines of get_fileduration:

Code: Select all

        $ThisFileInfo = $getID3->analyze(VIVVO_FS_ROOT . VIVVO_FS_FILES_DIR . $attachment->real_path);

// debugging output:
echo '<pre>'.htmlentities(print_r($ThisFileInfo, true)).'</pre>';

        return round($ThisFileInfo['playtime_seconds']);
This will make some ugly on your site, so do this in a test environment if possible, or if you're working on the live site then comment it out as soon as you've copied some sample output.

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 1:07 pm

If you want a more precise error output that's less ugly, use this instead:

Code: Select all

// debugging output
if (!empty($ThisFileInfo['error'])) {
  echo '<hr>getID3 errors:<pre>'.htmlentities(print_r($ThisFileInfo['error'], true)).'</pre><hr>';
}
if (!empty($ThisFileInfo['warning'])) {
  echo '<hr>getID3 warnings:<pre>'.htmlentities(print_r($ThisFileInfo['warning'], true)).'</pre><hr>';
}

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 2:07 pm

Hi

i did not check as yet because the server is down

could u pls see if ur code placed correctly in attached?

regards
Attachments
podcast.modifier.php
(1.42 KiB) Downloaded 393 times

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 2:23 pm

worldobservers wrote:could u pls see if ur code placed correctly in attached?
That's correct.

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 2:40 pm

Hi
i have tested.

no error messages at all.

regards

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 2:59 pm

Hi

when i open the page containing the small mp3 i got this error message above the header but the mp3 is playing

Code: Select all

Array
(
    [GETID3_VERSION] => 1.7.9-20090308
    [filesize] => 675840
    [avdataoffset] => 0
    [avdataend] => 675840
    [fileformat] => mp3
    [audio] => Array
        (
            [dataformat] => mp3
            [channels] => 2
            [sample_rate] => 44100
            [bitrate] => 128000
            [channelmode] => stereo
            [bitrate_mode] => cbr
            [lossless] => 
            [encoder_options] => CBR128
            [compression_ratio] => 0.0907029478458
            [streams] => Array
                (
                    [0] => Array
                        (
                            [dataformat] => mp3
                            [channels] => 2
                            [sample_rate] => 44100
                            [bitrate] => 128000
                            [channelmode] => stereo
                            [bitrate_mode] => cbr
                            [lossless] => 
                            [encoder_options] => CBR128
                            [compression_ratio] => 0.0907029478458
                        )

                )

        )

    [encoding] => ISO-8859-1
    [filename] => www.mp3
    [filepath] => /home/alankabo/public_html/files/media/mp3/miscellaneous
    [filenamepath] => /home/alankabo/public_html/files/media/mp3/miscellaneous/www.mp3
    [mime_type] => audio/mpeg
    [mpeg] => Array
        (
            [audio] => Array
                (
                    [raw] => Array
                        (
                            [synch] => 4094
                            [version] => 3
                            [layer] => 1
                            [protection] => 1
                            [bitrate] => 9
                            [sample_rate] => 0
                            [padding] => 0
                            [private] => 0
                            [channelmode] => 1
                            [modeextension] => 2
                            [copyright] => 0
                            [original] => 1
                            [emphasis] => 0
                        )

                    [version] => 1
                    [layer] => 3
                    [channelmode] => joint stereo
                    [channels] => 2
                    [sample_rate] => 44100
                    [protection] => 
                    [private] => 
                    [modeextension] => MS
                    [copyright] => 
                    [original] => 1
                    [emphasis] => none
                    [padding] => 
                    [bitrate] => 128000
                    [framelength] => 417
                    [bitrate_mode] => cbr
                )

        )

    [playtime_seconds] => 42.24
    [bitrate] => 128000
    [playtime_string] => 0:42
)
on page where the large mp3 file there is no error message no nothing

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 3:45 pm

worldobservers wrote:[GETID3_VERSION] => 1.7.9-20090308
For starters, please upgrade to getID3 v1.9.5 -- the copy you're running is 4 years old.
worldobservers wrote:on page where the large mp3 file there is no error message no nothing
Nothing as a blank page? In that case it sounds like an error elsewhere in your code, before it gets to getID3. Turn on PHP error reporting and/or check your PHP error logs. You could also put a debugging line as the very first line of get_fileduration

Code: Select all

echo 'starting get_fileduration() in '.__FILE__.' on line '.__LINE__.'<br>';
That will confirm whether the code is getting to that function or not, whether the problem happens before getID3 is called or after.

But please(!), upgrade to the latest version of getID3 first before I go chasing bugs that have been fixed for years :)

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 9:44 pm

Hi

i did upgrades

pls see attached if the last code u have send placed in the right position

also the test page (very small mp3 file):
http://www.alankabout.com/australian_news/24444.html

here u go after inserting the last code u have send me:

Code: Select all

starting get_fileduration() in /home/alankabo/public_html/modifiers/podcast.modifier.php on line 28

Array
(
    [GETID3_VERSION] => 1.9.5-20130220
    [filesize] => 675840
    [filename] => www.mp3
    [filepath] => /home/alankabo/public_html/files/media/mp3/miscellaneous
    [filenamepath] => /home/alankabo/public_html/files/media/mp3/miscellaneous/www.mp3
    [avdataoffset] => 0
    [avdataend] => 675840
    [fileformat] => mp3
    [audio] => Array
        (
            [dataformat] => mp3
            [channels] => 2
            [sample_rate] => 44100
            [bitrate] => 128000
            [channelmode] => joint stereo
            [bitrate_mode] => cbr
            [lossless] => 
            [encoder_options] => CBR128
            [compression_ratio] => 0.0907029478458
            [streams] => Array
                (
                    [0] => Array
                        (
                            [dataformat] => mp3
                            [channels] => 2
                            [sample_rate] => 44100
                            [bitrate] => 128000
                            [channelmode] => joint stereo
                            [bitrate_mode] => cbr
                            [lossless] => 
                            [encoder_options] => CBR128
                            [compression_ratio] => 0.0907029478458
                        )

                )

        )

    [encoding] => UTF-8
    [mime_type] => audio/mpeg
    [mpeg] => Array
        (
            [audio] => Array
                (
                    [raw] => Array
                        (
                            [synch] => 4094
                            [version] => 3
                            [layer] => 1
                            [protection] => 1
                            [bitrate] => 9
                            [sample_rate] => 0
                            [padding] => 0
                            [private] => 0
                            [channelmode] => 1
                            [modeextension] => 2
                            [copyright] => 0
                            [original] => 1
                            [emphasis] => 0
                        )

                    [version] => 1
                    [layer] => 3
                    [channelmode] => joint stereo
                    [channels] => 2
                    [sample_rate] => 44100
                    [protection] => 
                    [private] => 
                    [modeextension] => MS
                    [copyright] => 
                    [original] => 1
                    [emphasis] => none
                    [padding] => 
                    [bitrate] => 128000
                    [framelength] => 417
                    [bitrate_mode] => cbr
                )

        )

    [playtime_seconds] => 42.24
    [bitrate] => 128000
    [playtime_string] => 0:42
)
Attachments
podcast.modifier.php
(1.5 KiB) Downloaded 393 times

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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 9:48 pm

That's good, that's a start. But we already know the small MP3 file works... what do you get with a larger MP3 file?

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Tue Mar 12, 2013 9:57 pm


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

Re: mp3 not loading

Post by James Heinrich » Tue Mar 12, 2013 11:34 pm

The sample you linked to is of a 56MB MP3 file. The page loads fine, but doesn't have any of the player controls that the smaller file does, but doesn't fail to load, and yet doesn't output the "starting get_fileduration()" debug message. This tells me that somewhere higher in your code, before the part that calls the get_fileduration function, there's something checking for maximum filesize (or possibly trying, and failing, to read the file contents into memory, for example) and so the get_fileduration function is never called. In that case it's a coding issue on your site and not related to getID3.

For what it's worth, the 56MB file analyzed just fine in getID3. Your problem is elsewhere in your code.

worldobservers
User
Posts: 9
Joined: Tue Mar 12, 2013 2:56 am
Are you a spambot?: no

Re: mp3 not loading

Post by worldobservers » Wed Mar 13, 2013 4:05 am

Hi
we have installed a fresh copy into test site.
also the same.
the code been used by others no problems.
don't u thing may be some miss configurations in the server perhaps?
if possible where we should check in the server?
regards

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

Re: mp3 not loading

Post by James Heinrich » Wed Mar 13, 2013 12:43 pm

You could check a few settings in php.ini

For example:
* memory_limit
* post_max_size
* upload_max_filesize
Although really none of those should have the effect that you're describing.

You need to investigate the part of your code that generates the mp3-playing control, since it's deciding somewhere in there NOT to generate the player, and getID3 doesn't get involved until get_fileduration is called, so look a little before there in your code.

Locked