cut video with beginning and end frame number

9 views (last 30 days)
Hello!
I want to "cut" a shorter video out of a long video in Matlab. I have the start frame number and the end frame number.
For example a video lasts 30 seconds and I want to have only the new video from 4 seconds to 17 seconds by knowing the beginning frame number of hypothesised 125 and end frame number of 501.
Any ideas how to do this?
Thank you for your help and your time!

Accepted Answer

Daniel M
Daniel M on 4 Oct 2019
Edited: Daniel M on 4 Oct 2019
I'm not sure the size of your video data, but observe the following:
x = rand(50,60,1000);
whos x % x = [50, 60, 1000]
x(:,:,[1:124,502:end]) = []; % delete beginning and end sections
whos x % x = [50, 60, 377]

More Answers (0)

Community Treasure Hunt

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

Start Hunting!