Php-ffmpeg: QUESTION: exporting single video from multiple videos

Created on 11 Oct 2016  路  4Comments  路  Source: PHP-FFMpeg/PHP-FFMpeg

Hi, Is it possible to create a single video file from multiple videos? For example, I have vid1.mp4 and vid2.mp4, then put them together side by side, and export it as a single video. So when I play the exported video file it would show vid1 on the left and vid2 on the right.

Feature question

Most helpful comment

Hi @theDTD,
As far as I know, FFMPEG allows concatenation, but this feature is not implemented in this library (or I haven't seen it).
I think this may be a feature request. With regards to your description, I think that the concat protocol is the one appropriated to what you want to do, but in order to get library persistent with what FFMPEG offers, I think we should implement both.
I'll work on a Pull Request if I have some time.

All 4 comments

Hi @theDTD,
As far as I know, FFMPEG allows concatenation, but this feature is not implemented in this library (or I haven't seen it).
I think this may be a feature request. With regards to your description, I think that the concat protocol is the one appropriated to what you want to do, but in order to get library persistent with what FFMPEG offers, I think we should implement both.
I'll work on a Pull Request if I have some time.

I re-read your feature request.
This is slightly different from concatenation since you want to read both videos at the same time.
I'm not sure how to do it. Do you have any idea on how to do it through the command line?

Hello, you can actually do it with overlay filter based from this command line example from https://ffmpeg.org/ffmpeg-filters.html#Examples-68

ffmpeg -i left.avi -i right.avi -filter_complex " nullsrc=size=200x100 [background]; [0:v] setpts=PTS-STARTPTS, scale=100x100 [left]; [1:v] setpts=PTS-STARTPTS, scale=100x100 [right]; [background][left] overlay=shortest=1 [background+left]; [background+left][right] overlay=shortest=1:x=100 [left+right]

Though, I am not using php now. I will just share this here :)

Thanks @theDTD.
I will try to look at it. I'm currently working on the concatenation feature. This will come afterwards.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iki789 picture iki789  路  7Comments

sheikhasadmuneer picture sheikhasadmuneer  路  4Comments

mdolnik picture mdolnik  路  4Comments

totomtornado picture totomtornado  路  6Comments

mhf-ir picture mhf-ir  路  5Comments