Skip to content

Instantly share code, notes, and snippets.

View macfanr's full-sized avatar
🙂
I may be slow to respond.

Danny macfanr

🙂
I may be slow to respond.
View GitHub Profile
@macfanr
macfanr / videoshot.sh
Last active October 28, 2016 03:58
video shots with ffmpeg
#!/bin/sh
function random()
{
duration=`./ffmpeg -i "${file}" 2>&1 | grep "Duration"| cut -d ' ' -f 4 | sed s/,// | sed 's@\..*@@g' | awk '{ split($1, A, ":"); split(A[3], B, "."); print 3600*A[1] + 60*A[2] + B[1] }'`
# echo "$duration"
min=15
if [ $duration -gt $min ]
then
@macfanr
macfanr / removelogo.sh
Last active July 2, 2017 11:40
remove logo with ffmpeg
#!/bin/sh
if [ $# != 2 ]; then
echo "usage: videoshot.sh /Users/danny/MyVideoDir /Users/danny/MyOutputDir"
exit -1
fi
inputDir=$1
outputDir=$2
binaryEXE=./ffmpeg
@macfanr
macfanr / hide desktop icon
Last active January 16, 2018 09:47
hide desktop icon
hide:
defaults write com.apple.finder CreateDesktop -bool false && killall Finder
unhide:
defaults write com.apple.finder CreateDesktop -bool true && killall Finder
@macfanr
macfanr / view process arguments
Last active January 17, 2018 05:26
查看其它进程命令行参数
ps ax | grep ffmpeg
@macfanr
macfanr / change install name.txt
Last active January 17, 2018 05:27
install name
1. install_name_tool -id new/install/name.dylib libso.dylib //change install name
2. install_name_tool -change old_name new_name libso.dylib //change dependence
3. otool -L libso.dylib //display install name and dependence
4. otool -D libso.dylib //display install name of libso.dylib
注意: 在xcode project中写脚本修改install name 会造成sandbox之后运行奔溃,原因在于copy的时候对dylib签名,然后又去修改dylib内容(change install name),这样中破坏了之前的签名,所以会奔溃
lldb ffmpeg -- -i file.mp4 -c:v libx264 -an ./out.mp4
codesign -d --entitlements :- /Applications/Whatever.app/
[[NSUserDefaults standardUserDefaults] setObject:@[@"en_US"] forKey:@"AppleLanguages"];
http://www.dyndns.org/cgi-bin/check_ip.cgi
1. install meson
brew install meson
2. set min version
export CFLAGS="-mmacosx-version-min=10.9" before exe 'meson ./build_dir'
tccutil reset ScreenCapture com.company.appname //reset warnning
tccutil reset All com.company.appname
sudo xattr -d com.apple.quarantine /Applications/xxxx.app //app is damaged, ...move to track