사용자 도구

사이트 도구


linux:video

문서의 이전 판입니다!


리눅스 동영상

자막 합치기

mencoder -oac copy -ovc lavc -utf8 -font 'Nanum Gothic' -sub "자막파일.srt" -o 결과물 자막_넣을_동영상

동영상 비율 변환(crop)

  • 동영상을 16:9 비율로 변환하기. x → 가로, y → 세로
  • x/y > 16/9 : 가로가 비율보다 길 때 x 길이를 줄여준다.
    new x = x * ((y/9) / (x/16)) = 16/9y
  • x/y < 16/9 : 세로가 비율보다 길 때 y 길이를 줄여준다.
    new y = y * ((x/16) / (y/9)) = 9/16x
  • 가로 비율이 길 때의 left/right crop px 계산 video_169.groovy
    int width = Integer.parseInt(args[0])
    int height = Integer.parseInt(args[1])
     
    if (width/height <= 16/9) {
    	println "no need to crop"
    }
     
    int crop = width - (16.0 / 9.0 * height)
    println "crop left and right ${crop / 2}px"
linux/video.1415798776.txt.gz · 마지막으로 수정됨: 2014/11/12 22:26 저자 kwon37xi