개발 블로그 만들었습니다

https://www.nuridol.net

앞으로는 여기에 개발 관련 이야기를 적을 예정입니다.
지금까지 봐주셔서 감사합니다.

by NuRi | 2020/12/13 18:43 | 잡담 | 트랙백 | 덧글(0)

ScummVM Kor 2.1.0 만들어 봤습니다


일년에 한번씩 찾아오는 에뮬의 계절입니다.
스위치 대응도 추가했지만 실기기가 없어서 테스트해보진 못했습니다.

여기에 안드로이드, 맥, 스위치, 윈도용 빌드 파일이 있습니다.


다른 OS는 직접 빌드해서 사용하세요.

안드로이드 가상키 사용법은 https://wiki.scummvm.org/index.php/Android-SDL 여기 참조하세요.

by NuRi | 2019/10/21 21:13 | 잡동사니 창고 | 트랙백 | 덧글(5)

ffmpeg로 동영상 자르는 오토메이터 애플스크립트

동영상 일부 자르려고 프로그램 쓰는게 귀찮아서 애플스크립트로 짜봤습니다.


on run {input, parameters}
    #try # encoding
# CHANGE IT
set OUT_DIR to "/Users/XXX/Movies/"
set OUT_SUFFIX to "_cutting"

    set start_time to "00:00:00"
    set end_time to start_time
    repeat with thisItem in input
        repeat while start_time ≥ end_time
            # input time
            set start_time to display dialog "Input START time" default answer start_time with icon note buttons {"Continue"} default button "Continue"
            set start_time to (text returned of start_time)
            #set end_time to get value of variable "end_time" of front workflow
            set end_time to display dialog "Input END time" default answer start_time with icon note buttons {"Continue"} default button "Continue"
            set end_time to (text returned of end_time)
            if end_time ≤ start_time then
                display dialog "Try again!" with icon caution buttons {"OK"} giving up after 1
            end if
        end repeat
        
        # time diff
        set timestamp1 to words of start_time
        set timestamp2 to words of end_time
        
        set diff_hours to (item 1 of timestamp2) - (item 1 of timestamp1)
        set diff_minutes to (item 2 of timestamp2) - (item 2 of timestamp1)
        set diff_seconds to (item 3 of timestamp2) - (item 3 of timestamp1)
        set time_diff to (diff_hours * 3600) + (diff_minutes * 60) + diff_seconds
        
        # get path to file
        # set inputFile to quoted form of POSIX path of thisItem
        set inputFile to POSIX path of thisItem
        set fileExtension to name extension of (info for thisItem)
        set fileNameBase to text 1 thru -((count of fileExtension) + 2) of (name of (info for thisItem))
        set fileSuffix to OUT_SUFFIX & "."
        set outputFile to POSIX path of (OUT_DIR & fileNameBase & fileSuffix & fileExtension)
        set fileNum to 1
        set status to true as boolean
        repeat while status
            set status to false
            tell application "Finder" to if exists outputFile as POSIX file then set status to true
            if status is true then
                set fileSuffix to (OUT_SUFFIX & fileNum as string) & "."
                set outputFile to POSIX path of (OUT_DIR & fileNameBase & fileSuffix & fileExtension)
                set fileNum to fileNum + 1
            end if
        end repeat
        
        # run ffmpeg for a file
        tell application "Terminal"
            activate
            #display dialog
            do script "/usr/local/bin/ffmpeg -hide_banner -y -ss " & start_time & " -i '" & inputFile & "' -to " & time_diff & " -c copy -avoid_negative_ts 1 '" & outputFile & "'; sleep 1; exit 0"
        end tell
    end repeat
    
    # on error ex
    # error "failed"
    #end try
    
    return input
end run

by NuRi | 2019/07/19 20:45 | 꿈꾸는 Mac | 트랙백 | 덧글(0)