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 次查看(过去 30 天)
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 个评论
Gohan
Gohan 2016-10-6
编辑:Walter Roberson 2016-10-6
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????

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2016-10-6
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 个评论
Walter Roberson
Walter Roberson 2016-10-6
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 2016-10-6
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

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by