Concatenate two video together one below the other

7 ビュー (過去 30 日間)
Srinidhi Bindiganavile Ramadas
Srinidhi Bindiganavile Ramadas 2018 年 11 月 1 日
回答済み: Prakhar Jain 2018 年 11 月 12 日
I am trying to play two video files one below the other at the same time. The videos are of different dimension. I tried this code but get an error saying "Dimensions of matrices being concatenated are not consistent."
I understand the error because frame sizes are different. but how to correct the code?
Frame2:- 681x1429x3 single
Frame1:- 525x700x3 single
Also, I tried to play two videos of same dimension, it worked but was zoomed in . How do I zoom out and play the videos as is?
if true
vid1 = vision.VideoFileReader('R1.avi');
vid2 = vision.VideoFileReader('FR2.avi');
vidP = vision.VideoPlayer;
while ~isDone(vid1)
frame1 = step(vid1);
frame2 = step(vid2);
frame = vertcat(frame1, frame2);
Thank you. Any help is much appreciated.

回答 (1 件)

Prakhar Jain
Prakhar Jain 2018 年 11 月 12 日
Hi Srinidhi,
You can refer the following answer by Walter. how to combine two videos in matlab


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by