Questions tagged [ffmpeg-php]

Refers to a few similarly named PHP extensions that add functions for accessing and retrieving information about multimedia files. Questions about generally using ffmpeg cli tool through exec() or similar or other libraries should not use this tag!

ffmpeg-php refers to a few similarly named PHP extensions that add functions for accessing and retrieving information about multimedia files:

  • FFmpegPHP: a pure OO PHP port of the legacy ffmpeg-php writer in C.

  • PHP-FFMpeg An Object-Oriented library to convert video/audio files with FFmpeg.

  • ffmpeg-php: The classic, legacy version. This is a very old, long dead project that will not work with any ffmpeg versions officially supported by the FFmpeg project.

Note that these extensions are not part of the FFmpeg project.

You may not need a wrapper/extension/library if you simply want to invoke the ffmpeg binary from your PHP script. Refer to FFmpeg Wiki: PHP for more info.

276 questions
1
vote
0 answers

How can I calculate the audio time by byte position (bytes to secounds)?

I have the audio file and byte range. I want get time for each byte position. I'm use php. I tried to calculate that using this formula: $time = $byte/($bitRate * $sampleRate * $cannels) But it doesn't work. So how can I calculate this? I used…
Aro
  • 1,078
  • 1
  • 7
  • 26
1
vote
0 answers

How to fix EXT-X-MAP:URI in m3u8 when specifying absolute hls_fmp4_init_filename using ffmpeg?

Today I found this blog post teaching me about fragmented mp4s (fmp4s). Using the ffmpeg docs, I've made great progress. I run this: '/usr/bin/ffmpeg' '-y' '-i' '/myproject/storage/app/sample_media/2020-02-27/Sample Videos 5.mp4' \ '-c:v' 'libx264'…
Ryan
  • 22,332
  • 31
  • 176
  • 357
1
vote
0 answers

php-FFMpeg issue when adding watermark

Currently getting the following error whilst trying to add a watermark to videos PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i' 'test.mp4' '-vcodec'…
BN83
  • 902
  • 3
  • 9
  • 29
1
vote
1 answer

php-ffmpeg installation on apache2

Trying to run PHP-FFMPEG and after install via composer I'm currently getting this. PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutableNotFoundException: Executable not found, proposed : avprobe, ffprobe in …
BN83
  • 902
  • 3
  • 9
  • 29
1
vote
1 answer

Reduce video processing time using FFMpeg?

Users of my app upload videos to my server and I process them to create different qualities, thumbnails and gifs etc. Which are then useful for mobile and web apps. It takes almost 15-20 minutes for each video to be processed. I am using ffmpeg. How…
Ali Raza
  • 374
  • 2
  • 6
  • 21
1
vote
0 answers

Unable to load FFMPEG library "java.lang.UnsatisfiedLinkError: dlopen failed:"

I am trying to build and run old ffmpeg project which, it was in eclipse and now i am trying to run it from Android studio, but app crash displaying below error. 2020-01-25 11:57:52.621 26360-26360/org.lance.ffplayer E/AndroidRuntime: FATAL…
Vicky
  • 61
  • 3
1
vote
0 answers

How to open a remote video using PHP-FFMpeg?

I'm trying to create a web application using PHP (Laravel 5.8) where user can past link of any video found on the Internet (like Youtube, Dailymotion ... etc), then cut the video. Cutting the video the video both in front-end and back-end is easy to…
C.Ad
  • 48
  • 4
1
vote
0 answers

PHP-FFMPeg is not processing files on CentOS server

PHP-FFMPeg Version: 0.13.0 FFmpeg Version: N-95710-gb25b643 CentOS 7.7 Actual Behavior We are using PHP-FFMPeg on laravel to process a video file to 720p and 480p. The PHP-FFMPeg is not processing the file or generate a file with 0 bytes. Sometimes…
1
vote
2 answers

I have installed FFMPEG and can't find it inside a PHP script

I have installed FFMPeg in CentOS. It works perfectly. It's inside /usr/bin directory. Also, I have PHP 7.2.24 that comes with Plesk 18.0.20. I want to use FFMPeg inside a PHP script, but that script can't find the executable of FFMpeg. I have tried…
Antop
  • 123
  • 1
  • 1
  • 9
1
vote
1 answer

How to convert audios without installing ffmpeg

I'm using a shared hosting. I need convert mp3 files to ogg files on my host, I asked its admins to install FFMpeg but they didn't do that! Is it possible convert mp3 to ogg/ogg to mp3 on my host by php? If yes please get me code examples or…
realSamy
  • 39
  • 8
1
vote
1 answer

Laravel job runs multiple times when executing long task

I'm currently trying to convert a video into multiple .ts segments (for HTTP video streaming). This is a long task so I'm doing this in a Laravel job. The problem is that the job run multiple times after a few minutes and because of that, the video…
JH.
  • 31
  • 4
1
vote
0 answers

Needs to get rid off green background (to make it transparent) of video

We have a video provided with green background (Chroma Key) and it needs to be transparent. I am new to chroma key and video editing, doesn't know much about this. My requirement is making the video transparent to use it on web page using PHP…
M.Bains
  • 395
  • 1
  • 2
  • 14
1
vote
1 answer

Combining two ffmpeg commands into single command

I want to combine two ffmpeg commands to single ffmpeg command. exec("ffmpeg -i mimic/api/video/1560754087943.mp4 -i logo.png -filter_complex"." overlay=20:20"." topleft.mp4"); exec('ffmpeg -i topleft.mp4 -vf drawtext="fontfile=ARIBLK.ttf:…
1
vote
1 answer

Custom filters in laravel-ffmpeg/ php-ffmpeg?

I wanna create custom command using php-ffmpeg/laravel-ffmpeg? $customFilter = ['-stream_loop 3']; $customFilter1 = ['-c copy']; \FFMpeg::fromDisk($this->data['input_disk']) ->open($this->data['input']) ->addFilter(function ($filters) { …
user11457665
1
vote
0 answers

PHP/FFmpeg can not save video

The error is: [Sun May 19 11:41:03.158185 2019] [php7:error] [pid 32405] [client 85.133.232.4:35172] PHP Fatal error: Uncaught Alchemy\BinaryDriver\Exception\ExecutionFailureException: ffmpeg failed to execute command '/usr/bin/ffmpeg' '-y' '-i'…
Jack The Baker
  • 1,781
  • 1
  • 20
  • 51