Back Forum Reply New

recording one frame to avi-file

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?

forget directshow and use the video for windows VFW api. avs2avi should give you a starting point.

DaveEL

Isn't one-frame avi = still image?

@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...

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

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

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.
¥
Back Forum Reply New