사용자 도구

사이트 도구


subtitle_helper

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판 양쪽 다음 판
subtitle_helper [2014/10/28 00:44]
kwon37xi
subtitle_helper [2014/10/28 00:51]
kwon37xi
줄 48: 줄 48:
 ====== smi time sync ====== ====== smi time sync ======
 smi 파일의 시간을 싱크한다. smi 파일의 시간을 싱크한다.
-<code groovy> +%gist(4039b27f9c04baf050ca)%
-if (args.length < 2+
- println "Usage groovy smi_timing filename milliseconds-to-adjust [encoding:default cp949]" +
- System.exit(-1) +
-+
- +
-def smi = new File(args[0]) +
-def millis = Long.parseLong(args[1]) +
-def encoding = args.length == 3 ? args[2] : "cp949" +
- +
-println "$smi, $millis, $encoding" +
- +
-def text = smi.getText(encoding) +
-def converted = text.replaceAll(/Start=([0-9]+)/) { +
- "Start=" + (Long.parseLong(it[1]) + millis) +
-+
- +
-smi.setText(converted, encoding) +
-</code> +
subtitle_helper.txt · 마지막으로 수정됨: 2015/10/04 23:29 저자 kwon37xi