Reputation: 697
I'm trying to implement a cut function using DirectShow. Basically it works when i try to cut one sequence by setting the start and end positions. But now i want to cut out a second sequence from the same source file and write directly at the end of the first cut. So i set start and end positions again and start the graph again but the file writer filter overwrites the first cut. So basically i want to know how to change this.
The problem is definitely resided in the avi muxer filter which creates the write offsets for the file writer.
Upvotes: 4
Views: 329
Reputation: 69672
DirectShow multiplexers are designed to finalize the output file once the session is complete. You cannot append to already existing file, for many reasons, just to give you one: the multiplexers would have to compare new media types against those existing in the file and do stream mapping in order to decide whether to append or not. It is not that it is impossible, they are simply not indended for such use.
Solution here, except DES, CPlusSharp already mentioned in the other answer, is to write output at once, gathering data from multiple segments and adjusting time stamps respectively. You typically need several filter graphs to accomplish the task, with certain way to transfer data between the graphs. One graph is writing the file (at once), and then other source graphs are supplying the data, e.g. start with already encoded content to pass as is, without transcoding, and then another graph appends new data.
Upvotes: 0
Reputation: 891
I'm sorry, but the only way to cut more then one scene to a new file with DirectShow is in using the DirectShow Editing Services. Good luck with it, it's extremely buggy, hard to master and a long time abandoned by Microsoft.
Upvotes: 1