Could anybody help me with the php code for FFMPEG to concatenate two mp4 videos and store the concatenated files as an mp4 at any folder in the server?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
For the FFMPEG part see here: Concatenate two mp4 files using ffmpeg
For the PHP part, you can invoke any command using: http://php.net/function.exec
I not succeed with mp4 videos, but i succeed using two webm videos. I worked with Windows 8.1.
What I did? Steps:
Install local webserver, such as, XAMPP or EasyPHP: I used EasyPHP DevServer 14.1 VC11. Available: http://www.easyphp.org/easyphp-devserver.php
Go to folder "path\EasyPHP-DevServer-14.1VC11\data\localweb" and create new folder, e.g. FFMPEG_PHP
Download FFMPEG for Windows: download 32-bit Downloads or 64-bit Downloads version Static. I used "Download FFMPEG git-013498b" 32-bit Static. Available: http://ffmpeg.zeranoe.com/builds/
Copy file "ffmpeg.exe" to folder "FFMPEG_PHP"
Store 2 or more webm videos in folder "FFMPEG_PHP". I download videos from youtube. See 1:48 minute this video how download videos from youtube:
www.youtube.com/watch?v=FZJqdwfxSWU.
Create "joinVideos.php" in "FFMPEG_PHP"
See code I did in "join Videos.php" below:
IMPORTANT: when you run first time "joinVideos.php", you MUST comment line "unlink($videoFinal);//remove previous $videoFinal".