me
me copied to clipboard
记录和分享技术的博客
> rtmpdump is a toolkit for RTMP streams. All forms of RTMP are supported, including rtmp://, rtmpt://, rtmpe://, rtmpte://, and rtmps://. 在MacMini M1的macOS上编译还是有点小挑战: - `git clone git://git.ffmpeg.org/rtmpdump` ``` ➜ rtmpdump...
## discard [version control - How do I discard unstaged changes in Git? - Stack Overflow](https://stackoverflow.com/questions/52704/how-do-i-discard-unstaged-changes-in-git) 2个方式,推荐restore: - `git restore .` - `git checkout -- .` or `git checkout .`
# Hello, World env: MacOS, Clang++, vscode project: hello hello/src/main.cpp ```cpp #include using namespace std; int main() { cout
参考阅读的文章和WWDC的视频已经非常清晰了,我重新整理了一下代码: - Camera - Encoder ## Camera ```swift import AVFoundation import VideoToolbox class VideoInput : NSObject, ObservableObject { @Published var sample: CMSampleBuffer? @Published var image: CVPixelBuffer? } class Camera :...
讲一下通过swift写文件,如果不上AppStore就直接关掉sandbox,命令行的程序没有sandbox限制。后续如果打开AppStore就需要遵守一系列限制。 Case 1: string写入文件 ```swift // write string let home = FileManager.default.homeDirectoryForCurrentUser let filename = home.appendingPathComponent("/Desktop/clip.txt") print(filename) let text = "hello world" do { try text.write(to: filename, atomically: true, encoding:...
根据 [Building a Camera App With SwiftUI and Combine | raywenderlich.com](https://www.raywenderlich.com/26244793-building-a-camera-app-with-swiftui-and-combine) 走了一遍流程,做了以下修改: - 迁移到 MacOS - 暂时去掉滤镜,简化流程 代码放在这: [nonocast/CameraApp](https://github.com/nonocast/CameraApp) 后续考虑增加: - 截图 - 保存视频mkv/mp4 - 推流rtmp - 滤镜 - 背景替换...
Sample Code [Capturing Screen Content in macOS | Apple Developer Documentation](https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos) > This sample shows how to add high-performance screen capture to your Mac app by using [ScreenCaptureKit](https://developer.apple.com/documentation/screencapturekit). The sample...
version: 5.6 ## Trailing Closures ```swift class Service { init(handler: () -> Void) { handler() } } let p = Service { print("hello world") } ``` ## Shorthand Argument Names...
Vision 中关于 Face and Body Detection: - [class VNDetectFaceRectanglesRequest](https://developer.apple.com/documentation/vision/vndetectfacerectanglesrequest): A request that finds faces within an image. - [class VNDetectHumanRectanglesRequest](https://developer.apple.com/documentation/vision/vndetecthumanrectanglesrequest): A request that finds rectangular regions that contain people in...
随着逐步的深入,对各个框架认识如下: - Cocoa中的NSImage/UIImage: 属于UI层面,同时支持多个representation - Core Graphics中的CGImage: 其核心是Quartz,通过CGContext实现绘图, CGImage只对应一个Bitmap layer - Core Image中的CIImage: 主要用来做效果和滤镜,包括图片的缩放和裁剪,识别部分移到了Vision框架 - Vision: 通过Core ML机器学习能力展现出强大的分析能力,包括人脸、body、姿态、物体等等的检测 进入正题我们来看几个Core Image的场景。 ## Applying a Chroma Key Effect 俗话说绿幕抠像,智能抠像就要用到后面的Vision Framework。 2个步骤: 1....