Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Capture DirectX video from screen to MPG or WMV (not AVI) [modified]

Capture DirectX video from screen to MPG or WMV (not AVI) [modified]

Scheduled Pinned Locked Moved Graphics
winformsgraphicsgame-devsalesperformance
7 Posts 3 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dybs
    wrote on last edited by
    #1

    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

    L L 3 Replies Last reply
    0
    • D dybs

      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

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      AVI is just a container format, you can still compress them (as, for example, H.264)

      1 Reply Last reply
      0
      • D dybs

        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

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • L Lost User

          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

          D Offline
          D Offline
          dybs
          wrote on last edited by
          #4

          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

          L 1 Reply Last reply
          0
          • D dybs

            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

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Hmmm... I don't think it supports automation, but you could check with the authors.

            L u n a t i c F r i n g e

            1 Reply Last reply
            0
            • D dybs

              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

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              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.


              D 1 Reply Last reply
              0
              • L Luc Pattyn

                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.


                D Offline
                D Offline
                dybs
                wrote on last edited by
                #7

                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, Dybs

                The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups