开发者

How to avoid writing non-I Frames using GMFBridge

开发者 https://www.devze.com 2023-03-16 07:37 出处:网络
I use GMFBridge to record a stream source video files into dicrete files.Like the DSBoy GMFBridge with GMF GDCL MPEG 4 Mux Filter

I use GMFBridge to record a stream source video files into dicrete files.Like the DSBoy GMFBridge with GMF GDCL MPEG 4 Mux Filter

FirstPart ==>  SourceFilter--> BridgeSinkFilter
SecondPart ==> BridgeSourceFilter ---> GDCL MPEG 4 Mux Filter---> FileWriter 

I record streams with 10 minutes interval and open new file for next record. It works, but while the first record is OK, the others records open with green bad frames at the beginning 开发者_运维百科(the rest of video is OK).

I think when i stop file writer using bridge, and recreate it with new file, it writes Non-I Frame to file. If so how can i avoid writing Non-I Frame at the beginning of record with this directshow filter structure?

Best Wishes


Your explanation sounds correct. GMFBridge was originally designed for uncompressed video, so you will need to add a little code to make this work.

The simplest solution is to add code in the mux graph, just before the mux, that drops data until you see a GOP start, but that's not ideal since you will lose data.

To do it properly you need to trigger a bridge switch when you see the start of a GOP. One way to do this is to write a GOP detector filter, which would sit in the upstream graph just in front of the bridge sink.

When you are ready to switch (after 10 mins), the app enables the GOP detector. When the GOP detector sees a GOP start, it blocks delivery, and signals the app. When the app sees the signal, it will switch the bridge to the new mux graph and then re-enable delivery on the GOP detector.

G

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号