Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

re-using ASFWriter filter to save different video files

0 views
Skip to first unread message

tfs

unread,
Oct 27, 2009, 8:20:01 AM10/27/09
to
I am writing a DirectShow encoder graph, and use the WMAsfWriter filter to
encode for ASF files. This encoder app supposes to run continuously non-stop,
encoding a series of 30-min long video files. NOTE: by means of "non-stop",
it means the encoder graph can stop once reached 30-min, then set for a new
output filename, and re-start, all should be done within 1~2 seconds, and
without any human action.

Few "strange" things I've found for using the WMAsfWriter filter are:

1. I must query IFileSinkFilter from the filter and set the output file path
before inserting the filter into the graph. If I insert the filter first then
set the filename afterwards, the graph will fail to start.
2. Once set the file path into IFileSinkFilter, I cannot change to another
file path. If I do that (of course I stop the graph first before setting the
new output filename), then the previously encoded video file will be erased
(leaving only a few KB).

This coule mean that, in order to encode to different files, each time I
must create a new WMAsfWriter filter for a new output file, and delete the
previous WMAsfWriter filter.

I think it is completely silly. All I need to change during runtime is the
output filename. Creating a new WMAsfWriter filter consumes time (setting it
up alone will use almost 1 second), therefore losing video data unnecessarily.

I don't know if my approach mentioned above is correct. If not, could any of
you show me the correct way.

Thanks.

Michel Roujansky - [MS MVP DirectShow/MediaFoundation]

unread,
Oct 27, 2009, 12:18:51 PM10/27/09
to

This is the "normal" behaviour. To write files without losing frames,
you must use techniques such as Geraint Davies' GMFBridge with
multiple backend graphs.

0 new messages