Kalan's Blog

Kalan 頭像照片,在淡水拍攝,淺藍背景

四零二曜日電子報上線啦!訂閱訂起來

Software Engineer / Taiwanese / Life in Fukuoka
This blog supports RSS feed (all content), you can click RSS icon or setup through third-party service. If there are special styles such as code syntax in the technical article, it is still recommended to browse to the original website for the best experience.

Current Theme light

我會把一些不成文的筆記或是最近的生活雜感放在短筆記,如果有興趣的話可以來看看唷!

Please notice that currenly most of posts are translated by AI automatically and might contain lots of confusion. I'll gradually translate the post ASAP

How to record video using XCode Simulator

category: iOS tag: iOS

It's quite troublesome to do screen recording. Every time I have to manually select the area. So I looked up if it's possible to record using the simulator, and it turns out it is, and surprisingly, it's very simple. Just run the following command in the command line:

xcrun simctl io booted recordVideo --codec=h264 transition.mp4

After pressing ctl+c, the video file will be generated automatically. Just make sure there are no files with the same name. Additionally, because I often put repro on GitHub, which doesn't support video files, I convert them to gif using ffmpeg:

ffmpeg -ss 2 -t 20 -i YOUR_VIDEO_NAME -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 OUTPUT.gif

Later, I will gradually study the parameters of ffmpeg. In any case, this way you can convert video files to gif files. Awesome!

Prev

Rollup error encountered with Svelte with apollo-boost

Next

Svelte Notes (2): Compiler is more clever than you mess

If you found this article helpful, please consider buy me a drink ☕️ It'll make my ordinary day shine✨

Buy me a coffee