![ffmpeg를 사용하여 비디오의 선분을 자르는 방법은 무엇입니까?](https://linux55.com/image/139732/ffmpeg%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EC%97%AC%20%EB%B9%84%EB%94%94%EC%98%A4%EC%9D%98%20%EC%84%A0%EB%B6%84%EC%9D%84%20%EC%9E%90%EB%A5%B4%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
ffmpeg를 사용하여 긴 비디오에서 비디오를 잘라내고 싶습니다. 다음 명령을 사용합니다.
ffmpeg -i /home/nantembo/VideoPerl/1.mp4 -f avi -vcodec copy -acodec copy -ss 0:14:47 -t 0:58:55 /home/nantembo/VideoPerl/2.mp4
하지만 내가 수신하는 비디오 지속 시간은 58:55분이고 시작 위치는 0:14:47 + 0:44:08이지만 다음과 같은 경우 비디오를 수신해야 합니다.
- 0:14:47 시작
- 0:58:55에 종료됨
어떻게 해야 하나요?
답변1
ffmpeg
매뉴얼 에 따르면 -t
옵션은 다음과 같습니다.기간,아니요시간의 최대.
나는 당신이 다음 옵션을 찾고 있다고 생각합니다 -to
.
-to position (output)
Stop writing the output at position. position must be a time duration specification, see the Time
duration section in the ffmpeg-utils(1) manual.
-to and -t are mutually exclusive and -t has priority.
따라서 귀하의 경우 명령은 다음과 같습니다.
ffmpeg -i /home/nantembo/VideoPerl/1.mp4 -f avi -vcodec copy -acodec copy -ss 0:14:47 -to 0:58:55 /home/nantembo/VideoPerl/2.mp4