일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- 막걸리
- 산체스
- 당구
- 옆돌리
- 휴일 저녁
- 3쿠션
- 홍종흔 베이커리
- 수구 진행
- 장수 생 막걸리
- LPBA
- 4대천왕
- 앞돌리기 길게 돌리기
- PBA
- 중복
- 쿠르망
- 빌리어드
- 유두절
- 파이브앤하프
- 스롱 피아비
- 미국항공권 # LA
- 초복
- 캐롬
- 문동주
- 앞돌리기
- LA숙소추천
- 홍종흔 베이커리 군포
- 아시아나기내식
- 서초동 막걸리
- 스트록
- 유시민 인물
- Today
- Total
봄 여름 가을 겨울 스포츠 막걸리
ffmpeg 본문
crop
720x720으로 자르기
ffmpeg -i {input.file} -filter:v "crop=720:720" {out.file} |
720x720으로 and time 자르기
ffmpeg -i {input.file} -ss 00:00:02 -t 00:00:10 -filter:v "crop=720:720" {out.file} |
resize
720x720으로 줄이기(비율 유지)
ffmpeg -i {input.file} -s 720x720 -c:a copy {out.file} |
trim
시작 : 1초
기간 :3초
-c copy : 스트림 복사를 통해서 트리밍 하는 방식으로 매우 빠름(resize나 crop와는 사용되지 않을 듯..)
ffmpeg -i {input.file} -ss 00:00:01 -t 00:00:03 -c copy {out.file} |
total
수정 필요
ffmpeg -i {input.file} -filter:v "crop=720:720" -ss 00:00:01 -t 00:00:03 -s 720x720 -c:a copy {out.file} |
ffmpeg -i {input.file} -vf "scale=720:-1, crop=720:720" -ss 00:00:01 -t 00:00:03 -c copy {out.file} |
reference
I am trying to do three tasks with FFMPEG
Crop a video without losing quality
Resize (upscale) the cropped video with good quality
Cut specific part of a the upscaled vided without losing quality
Here are the command line I use:
to crop: video og.mp4 to video og1.mp4
ffmpeg -i og.mp4 -vf "crop=1330:615:22:120" -c:v libx264 -crf 1 -preset veryslow -c:a copy og1.mp4
to resize: video og1.mp4 (converted above) to video og2.mp4
ffmpeg -i og1.mp4 -vf scale=1920:-1 -c:v libx264 -crf 1 -preset veryslow -c:a copy og2.mp4
to cut: video og2.mp4 (converted above) to og3.mp4
ffmpeg -i og2.mp4 -ss 00:00:08.190 -t 00:00:11.680 -c:v libx264 -crf 1 -preset veryslow -c:a copy og3.mp4
I want to achieve highest quality of 1920 width video (irrespective of height and size of the file)
Is there a way to get the above tasks in one command or shorter time with best quality?
Also advice if there is a better command or parameters to be used.
Thanks
You can combine all commands by using a single filterchain, and adding the trim as well
ffmpeg -ss 8.190 -t 11.680 -i og.mp4 -vf "crop=1330:615:22:120,scale=1920:-2" -c:v libx264 -crf 1 -c:a copy og1.mp4
'개발 > linux' 카테고리의 다른 글
gitlab push and build (0) | 2020.06.15 |
---|---|
image size 조절하기 (0) | 2019.07.18 |
대량의 파일 이름 바꾸기 (0) | 2019.07.02 |