Video conference layout from 2 x video and 2 x audio

Hi all

I’m trying to merge two video files in a horizontal stack, and play the associated audio files in sync. In effect, I want to recreate a Zoom-type video conference layout.

I know how to do this in ffmpeg.

How do I achive the same result using Shotstack?

Are you trying to do something like this:

You can display the videos by using JSON like this, it uses scale and offet to modify the two source videos:

{
    "timeline": {
        "tracks": [
            {
                "clips": [
                    {
                        "asset": {
                            "type": "video",
                            "src": "https://shotstack-assets.s3.ap-southeast-2.amazonaws.com/motion-graphics/countup-1.mp4",
                            "volume": 1
                        },
                        "start": 0,
                        "length": 10,
                        "scale": 0.5,
                        "offset": {
                            "x": -0.25
                        }
                    },
                    {
                        "asset": {
                            "type": "video",
                            "src": "https://shotstack-assets.s3.ap-southeast-2.amazonaws.com/motion-graphics/countup-2.mp4",
                            "volume": 0
                        },
                        "start": 0,
                        "length": 10,
                        "scale": 0.5,
                        "offset": {
                            "x": 0.25
                        }
                    }
                ]
            }
        ]
    },
    "output": {
        "format": "mp4",
        "resolution": "sd"
    }
}

Result:

Or to fill the screen like this, it uses crop to chop the sides of the video and offset to position them:

{
    "timeline": {
        "tracks": [
            {
                "clips": [
                    {
                        "asset": {
                            "type": "video",
                            "src": "https://shotstack-assets.s3.ap-southeast-2.amazonaws.com/motion-graphics/countup-1.mp4",
                            "volume": 1,
                            "crop": {
                                "left": 0.25,
                                "right": 0.25
                            }
                        },
                        "start": 0,
                        "length": 10,
                        "offset": {
                            "x": -0.25
                        }
                    },
                    {
                        "asset": {
                            "type": "video",
                            "src": "https://shotstack-assets.s3.ap-southeast-2.amazonaws.com/motion-graphics/countup-2.mp4",
                            "volume": 0,
                            "crop": {
                                "left": 0.25,
                                "right": 0.25
                            }
                        },
                        "start": 0,
                        "length": 10,
                        "offset": {
                            "x": 0.25
                        }
                    }
                ]
            }
        ]
    },
    "output": {
        "format": "mp4",
        "resolution": "sd"
    }
}

Result:

In each JSON, the volume is also set to 1 in one video and 0, in the other. This presumes that both videos have the same audio. If you have the audio separate you can use a technique like in this thread: Combine Two Videos in Speaker Mode - #7 by marcus (someone wanted to do something similar).

That thread also goes in to details about alternating between the video clips and displaying them in sequence. If you have different audio for each video you might need to switch between the audio at the right times which will require some kind of timing information for each video/audio.

Between this thread and the other one I think you can achieve what you are looking to do.