FFMPEG
설치
<source lang="bash"> sudo apt install ffmpeg </source>
이미지 크기변경
- 320x240으로 변경하기
<source lang="bash"> ffmpeg -i input.avi -vf scale=320:240 output.avi </source>
- 이미지도 변경 가능하다
<source lang="bash"> ffmpeg -i input.jpg -vf scale=320:240 output.png </source>
- 비율 유지를 하고싶다면
<source lang="bash"> ffmpeg -i input.jpg -vf scale=320:-1 output.png </source>
- 늘이기나 줄이기
- iw는 input의 넓이, ih는 input의 높이
<source lang="bash"> ffmpeg -i input.jpg -vf scale=iw*2:ih output.png ffmpeg -i input.jpg -vf scale=iw*.5:ih*.5 output.png </source>
- 아예 수식을 집어넣을수도 있다.
<source lang="bash"> ffmpeg -i input.jpg -vf scale="'if(gt(a,4/3),320,-1)':'if(gt(a,4/3),-1,240)'" output.png </source>