downsample from image 360*640 to 180*320
이전 댓글 표시
hi to everyone , I would to ask two question . the first is place in the title , and i know that i'm going to lose data , but i need to. the image in question i frame in the code under
. the second is that i'm trying to execute this code , but somthing wrong append .
video1=VideoReader('Francesca-Michielin---No-Degree-Of-Separation-Italy-Live-at-Semi-Final-2.mp4');
video2=VideoReader('Jamala---1944-Ukraine-Live-at-Semi-Final-2-of-the-2016-Eurovision-Song-Contest.mp4');
videoOut=VideoWriter('provaMix.avi');
videoOut.FrameRate=video1.FrameRate;
open(videoOut)
frames=read(video1,[1 2316]);
for frame=frames
% eventualmente resize (downsampling) del frame
writeVideo(videoOut,frame);
end
thank so much
채택된 답변
추가 답변 (1개)
Andrea Gusmara
2020년 5월 22일
0 개 추천
댓글 수: 3
Ameer Hamza
2020년 5월 22일
You can use a for-loop to read multiple frames using readFrame(). However, I don't think there is a direct way to use readFrame to read multiple frames. Also, what error you get if you use read() function to read multiple frames?
Andrea Gusmara
2020년 5월 22일
Ameer Hamza
2020년 5월 22일
Your for loop is wrong. Write it like this
frames=read(video1,[1 2316]);
for idx=1:2316
% eventualmente resize (downsampling) del frame
writeVideo(videoOut,frames(:,:,:,i));
end
카테고리
도움말 센터 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!