필터 지우기
필터 지우기

Delete frames from video

조회 수: 21 (최근 30일)
Tomás
Tomás 2023년 7월 6일
편집: KSSV 2023년 7월 6일
Hello - Looking to delete the first 3 frames of a video using matlab. I've been looking over VideoReader and VideoWriter documentation, but I'm not getting very far.
---
vr = VideoReader('Motion.avi');
vw = VideoWriter('Motion_edit.avi');
frames = read(vr,[4 Inf]);
open(vw);
writeVideo(vw,frames)
--
This code has not been successful...

채택된 답변

KSSV
KSSV 2023년 7월 6일
편집: KSSV 2023년 7월 6일
vidObj = VideoReader('Motion.avi');
% Read video frames until the end of the file is reached by using the readFrame method.
vidframes = read(vidObj,[1 Inf]); % you can read from [4 inf] and then write
% Write video
v = VideoWriter('Test.avi');
% skip the first three frames
vidframes = vidframes(:,:,:,3:end) ;
% write the video
open(v)
writeVideo(v,vidframes)
close(v)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by