Git Product home page Git Product logo

mediafile's Issues

Fatal Error during reading .wav file.

Here is issue text : "fread(): Argument #2 ($length) must be greater than 0";
It happens in analyzeMetadata function inside "if ($size >= 20)";
It happens for some .wav files. And i'm using actual .wav files.
I tried to convert my .wav file to .wav again using random online converter and this issue gone. I have been using this library for 2 years and have never got this issue (processed huge amount of files). And recently i started getting this issue again and again.
Can you suggest what should i do in this situation?

MP3 file generates exception

Hello!
I have an MP3 file which is generating an Unknown format for file "/tmp/phpaa3d76"! exception, but works ok in other players and macOS recognizes it without any problem.
I later tried to fix it using using this tool and now it work just fine.

In the archive I'm sharing bot MP3s, the original and the fixed one: Archive.zip

Maybe this can be handled in the library and the exception avoided.

Can't read a video/mov file

When trying to open this file, I get

In MediaFile.php line 42:

  File "C:\Users\tacma\OneDrive\Pictures\JUFJ\Amanda\amanda--1.MOV" is not a supported video/audio, it's "video/mov"!

fail on getLength for some ogg

(MediaFile::open(...))
            ->getAudio()
            ->getLength();

fread() expects parameter 2 to be int, string given in wapmorgan/binary-stream/src/BinaryStream.php because segments_count === ''.

4e721b43.ogg.zip

Division by zero for files

Hello,

first I would like to thank you for this awesome project. Unfortunately with some of my files I get a Division by zero error, that is not catchable...

It happens with multiple mp3 files, which i cannot provide publicly due to copyright but I think you should in any case fix the possible division by zero. If you really need the files, feel free to contact me again, I'll try to provide you a sample.

Heres a trace:

... Division by zero (Code: 2) ...wapmorgan/mp3info/src/Mp3Info.php, line 384
#0 ...wapmorgan/mp3info/src/Mp3Info.php(384): {closure}(2, 'Division by zer...', '...', 384, Array)
#1 ...wapmorgan/mp3info/src/Mp3Info.php(279): wapmorgan\Mp3Info\Mp3Info->readMpegFrame(Resource id #24)
#2 ...wapmorgan/mp3info/src/Mp3Info.php(224): wapmorgan\Mp3Info\Mp3Info->parseAudio(Object(SplFileInfo), 8449196, 1)
#3 ...wapmorgan/media-file/src/Adapters/Mp3Adapter.php(15): wapmorgan\Mp3Info\Mp3Info->__construct(Object(SplFileInfo))
#4 ...wapmorgan/media-file/src/MediaFile.php(66): wapmorgan\MediaFile\Adapters\Mp3Adapter->__construct(Object(SplFileInfo))
#5 ...wapmorgan/media-file/src/MediaFile.php(44): wapmorgan\MediaFile\MediaFile->__construct(Object(SplFileInfo), 'audio', 'mp3')
#6 ...: wapmorgan\MediaFile\MediaFile::open(Object(SplFileInfo))
#7 {main}

I think that the $this->sampleRate variable is not set correctly. Since it is not possible to catch this error under normal circumstances, I wrote a little script to, that's why it is a trace and not a fatal error output:

$path = 'path/to/mp3/files';

$directory = new \RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS | FilesystemIterator::CURRENT_AS_FILEINFO);
$files = new \RecursiveIteratorIterator($directory);

set_error_handler(function ($errorCode, $errorMessage, $file, $line) {
    if (!(error_reporting() & $errorCode)) {
        return false;
    }
    throw new Exception(sprintf('%s (Code: %s) in %s, line %s', $errorMessage,$errorCode, $file, $line));
});

foreach ($files as $file) {
    if ($file->getExtension() !== "mp3") {
        continue;
    }
    try {
        $mediaFile = MediaFile::open($file);
    } catch (Throwable $t) {
        echo $file . PHP_EOL;
        echo " ===> exception: " . $t->getMessage() . PHP_EOL;
        echo $t->getTraceAsString().PHP_EOL;
    }
}
restore_error_handler();

Error When Reading MP4 File

Hello,

I am reading an MP4 file, and I am getting this error:

Duration: 612.437
Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/mediametadata/src/Adapters/Mp4Adapter.php on line 14

Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/mediametadata/src/Adapters/Mp4Adapter.php on line 21
Dimensions: x
Warning: Invalid argument supplied for foreach() in /Applications/XAMPP/xamppfiles/htdocs/mediametadata/src/Adapters/Mp4Adapter.php on line 28
Framerate:

Standard GoPro MP4 file fails

Using just the supplied sample code with a simple GoPro MP4 file will output the following:

Duration: 338.304
PHP Warning:  Invalid argument supplied for foreach() in .../vendor/wapmorgan/media-file/src/Adapters/Mp4Adapter.php on line 14
PHP Warning:  Invalid argument supplied for foreach() in .../vendor/wapmorgan/media-file/src/Adapters/Mp4Adapter.php on line 21
Dimensions: x
PHP Warning:  Invalid argument supplied for foreach() in .../wapmorgan/media-file/src/Adapters/Mp4Adapter.php on line 28
Framerate: 

Make wave support optional untill boyhagemann/Wave has a stable release

Currently the boyhagemann/Wave package is blocking the installation of this package unless forced or one changes there policy to accept dev packages.

boyhagemann hasn't responded to the request to do so for nearly a year and there has been no development since 2013.

A way around this would be to make wave support optional and not include the package by default. I for one don't need wave support and I would much rather use this libery then getID3, both for speed and and I have very little trust in there code as it's a big mess.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.