简体   繁体   中英

c# DirectShow graphbuilder output filename issue

I'm new to using Directshow. I'm more than willing to post the pages of code I've writen but I'm hoping someone could explain or hint in the right direction for a solution so I can figure it out myself.

Basically I have a WPF program that displays a window that has a preview of my webcam - this is done and working. Now I'm trying to get it to record the preview - done using graphBuilder.SetOutputFileName

However everytime I show the window to record another session is just overwrites the last file it recorded, even though I'm calling graphBuilder.SetOutputFileName again!

So my question is how can I change the outputfilename to record a second video. I know I'm missing something but don't know what.

Thanks in advance. Rich

Filter graphs normally create media files starting from scratch on your initial Run and closing the file on your Stop . Next time you repeat the calls, you just start it from fresh from empty (overwritten) file. There is no appending. If you want to keep the previously recorded content, you need to switch files by providing new name, or copying/renaming the completed file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM