To extract the first two minutes of a video using FFmpeg commands, you can use the following command:
bashffmpeg -i input_video.mp4 -ss 00:00:00 -t 00:02:00 -c copy output_video.mp4
Here's an explanation of the command:
ffmpeg: Invokes the FFmpeg tool.-i input_video.mp4: Specifies the input file, whereinput_video.mp4is the video file you want to process.-ss 00:00:00: Indicates starting the extraction from the beginning of the video (i.e., 0 hours, 0 minutes, 0 seconds).-t 00:02:00: Specifies a duration of two minutes from the given start position.-c copy: Indicates using the "copy" method to duplicate the video and audio streams, which avoids re-encoding, is efficient, and preserves quality.output_video.mp4: Specifies the output filename.
Using this command, FFmpeg extracts the first two minutes from the input video file and saves it to the new file output_video.mp4. This approach is highly efficient because it bypasses video data re-encoding; it simply copies the data streams.
2024年6月29日 12:07 回复