meathill
V2EX  ›  Swift

请教一个 Swift 问题

  •  
  •   meathill ·
    meathill · Nov 10, 2020 · 2831 views
    This topic created in 2069 days ago, the information mentioned may be changed or developed.

    大家早上好。

    我现在计划用 https://github.com/wulkano/Aperture 录制屏幕,需要比较准确的开始时间。我自己实验,它在我的电脑上( iMac 2019 )完成启动到录屏,需要 1.2s 的时间。不太好判断。

    我想请教大家,AVCaptureSession 有没有一个类似启动事件之类的东西,可以准确获得开始录屏的时间戳?我在 apple 的文档里没找到。

    有劳各位。

    1 replies    2020-11-10 11:10:47 +08:00
    FaXiaoKe
        1
    FaXiaoKe  
       Nov 10, 2020
    监听 Session 状态
    可以使用通知监听相机当前状态,如开始,停止,意外中断等等...
    - (void)captureOutput:(AVCaptureOutput *)output didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   902 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 20:16 · PVG 04:16 · LAX 13:16 · JFK 16:16
    ♥ Do have faith in what you're doing.