Sample Header Ad - 728x90

Trimming a video using FFmpeg leads to black screen

0 votes
1 answer
226 views
I try to figure out how to use FFmpeg to trim videos. I have created a 30 second .mov screen capture using Apple's QuickTime player, and then tried to trim it using three different ways: 1. Using -copyts, without re-encoding
ffmpeg -copyts -ss 00:00:10 -i input.mov -to 00:00:15 -map 0 -c copy output.mov
2. Using -copyts, with re-encoding
ffmpeg -copyts -ss 00:00:10 -i input.mov -to 00:00:15 -c:v libx264 -crf 23 -c:a aac -b:a 192k output.mov
3. Using -trim (with re-encoding, which is the only option):
ffmpeg -i input.mov -vf trim=10:15 output.mov
No matter which approach I tried, the output video is always 15 seconds long and the first 10 seconds of that is just a black screen, whereas what I expected is a 5-second video and without the black screen. All the three solutions are from here: https://superuser.com/questions/377343/cut-part-from-video-file-from-start-position-to-end-position-with-ffmpeg (answers by [@slhck](https://superuser.com/users/48078/slhck) and [@malat](https://superuser.com/users/106444/malat)) , and are very high-voted, so I expect they should work without issues, but they don't. Why is that? Is there a problem with the commands, or with the video? The video is uploaded here: https://github.com/jsx97/test/blob/main/input.mov
Asked by jsx97 (1347 rep)
Jun 11, 2024, 03:35 PM
Last activity: Jul 14, 2024, 02:11 AM