From a given file (eg test.mp4) I want to create a new file with exact same properties (eg video rate, resolution etc) with the only difference to be the duration. eg 10 minutes while the original can be 2 hours.
This will helps me to create preview video files.
PS1: This conversion should be done within a PHP file, so I'll appreciate the code to be in PHP. PS2: For testing purposes the original file should be at /home/user/original and the new file must be at /home/user/demo
Thank you
The Linux command to do it is:
ffmpeg -ss 00:00:01 -i Demo.mp4 -to 00:05:00 -c copy NewDemo.mp4
To execute this command from within a PHP file, the syntax is:
shell_exec('/usr/local/bin/ffmpeg -ss 00:00:01 -i /origin_folder/myvideo.mp4 -to 00:15:00 -c copy /destination_folder/mynewvideo.mp4 >/dev/null 2>/dev/null &');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.