How to combine two different videos ...and how to combine frst frame of first video and second frame is frst frame of second video with this I have to made second video ...plz help me

How to add two different videos ...after frst video completion second video has to start ... And second task is a third video who's frst frame is frst frame of frst video Nd second frame is frst frame of second video respectively.....plz help me anyone

7 Comments

Chandrasekhar - do the frames for each video have the same dimension?
No sir seperate video for example viptraffic.avi and ecolicells.avi
Different videos with different dimensions is possible sir??? Suppose if I have same frame dimension video files how can I do above operations sir ?? Plz help me Geoff Hayes sir
There is any specific command to add two video files after reading them individually or there is any technique Let me know sir...thanku
Try taking a look at reading video files using a VideoReader object. You can read all of the frames (for each video), then play them back in whatever order you wish. (There will be no audio though.)
Sir
Vid1=videodreader('video1.avi');
Video1=read(vid1);
Vid2=videodreader('video2.avi');
Video2=read(vid2);
My video=videowriter('newvideo.avi');
Open (my video);
After this
For I=1:100
Frame1=read(vid1,I);
Writevideo(my video,frame1);
End
For j=1:100
Frame2=read(vid2,j);
Writevideo(my video,frame2);
End
Close (my video);
Can I use two times write video sir two add two video files????

Sign in to comment.

 Accepted Answer

imadd(), but if you do that then your values can end up being too large since bright + bright = too_bright_to_represent_normally
Consider imlincomb

5 Comments

Sir suppose I write like this
I=read(vidobj1,i);
J=read(vidobj2,j);
Z=imlincomb(I,J)
Can I do this ??
Z + imlincomb(0.5, I, 0.5, J);
if you want the two frames to be "averaged".
The special case of averaging can also be written as
cast((double(I) + double(J))/2, class(I))
I want to view frames of different videos clearly sir by reducing frame rate ...how can I realize that using imlincomb fun ??? Thanku sir
If you want to combine two frames of different sizes into a single video, then you have two choices:
  1. you can use a routine such as imresize() to change each of the frames to a common size; or
  2. you can pad the smaller frame to be the same size as the larger frame, perhaps by using impad()
If you want different frames of a video to appear for different amounts of time, then you need to repeat the frames as often as necessary to take up that much time considering the frame rate you specified for VideoWriter()
Sir by using writevideo fun in for loop two times I got frames of both videos in single video with clear observation (frame rate reduced) thanku sir

Sign in to comment.

More Answers (0)

Asked:

on 4 Oct 2016

Commented:

on 6 Oct 2016

Community Treasure Hunt

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

Start Hunting!