Capture DirectX video from screen to MPG or WMV (not AVI) [modified]
-
Hello, Short version: What's the best way to capture a non-AVI video from a DirectX display in Windows Forms? I would prefer to use WMV or MPG since AVIs can get quite large. I've seen a lot of suggestions for DirectShow, but I hear it's not supported in Vista of 7. I need this to work in both XP and Vista. I'd rather use the same solution for each OS, but if necessary we can implement separate ones. Not-so-short version: I have a Windows Forms app that uses Managed DirectX for a portion of the display, and the customer wants to be able to capture a video of it. We've tried saving the frames to BMPs and then using various utilities (Windows Media Encoder SDK, BMP2AVI cmd line util) to compile them into an AVI, but the process of saving the BMPs really slows down the framerate. Also, the frames are only about 500 x 600, and a 15-sec AVI is about 300 MB! The customer may want to record longer videos at higher resolution, so it would be nice to save to an MPG or WMV if we could. It would be even better if we could skip saving the frames to BMPs and create the video on the fly, but I assume that would be even worse performance. Thanks, Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
modified on Friday, December 25, 2009 12:19 PM
-
Hello, Short version: What's the best way to capture a non-AVI video from a DirectX display in Windows Forms? I would prefer to use WMV or MPG since AVIs can get quite large. I've seen a lot of suggestions for DirectShow, but I hear it's not supported in Vista of 7. I need this to work in both XP and Vista. I'd rather use the same solution for each OS, but if necessary we can implement separate ones. Not-so-short version: I have a Windows Forms app that uses Managed DirectX for a portion of the display, and the customer wants to be able to capture a video of it. We've tried saving the frames to BMPs and then using various utilities (Windows Media Encoder SDK, BMP2AVI cmd line util) to compile them into an AVI, but the process of saving the BMPs really slows down the framerate. Also, the frames are only about 500 x 600, and a 15-sec AVI is about 300 MB! The customer may want to record longer videos at higher resolution, so it would be nice to save to an MPG or WMV if we could. It would be even better if we could skip saving the frames to BMPs and create the video on the fly, but I assume that would be even worse performance. Thanks, Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
modified on Friday, December 25, 2009 12:19 PM
-
Hello, Short version: What's the best way to capture a non-AVI video from a DirectX display in Windows Forms? I would prefer to use WMV or MPG since AVIs can get quite large. I've seen a lot of suggestions for DirectShow, but I hear it's not supported in Vista of 7. I need this to work in both XP and Vista. I'd rather use the same solution for each OS, but if necessary we can implement separate ones. Not-so-short version: I have a Windows Forms app that uses Managed DirectX for a portion of the display, and the customer wants to be able to capture a video of it. We've tried saving the frames to BMPs and then using various utilities (Windows Media Encoder SDK, BMP2AVI cmd line util) to compile them into an AVI, but the process of saving the BMPs really slows down the framerate. Also, the frames are only about 500 x 600, and a 15-sec AVI is about 300 MB! The customer may want to record longer videos at higher resolution, so it would be nice to save to an MPG or WMV if we could. It would be even better if we could skip saving the frames to BMPs and create the video on the fly, but I assume that would be even worse performance. Thanks, Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
modified on Friday, December 25, 2009 12:19 PM
-
I've used ScreenRecorder Pro[^] for this sort of thing in the past - maybe it'll do what you need.
L u n a t i c F r i n g e
Thanks for the link. However, our customer wants the recording functionality built into our app, not as a separate utility he must purchase. If we could add a reference to ScreenRecorder Pro in our project and integrate it that way, then this would be perfect. Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
-
Thanks for the link. However, our customer wants the recording functionality built into our app, not as a separate utility he must purchase. If we could add a reference to ScreenRecorder Pro in our project and integrate it that way, then this would be perfect. Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
-
Hello, Short version: What's the best way to capture a non-AVI video from a DirectX display in Windows Forms? I would prefer to use WMV or MPG since AVIs can get quite large. I've seen a lot of suggestions for DirectShow, but I hear it's not supported in Vista of 7. I need this to work in both XP and Vista. I'd rather use the same solution for each OS, but if necessary we can implement separate ones. Not-so-short version: I have a Windows Forms app that uses Managed DirectX for a portion of the display, and the customer wants to be able to capture a video of it. We've tried saving the frames to BMPs and then using various utilities (Windows Media Encoder SDK, BMP2AVI cmd line util) to compile them into an AVI, but the process of saving the BMPs really slows down the framerate. Also, the frames are only about 500 x 600, and a 15-sec AVI is about 300 MB! The customer may want to record longer videos at higher resolution, so it would be nice to save to an MPG or WMV if we could. It would be even better if we could skip saving the frames to BMPs and create the video on the fly, but I assume that would be even worse performance. Thanks, Dybs
The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen
modified on Friday, December 25, 2009 12:19 PM
FWIW: I bookmarked this[^] but never used any. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Merry Christmas and a Happy New Year to all.
-
FWIW: I bookmarked this[^] but never used any. :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
Merry Christmas and a Happy New Year to all.
Luc, Thanks for the link. A colleague of mine has actually been writing the code, I haven't seen too much of it. I know he's tried captureing the DirectX frames as BMps, then using Windows Media Encoder to merge them into a WMV, but the frame rate has never been quite right. He might not have seen the
IWMEncVideoSource2
type, which looks like exactly what we need. Hopefully the performance will be decent on it. Thanks, DybsThe shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen