Giter Site home page Giter Site logo

Comments (12)

sindresorhus avatar sindresorhus commented on May 14, 2024 10

I looked into this yesterday and we have two options:

  1. In the Swift code in Aperture, handle writing the movie file ourselves. This would let us drop the frames until Kap signals it's ready and Kap would be able to record exactly when it wanted to. The problem is that it's both difficult and verbose to do anything manual with AVFoundation and we would not be able to use the simple method we're currently using. We would also need a different solution for Linux when we add support for that.

  2. Save the time when .startRecording() is called. Have Aperture send the time back in the resolved promise when the recording actually started. Use ffmpeg to losslessly trim that time away from the start of the movie. This process is super fast (like you would have done it in QuickTime Player). This would also work for the Linux version without any extra code. This way we could actually have a nice countdown too as we would be fully in control of when the actual recording started.

I think 2 would be the best solution.

from kap.

matheuss avatar matheuss commented on May 14, 2024 3

Ok, just discussed with @skllcrn and we have an idea: we'll just hide the window when you click to record, and then the menubar icon will be more useful: we can show the time, a pause button etc. Something like CloudApp:

screen shot 2017-01-31 at 8 54 39 am

(Obviously with a better UI/UX, since we got @skllcrn 😎)

from kap.

matheuss avatar matheuss commented on May 14, 2024 2

I just looked into this and here's what I concluded:

I put console.log(Date.now())s in the following locations:

https://github.com/wulkano/aperture.js/blob/99110e848368af117ee573ffe693433d0eff7ec4/index.js#L55

https://github.com/wulkano/kap/blob/fb1e5b058277bb55f6c156d1a679150ea8b5a878/app/src/renderer/js/index.js#L120

https://github.com/wulkano/kap/blob/fb1e5b058277bb55f6c156d1a679150ea8b5a878/app/src/main/index.js#L281

Result:

screen shot 2016-10-13 at 5 05 00 pm

kapture 2016-10-13 at 16 58 15

Kap receives the recording started signal from aperture 7 ms after it starts and then the mainWindow.hidden() is called 1 ms later.

So: it's probably something on the aperture or Swift side and it's going to need some time to debug. Any help is more than welcome 😄

from kap.

SamVerschueren avatar SamVerschueren commented on May 14, 2024 1

I came across this bug as well. Before I started using kap, I always used LiceCap. I like how they do it. To illustrate this, I made a capture of a LiceCap capture :p.

licecap

As you can see, LiceCap always uses a preroll of 3 seconds. Don't think it's configurable, but might be a nice feature. That timer could then be shown in the menubar on top. Currently, it's hard to tell how much time you have before the capture actually starts.

from kap.

sindresorhus avatar sindresorhus commented on May 14, 2024 1

This should no longer be a problem in the latest beta as we hide the window right away and then bounce the menubar icon while it prepares.

from kap.

Khaledgarbaya avatar Khaledgarbaya commented on May 14, 2024

is the waiting for recording started really needed? the window could be hidden and still wait for the signal. I might take a look into this tonight

from kap.

sindresorhus avatar sindresorhus commented on May 14, 2024

@matheuss I'm not surprised. The API is async, so it's not going to resolve the promise instantly. The native API reports exactly when the screen recording starts, so there's going to be some lag.

from kap.

sindresorhus avatar sindresorhus commented on May 14, 2024

@Khaledgarbaya It usually takes 1-2 seconds for the screen recording to start (Not us, but the system), so it's an indicator you're not being recorded yet. I can't really think of a better solution right now, so I guess we can at least do what you suggest for now.

from kap.

matheuss avatar matheuss commented on May 14, 2024

@Khaledgarbaya I'm not sure if I like your idea 😕 If you want the window to be hidden, you can just leave it docked to the menubar.

I will try and hack something during 2.0.0 🕵️

from kap.

skllcrn avatar skllcrn commented on May 14, 2024

My worry is that people will think the recording has started as soon as the app window is hidden. I'll see what I can do. As @sindresorhus and @matheuss have explained, we're limited by the API here. You want to know that Kap is "Getting ready..." and that your recording hasn't started yet, but of course you don't want the window showing in the actual recording. If we hide the window immediately, we still need to communicate that the app is working and give a clear hint as soon as we know the recording has started (which isn't accurate).

from kap.

sonaye avatar sonaye commented on May 14, 2024

How about when we click the red record button, the window is hidden immediately then a three-to-one counter would replace the tray icon (three new tray icons, five in total). I noticed that the recording starts the second the tray icon becomes stop instead of record, so in theory it should work. Is this feasible?

from kap.

skllcrn avatar skllcrn commented on May 14, 2024

Fixed on master, thank you @vadimdemedes! Feel free to close this issue when you're ready.

from kap.

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.