MATLAB Answers

cut's video to give start and end postion in matlab

5 views (last 30 days)
Irfan Hussain
Irfan Hussain on 4 Apr 2020
Answered: Geoff Hayes on 5 Apr 2020
hello ,
I have 5 video's length 18 sec each. i want code to cut each video which starting form 10 sec and 18 sec ending time.
All videos have same frames rate.
Any body help !!!

  0 Comments

Sign in to comment.

Answers (1)

Geoff Hayes
Geoff Hayes on 5 Apr 2020
Irfan - try using the videoreader to load the video and read only the frames that you are interested in. The videoreader object will tell you the frame rate and from that you can figure out which set of frames to extract (those correspondng to the 10-18 second period). For example,
v = VideoReader('myVideo1.mp4');
fs = v.FrameRate;
frames = read(v,[(9*fs+1) Inf]); % read from 10-18 seconds

  0 Comments

Sign in to comment.


Translated by