Merging Video Files with PHP -
i have 2 mp4 files , want merge them.
$media1 = file_get_contents($_server['document_root'].'/dir/media1.mp4'); $media2 = file_get_contents($_server['document_root'].'/dir/media2.mp4'); file_put_contents($_server['document_root'].'/dir/combined.mp4', $media1.$media2);
media1.mp4 : 1 megabyte, 10 second
media2.mp4 : 2 megabyte, 20 second
combined.mp4 : 3 megabyte 10 second (there media1.mp4)
how can merge these 2 files?
i wish combine encoded video stream $media1.$media2
sadly, you can't that.
fortunately you, php come exec()
function, , using little ffmpeg program let that.
so have do php exec()
ffmpeg , merge there.
good luck !
Comments
Post a Comment