Skip to content

Instantly share code, notes, and snippets.

@zhangliyong
Last active November 22, 2017 09:28
Show Gist options
  • Save zhangliyong/0a1b2da8541e1428acf96614bc7ac539 to your computer and use it in GitHub Desktop.
Save zhangliyong/0a1b2da8541e1428acf96614bc7ac539 to your computer and use it in GitHub Desktop.
snippets
ffmpeg -f concat -safe 0 -i <(printf "file '$PWD/%s'\n" ./*.wav) -c copy output.wav
brew install ffmpeg --with-libass
ffmpeg -i video.avi -vf "ass=subtitle.ass" out.avi
perl -nle '$data{$1}++ if /"status":(\d+)/; END { print "$_ $data{$_}" for (keys %data) }' tao.log-20170803
perl -ne 'print if /submit an apply/' tao.log-20170803 | wc -l
pcregrep -n -M "[a-z][^\n]*\n\n" *.srt
perl -i -0777 -pe "s/(.+?)\n(.+?)\n^M?\n/\2\n\1\n\n/g" *.srt
^M is C-V C-M
for i in es/*.srt
do
opencc -i "$i" -o "et/$(basename $i)" -c ~/s2tw.json
done
for i in *.srt
do
iconv -f "CP936" -t "UTF-8" "$i" > "se/$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment