MATLAB Answers

maria aa

How can I extract I-frame from a video?

Asked by maria aa
on 4 Jan 2013

I want to choose I-frame from a video then I want to do something in it(I want to embed a watermark in it).How can I choose I-fram?



No products are associated with this question.

2 Answers

Answer by Image Analyst
on 4 Jan 2013

You can use VideoReader() and read(). There are examples in the help.


Maria did consistently use "I-frame", never "iFrame", and so is referring to Intra-Coded frames

Maria, once a frame has been decoded by VideoReader, it is not possible to tell which kind of frame it was encoded as. The only way to tell is to go into the encoding file itself.

Sorry, I'm not familiar with video compression schemes in general. I just use the videos and depend on someone else's code to make them or recall them. I don't do research into compression or steganography. I'd probably just read in the video, encode the hidden watermark into some frames, and then write back out, but that probably wouldn't guarantee the watermark would be on the least-encrypted "I-frames". If she's doing research into it she probably knows more about it than me. All I can suggest is to look at the published literature here VisionBib, particularly these sections:

23.3.11 Watermarks in Video and Multi-Media, Other Data Video Data Hiding, Data Hiding in Video, Video Steganography 

Thanks for your answer.

Answer by Walter Roberson
on 4 Jan 2013

It is a bunch of work, and usually of no value. See


so I cant find the code in Matlab!


You just might be able to find an mpeg-4 decoder written in MATLAB itself, but for efficiency reasons most people would just use a C/C++ based decoder.

Thanks for your answer.

Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

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

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!