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
0
votes
0 answers

can any one help me i want to create a gif from YouTube URL in PHP by using FFMPEG

I want made a gif from YouTube URL in PHP by using FFMPEG I want execute shell command $regex_pattern = "/(youtube.com|youtu.be)\/(watch)?(\?v=)?(\S+)?/"; $match; if(preg_match($regex_pattern, $old_src, $match)) { $vidID = $match[4]; …
qasim
  • 1
0
votes
1 answer

PHP popen() or proc_open() to store/set pid so I can shut down the process in windows I started

I am trying to use proc_open to open an instance of ffmpeg. It works with popen without the title but I can't set the title as it needs another line or something I tried popen("title $title \r start /min ffmpeg -loglevel quiet -re -i…
0
votes
1 answer

ffmpeg combine 3 filter_complex commands

Can anyone help me. I want to combine 3 ffmpeg commands: 1: ffmpeg -y -i input.mp4 -vf scale=720:-2,setsar=1:1 -c:v libx264 -preset ultrafast -c:a copy out1.mp4 2: ffmpeg -i out1.mp4 -filter_complex…
Ahvan
  • 33
  • 5
0
votes
1 answer

Insert Random silence multiple times between Audios in ffmpeg

suppose I have MP3 of around 1 minute duration and increase its duration longer.Duration can be any. I want to randomly add N seconds of silence to that audio. I can generate the silence like below ffmpeg -f lavfi -i anullsrc=r=44100:cl=mono -t…
Gracie williams
  • 1,287
  • 2
  • 16
  • 39
0
votes
1 answer

PHP-FFMPEG Encoding error - How to use -stric experimental?

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 =…
0
votes
1 answer

FFMPEG question - FFMPEG no convert to the same extension

I have a question how can I do if the file has the same extension in case it is gif to gif. ffmpeg no convert to the same extension. Make ffmpeg just ignore the file? I'm currently using -ss 5 -i filename.gif -t 10 -pix_fmt rgb24 filename.gif 2> & 1…
uEHT0
  • 23
  • 4
0
votes
0 answers

FFMPEG video output size is too long

I am trying to merge videos in FFmpeg reading through a .txt file, it merges the videos but increases the total timeline. Expected timeline is 2 minutes but after merging the videos the output file has a timeline of 18 hours.I am using the following…
0
votes
2 answers

How to add multiple audio to a video at specific time for specific duration

I have a video.mp4 file of 20 seconds without audio stream, and I have 2 audio files audio1.mp3 and audio2.mp3. What I want is audio1 should start playe at 3 seconds for 5 seconds, and audio 2 should start play at 10 seconds for 6 seconds. ffmpeg -y…
Javed Saifi
  • 71
  • 1
  • 15
0
votes
1 answer

ffmpeg aloop filter not working correctlly

I am trying to run FFmpeg Command as follow -i "v1.mov" -i "0.mp3" -filter_complex…
0
votes
1 answer

How to return generated command string only when using PHP-FFMpeg libarary

How can I see which command string generated for below example code $advancedMedia = $ffmpeg->openAdvanced(array('video_1.mp4', 'video_2.mp4')); $advancedMedia->filters() ->custom('[0:v][1:v]', 'hstack', '[v]'); $advancedMedia …
AZinkey
  • 5,209
  • 5
  • 28
  • 46
0
votes
1 answer

How to set pad with PHP-FFMpeg?

I use PHP-FFMpeg library (https://github.com/PHP-FFMpeg/PHP-FFMpeg) and try to do this: ffmpeg -i input.mp4 -vf "crop=960:1080, scale=960:1080,pad=w=960+iw:h=ih:x=960:y=0" output.mp4 I have a video with dimensions 1920x1080. In php I do…
DenVebber
  • 153
  • 3
  • 11
0
votes
0 answers

How to increase ffmpeg add watermark speed in php-ffmpeg?

I am trying to add watermark in videos of 15-35 seconds duration with 8-10 MB size. The process is taking more than expected time ranging from 30-40 seconds. Here is my code : $ffmpeg = FFMpeg\FFMpeg::create(array( 'ffmpeg.binaries' …
Wewillgrow
  • 31
  • 8
0
votes
0 answers

FFmpeg-php installation on cpanel server with CentOS7

I installed ffmpeg via below commands but unable to install FFmpeg-php on cpanel server with CentOS7. Checked articles and found very old version. Please anyone can assist with new FFmpeg-php version and installation steps. rpm --import…
Mel
  • 1
0
votes
1 answer

Concatenate mkv files keeping original timestmap with gaps

16 days ago I had this problem: Concatenating mka files but keeping timestamp which I fixed by using amix, a delay by using start_pts from ffprobe. Today I have a new challenge like this, but with video. So I have a bunch of mkv videos. Each time a…
Filip
  • 346
  • 1
  • 4
  • 15
0
votes
0 answers

How to concat two videos of different format with stretching the videos

I want to concat two videos together but in doing so, the second video is being stretched. Here is my code $command = "ffmpeg -i ../unprocessed/{$temp_name} -vf…
Xnox
  • 1