Code Monkey home page Code Monkey logo

Comments (6)

robmikh avatar robmikh commented on August 20, 2024

I should note that if you're having a problem capturing Thunderbird or Notepad++, Win2D is not going to fix your problem. What's your scenario? Is it your own code that's having these issues or SimpleRecorder? FWIW, I'm able to consistently capture both. What GPU are you using?

If you'd like to check out a Win2D version, that's actually what I started with. The last commit that used Win2D is at 9f6dd36.

Win2D is a fantastic library, and I use it in my other projects. But you should understand what the best tool for the job is. Win2D is a wrapper around Direct2D, which has its own way to enqueue work before sending it to the GPU. That poses a synchronization issue since the media code will also be partying on the same D3D device.

SharpDX on the other hand is just a set of bindings of Direct3D (I'm using D3D11). Since I'm not doing any complex operations, just copies, this is preferable. I can also control the synchronization this way. If I were doing this in C++, I wouldn't be using SharpDX and would be using Direct3D11 directly.

from simplerecorder.

jtorjo avatar jtorjo commented on August 20, 2024

Thanks for showing me the last version with win2d. That's perfect - I'll definitely start from there.

Win2D is not going to fix your problem. What's your scenario? Is it your own code that's having these issues or SimpleRecorder? FWIW, I'm able to consistently capture both. What GPU are you using?

I have a video editor, and I want to add the capability to record the screen. As for GPU, I have an Nvidia with 2 GB or RAM.

I've looked again at your code - I think you're using a MediaTranscoder for capture. What I want to use is MediaComposition - I'm not entirely sure how easy this will be, but I should make it work.

I've started from here - https://docs.microsoft.com/en-us/windows/uwp/audio-video-camera/screen-capture

I can see that simple bitmap capture works (and it does work on Thunderbird and Notepad++), so I think this will definitely work.

from simplerecorder.

robmikh avatar robmikh commented on August 20, 2024

I'd be careful of using MediaComposition directly by feeding it individual frames. I haven't looked at how it's implemented, but the last time I used it it seemed to keep all frames in system memory. That can balloon really quickly if you're recording a longer video at 60Hz. It's really meant to be used to compose things, not to encode a video from frames.

I would look at first encoding the video somewhere to disk using MediaTranscoder and then import the resulting encoded video into MediaComposition.

Good luck!

from simplerecorder.

jtorjo avatar jtorjo commented on August 20, 2024

@robmikh Thanks again for pointing me to the last version that was using win2d. That got me started. I did encountered a few bugs, did a bit (a lot, actually) of cursing, but right now, it works.

from simplerecorder.

robmikh avatar robmikh commented on August 20, 2024

I'd love to see your app once you ship the feature! πŸ™‚

Let me know if you run into issues using the API.

from simplerecorder.

jtorjo avatar jtorjo commented on August 20, 2024

Sounds good, will show you!

from simplerecorder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.