Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in detect file type (open method) #899

Open
mostafa-norouzi opened this issue Apr 18, 2023 · 0 comments
Open

Bug in detect file type (open method) #899

mostafa-norouzi opened this issue Apr 18, 2023 · 0 comments

Comments

@mostafa-norouzi
Copy link

I noticed that for some Mp3 files, PHP-FFMpeg detect them as video format and if you want to cut part of that :

$audio = $ffmpeg->open( $file );
$audio->filters()->clip($start,$length );
$format = new \FFMpeg\Format\Audio\Mp3();
$audio->save($format,$target);

Below error raised :

Fatal error: Uncaught TypeError: FFMpeg\Filters\Video\ClipFilter::apply(): Argument #2 ($format) must be of type FFMpeg\Format\VideoInterface, FFMpeg\Format\Audio\Mp3 given, called in D:\wamp330\www\demo\PHP-FFMPEG\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Media\AbstractVideo.php on line 168 and defined in D:\wamp330\www\demo\PHP-FFMPEG\vendor\php-ffmpeg\php-ffmpeg\src\FFMpeg\Filters\Video\ClipFilter.php on line 61

So I think that it would be better if we can pass file type manually to [open] method and force class that act as audio file:

public function open($pathfile,$type="audio")
    { 

With the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant