1)创建AppleScript文件,输入一下代码并保存。如QTRecord.scpt

tell application "QuickTime Player"
     activate
     start (new movie recording)
 end tell

2)在终端执行

osascript QTRecord.scpt 

3)或者也可以一句话搞定以上两步

 osascript -e 'tell application "QuickTime Player" to activate' -e 'tell application "QuickTime Player" to start (new movie recording)'

摘自How to start QuickTime recording at command line?

分割线

这几天为了解决录制视频同时记录开始录制的时间戳这个需求,倒腾了不少解决方案,之前也想过用命令行打开QuickTime进行录制,但是忘了还有AppleScript,而且竟然4行就搞定了(捂脸...心痛一下我的时间)。在这里大概记录一下之前试过的方法。

1.OpenCV Python 录制视频
2. python包装ffmpeg实现视频录制

相关文章:

  • 2022-02-08
  • 2021-05-23
  • 2021-08-02
  • 2022-01-08
  • 2021-10-10
  • 2021-06-29
  • 2022-02-10
  • 2021-11-18
猜你喜欢
  • 2021-12-02
  • 2021-10-16
  • 2021-05-04
  • 2021-05-19
  • 2021-07-25
  • 2022-01-24
  • 2021-12-02
相关资源
相似解决方案