From: Michael on
We are trying to write video capture in Matlab with imaq toolbox.
Nothing fancy, just 30 fps, 480x720.

What we want is to get frames from source, add our time and date stamp,
display the image on screen and save image to disk. Then on to next frame.
The need for adding captions means we need to do it frame by frame.
The problem is that getsnapshot take 6 ms, and then image takes 15 ms
and imwrite takes anoth 30 ms. With the time it takes to add captions,
the total time is about 60 ms.

We cannot use avifile and the like because our videos are 3-4 hours long
and so will exceed 2 Gb many times over. Matlab does not seem to support
openDML for writing so we are looking for the fastest alternative and imwrite
seems the fastest (uint8 data type).

So my question is... how do we speed this up. Is there a faster way to get
an image on screen? A faster way to save data? Any suggestions welcome.
From: witek on
Michael,

Consider using capabilities in Video and Image Processing Blockset,
which as of 10a contains MATLAB funcionality in addition to Simulink.

Items that might interest you:

http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.deployablevideoplayerclass.html

http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.multimediafilewriterclass.html

http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.textinserterclass.html

Witek

witek @ mathworks.com


Michael <verm25(a)hotmail.com> wrote:
> We are trying to write video capture in Matlab with imaq toolbox.
> Nothing fancy, just 30 fps, 480x720.
>
> What we want is to get frames from source, add our time and date stamp,
> display the image on screen and save image to disk. Then on to next frame.
> The need for adding captions means we need to do it frame by frame.
> The problem is that getsnapshot take 6 ms, and then image takes 15 ms
> and imwrite takes anoth 30 ms. With the time it takes to add captions,
> the total time is about 60 ms.
>
> We cannot use avifile and the like because our videos are 3-4 hours long
> and so will exceed 2 Gb many times over. Matlab does not seem to support
> openDML for writing so we are looking for the fastest alternative and imwrite
> seems the fastest (uint8 data type).
>
> So my question is... how do we speed this up. Is there a faster way to get
> an image on screen? A faster way to save data? Any suggestions welcome.
From: Michael on
Does video.MultimediaFileWriter support openDML? The page does not say.
Is there a way to demo it to see if it can keep up before we buy it
(it is not a part of our imaq toolbox or daq toolbox or any other toolbox we have)?
Is there any documentation on this including benchmarks?

witek(a)mathworks.com wrote in message <i3d3mg$kam$1(a)fred.mathworks.com>...
> Michael,
>
> Consider using capabilities in Video and Image Processing Blockset,
> which as of 10a contains MATLAB funcionality in addition to Simulink.
>
> Items that might interest you:
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.deployablevideoplayerclass.html
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.multimediafilewriterclass.html
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.textinserterclass.html
>
> Witek
>
> witek @ mathworks.com
>
>
> Michael <verm25(a)hotmail.com> wrote:
> > We are trying to write video capture in Matlab with imaq toolbox.
> > Nothing fancy, just 30 fps, 480x720.
> >
> > What we want is to get frames from source, add our time and date stamp,
> > display the image on screen and save image to disk. Then on to next frame.
> > The need for adding captions means we need to do it frame by frame.
> > The problem is that getsnapshot take 6 ms, and then image takes 15 ms
> > and imwrite takes anoth 30 ms. With the time it takes to add captions,
> > the total time is about 60 ms.
> >
> > We cannot use avifile and the like because our videos are 3-4 hours long
> > and so will exceed 2 Gb many times over. Matlab does not seem to support
> > openDML for writing so we are looking for the fastest alternative and imwrite
> > seems the fastest (uint8 data type).
> >
> > So my question is... how do we speed this up. Is there a faster way to get
> > an image on screen? A faster way to save data? Any suggestions welcome.
From: witek on
Hi Michael,

On Windows it does support openDML. It uses DirectShow infrastructure to write the files.
On Linux and Mac it does not support openDML and can only write uncompressed AVIs.

What aspects of openDML are you interested in? When I say "supports openDML" above, I mean,
it can write more than 4Gigs of data.

I don't have benchmarks to offer, but you are most definitely welcome to try it. You can arrange
a trial here:

http://www.mathworks.com/programs/trials/trial_request.html

The actual product is Video and Image Processing Blockset:

http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/

HTH,

Witek


Michael <verm25(a)hotmail.com> wrote:
> Does video.MultimediaFileWriter support openDML? The page does not say.
> Is there a way to demo it to see if it can keep up before we buy it
> (it is not a part of our imaq toolbox or daq toolbox or any other toolbox we have)?
> Is there any documentation on this including benchmarks?
>
> witek(a)mathworks.com wrote in message <i3d3mg$kam$1(a)fred.mathworks.com>...
> > Michael,
> >
> > Consider using capabilities in Video and Image Processing Blockset,
> > which as of 10a contains MATLAB funcionality in addition to Simulink.
> >
> > Items that might interest you:
> >
> > http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.deployablevideoplayerclass.html
> >
> > http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.multimediafilewriterclass.html
> >
> > http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.textinserterclass.html
> >
> > Witek
> >
> > witek @ mathworks.com
> >
> >
> > Michael <verm25(a)hotmail.com> wrote:
> > > We are trying to write video capture in Matlab with imaq toolbox.
> > > Nothing fancy, just 30 fps, 480x720.
> > >
> > > What we want is to get frames from source, add our time and date stamp,
> > > display the image on screen and save image to disk. Then on to next frame.
> > > The need for adding captions means we need to do it frame by frame.
> > > The problem is that getsnapshot take 6 ms, and then image takes 15 ms
> > > and imwrite takes anoth 30 ms. With the time it takes to add captions,
> > > the total time is about 60 ms.
> > >
> > > We cannot use avifile and the like because our videos are 3-4 hours long
> > > and so will exceed 2 Gb many times over. Matlab does not seem to support
> > > openDML for writing so we are looking for the fastest alternative and imwrite
> > > seems the fastest (uint8 data type).
> > >
> > > So my question is... how do we speed this up. Is there a faster way to get
> > > an image on screen? A faster way to save data? Any suggestions welcome.
From: Michael on
Thanks. We just got R2010b prerelease and I guess we will
get the blockset.
Still, the idea is to capture video to disk and to screen and then
to collect user input from screen. So for instance if a user
clicks on a pixel then some machine can move to that
actual underlying position. Hence, I doubt that a generic
video player (without callback capabilities) would do.

I still wonder if image can be sped up. The thing does a lot
of work: defines a lot of properties and calls newplot.
All I want is to keep same properties and just redraw image
area.
The best option I found so far is to call:
set(get(gca,'Children'),'cdata',my_image)
which speeds it up about 5-10 times.

Is this the fastest?



witek(a)mathworks.com wrote in message <i3e7ur$8ou$1(a)fred.mathworks.com>...
> Hi Michael,
>
> On Windows it does support openDML. It uses DirectShow infrastructure to write the files.
> On Linux and Mac it does not support openDML and can only write uncompressed AVIs.
>
> What aspects of openDML are you interested in? When I say "supports openDML" above, I mean,
> it can write more than 4Gigs of data.
>
> I don't have benchmarks to offer, but you are most definitely welcome to try it. You can arrange
> a trial here:
>
> http://www.mathworks.com/programs/trials/trial_request.html
>
> The actual product is Video and Image Processing Blockset:
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/
>
> HTH,
>
> Witek
>
>
> Michael <verm25(a)hotmail.com> wrote:
> > Does video.MultimediaFileWriter support openDML? The page does not say.
> > Is there a way to demo it to see if it can keep up before we buy it
> > (it is not a part of our imaq toolbox or daq toolbox or any other toolbox we have)?
> > Is there any documentation on this including benchmarks?
> >
> > witek(a)mathworks.com wrote in message <i3d3mg$kam$1(a)fred.mathworks.com>...
> > > Michael,
> > >
> > > Consider using capabilities in Video and Image Processing Blockset,
> > > which as of 10a contains MATLAB funcionality in addition to Simulink.
> > >
> > > Items that might interest you:
> > >
> > > http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.deployablevideoplayerclass.html
> > >
> > > http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.multimediafilewriterclass.html
> > >
> > > http://www.mathworks.com/access/helpdesk/help/toolbox/vipblks/ref/video.textinserterclass.html
> > >
> > > Witek
> > >
> > > witek @ mathworks.com
> > >
> > >
> > > Michael <verm25(a)hotmail.com> wrote:
> > > > We are trying to write video capture in Matlab with imaq toolbox.
> > > > Nothing fancy, just 30 fps, 480x720.
> > > >
> > > > What we want is to get frames from source, add our time and date stamp,
> > > > display the image on screen and save image to disk. Then on to next frame.
> > > > The need for adding captions means we need to do it frame by frame.
> > > > The problem is that getsnapshot take 6 ms, and then image takes 15 ms
> > > > and imwrite takes anoth 30 ms. With the time it takes to add captions,
> > > > the total time is about 60 ms.
> > > >
> > > > We cannot use avifile and the like because our videos are 3-4 hours long
> > > > and so will exceed 2 Gb many times over. Matlab does not seem to support
> > > > openDML for writing so we are looking for the fastest alternative and imwrite
> > > > seems the fastest (uint8 data type).
> > > >
> > > > So my question is... how do we speed this up. Is there a faster way to get
> > > > an image on screen? A faster way to save data? Any suggestions welcome.