Clear Filters
Clear Filters

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

6 views (last 30 days)
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
Gohan
Gohan on 6 Oct 2016
Edited: Walter Roberson on 6 Oct 2016
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

Walter Roberson
Walter Roberson on 6 Oct 2016
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
Walter Roberson
Walter Roberson on 6 Oct 2016
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()
Gohan
Gohan on 6 Oct 2016
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)

Community Treasure Hunt

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

Start Hunting!