PHP-FFMpeg: Encoding failed in local works to mp4

Q A
Bug? probably
New Feature? no
Version Used Last version
FFmpeg Version FFmpeg
OS Linux

I am working with Laravel 5.3 In my localhost works fine When I uploaded to my shared host fails My binaries has +x permissions

Encoding failed in file /php-ffmpeg/src/FFMpeg/Media/Video.php line : 178

In my server, I have my files in my web dir

` $ffmpeg = FFMpeg::create([ ‘ffmpeg.binaries’ => ‘/home3/myuser/public_html/myproject/binvideos/ffmpeg’, ‘ffprobe.binaries’ => ‘/home3/myuser/public_html/myproject/binvideos/ffprobe’, ‘timeout’ => 9800, // The timeout for the underlying process ‘ffmpeg.threads’ => 12 // The number of threads that FFMpeg should use

        ]);

        $videoCodec = $ffmpeg->open(public_path("uploads/targets/$videoName"));
        $format = new X264();
        $format->setAudioCodec('aac','libmp3lame');
        $videoCodec->save($format,$newVideoPath);

`

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (11 by maintainers)

Most upvoted comments

Hey, no problem. We’ll update the implementation and check that this won’t happen ever again. It’s fine. You’d actually found a bug(we should check that).

SOLVED I guess

I already solved just changing this line

$format->setAudioCodec('aac','libmp3lame'); by this one $format->setAudioCodec('libmp3lame');

Can I not add two codecs? or is in array param?

Ok I will try it. Is weird because in my local environment is working. I really appreciate your help. Thanks