View Full Version : recording one frame to avi-file
hanfrunz
4th May 2005, 14:03
Hello everyone,
i need to record a avi-file in my c++ project, but it must have the lenght of one frame only. I use a normal directshow-filter-chain. After i run the graph i wait for a event with a timeout of about 40ms, so most of the time i get one-frame-avis, but sometimes i get corrupted files with no video and sometimes there a more than one frame... I do not want to use the framegrabber filter, because i need the original codec and colorspace etc. Any idea?
DaveEL
4th May 2005, 19:17
forget directshow and use the video for windows VFW api. avs2avi should give you a starting point.
DaveEL
unskinnyboy
4th May 2005, 19:26
Isn't one-frame avi = still image? :confused:
hanfrunz
4th May 2005, 20:17
@DaveEL: but i like directshow :) and i have to use it, because my framegrabber only has directshow-support...
@unskinnyboy: you are right, but if you use the framegrabberfilter, then you convert the data to rgb and i loose my 10bit Y'CbCr advantage...
DaveEL
4th May 2005, 21:13
Originally posted by hanfrunz
@DaveEL: but i like directshow :) and i have to use it, because my framegrabber only has directshow-support...
No reason to not use both
DaveEL
4th May 2005, 21:17
Just had another though you could write a custom dshow filter which would allow you to just grab the single frame. Take a look through the dshow sdk should find some samples to get you started
PS if you doing .avi output from this i would still say keep clear of dshow the avi mux filter is terrible
DaveEL
Dmitry Vergheles
6th May 2005, 09:23
Hi hanfrunz,
you can make use of still image generator source filter.
Actually it's not represented as Directshow filter but if you render your still image in graph it to be put as that automatically.
It is used by DirectShow Editing Services and therefore it's a bit tricky.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.