Skip to content

Instantly share code, notes, and snippets.

View itorr's full-sized avatar
🤕
为什么只能钉六个项目

卜卜口 itorr

🤕
为什么只能钉六个项目
View GitHub Profile
@itorr
itorr / 批量加速视频.ps1
Created June 29, 2023 22:53
批量加速视频.ps1
$outputDir = "./output_fast2"
if (!(Test-Path -Path $outputDir)) {
New-Item -ItemType Directory -Path $outputDir
}
Get-ChildItem -Path $sourceDir -Filter *.mp4 | ForEach-Object {
$outputFilename = Join-Path $outputDir ("$($_.BaseName)_fasted.mp4")
ffmpeg -i $_.FullName -vf "select='not(mod(n,300))',setpts=N/(FRAME_RATE*TB)" -r 60 -an -c:v libx264 -preset ultrafast -crf 20 -pix_fmt yuv420p $outputFilename
@itorr
itorr / itorr-anime-shooting.py3
Last active February 19, 2024 18:12
根据动画分镜头自动截图
# pip install opencv-python
# pip install opencv-contrib-python
# pip install PIL
import cv2
import os
def compare_images(image1, image2):
similarity_score = cv2.matchTemplate(image1, image2, cv2.TM_CCOEFF_NORMED)[0][0]
@itorr
itorr / white-album-2.html
Last active February 11, 2023 05:51
白色相簿2 Logo with CSS
<!DOCTYPE html>
<meta charset="utf-8">
<title>WA2</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style>
html{
background:#e6f9ff;
}
@itorr
itorr / bezier-point-grip.js
Last active January 27, 2016 07:25
通过前后两点计算中心点三次贝塞尔平滑时的手柄位置
var
calc={};
//通过两点计算斜率
calc.slope=function(A,B){
return (B.y-A.y)/(B.x-A.x);
};
//通过斜率+单点计算截距