MATLAB Answers


is it possible to make frames to video

Asked by Elysi Cochin on 26 Feb 2013

i have a video.... and when i convert it to frames i get 1000 frames.... now is it possible to select frames from 500 to 700 and save it in avi format..... so that i can open the video later without running the code as the video we gave for input...... please do reply...


manoj saini
on 26 Feb 2013

yes only read your matrix from b=a(500,700)\ now save your b variable

Image Analyst
on 26 Feb 2013

Is your video live/streaming, or has it already been captured and saved to a file (from which you wish to extract a subset of frames)?


No products are associated with this question.

1 Answer

Answer by manoj saini
on 26 Feb 2013
 Accepted answer

ya.........using getsnapshot


manoj saini
on 26 Feb 2013

FRAME = getsnapshot(v) immediately returns one single image frame, FRAME, from the video input object, v.

Elysi Cochin on 26 Feb 2013

sir i got a code from the following link

and i edited it as below but i'm getting error

    for frame = 60 : 100 
        outputBaseFileName = sprintf('%d.jpg', frame);
        outputFullFileName = fullfile('Frames', outputBaseFileName);
        I = imread(outputFullFileName);
        data(:,:,:,i) = getsnapshot(I);   

my error is

    ??? Undefined function or method 'getsnapshot' for input arguments of type 'uint8'.
    Error in ==> VideoMainTrial at 32
        data(:,:,:,i) = getsnapshot(I);

please rectify it for me sir....

Walter Roberson
on 26 Feb 2013

Your "I" is not a video input object.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!