0

Im trying to convert a m3u8 file but im getting encoding error.

How do i get the ffmpeg output from the thrown exception to check where is the error? this is the php code.

$ffmpeg = FFMpeg\FFMpeg::create();
            $video = $ffmpeg->open("/home/enrico/clipper/tmp/streamers/Antonio/" . $video_id);
            $format = new FFMpeg\Format\Video\X264();
            $format->setInitialParameters(array('-bsf:a',  'aac_adtstoasc' , '-acodec', 'copy', '-vcodec', 'copy'));
            $video->save($format, "playlista.mp4");
ndm
  • 59,784
  • 9
  • 71
  • 110

1 Answers1

0

I'm not familiar with that library, but from looking at the source, it seems that you can check the previous exception, which apparently in many cases will be an instance of \Alchemy\BinaryDriver\Exception\ExecutionFailureException, which in turn has a getErrorOutput() method that will return the process' error output.

$catchedFfmpegException->getPrevious()->getErrorOutput()

Check the source code to figure what exactly is going on. Dumping the exception object should also give you some insight.

ndm
  • 59,784
  • 9
  • 71
  • 110