HowTo: Cut a video directly with ffmpeg, without re-encoding

You only need the -ss and -t options. -ss is the starttime and -t the duration, so if you want 10 seconds from a video starting from minute one, you would use this.

ffmpeg -i INFILE.mp4 -vcodec copy -acodec copy -ss 00:01:00.000 -t 00:00:10.000 OUTFILE.mp4

You can use seconds or hh:mm:ss[.xxx] as arguments for the start time and duration, i prefer the second option.
The options -vcodec copy and -acodec copy are used to only cut the video and disable the re-encoding, this really speed things up. 😉

16 thoughts on “HowTo: Cut a video directly with ffmpeg, without re-encoding

  1. This command is Best of all sort of solutions I was seeking for. Thanks dude a lot. This was what I was looking for, without installing anything new on my system, and without losing the original video by encoding.

  2. when the “from”(start_seconds) variable is larger than 107seconds it doesn’t work for me. I run this:
    ffmpeg -ss 00:02:47.0 -t 00:00:30.0 -i tamta.wmv -acodec copy -async 1 carolTest2.wmv
    and the video isn’t created correct.i just hear a sound for 1second with no video. did i do something wrong?
    generally all commands don’t work when start_seconds are larger than 107 seconds

    1. This command-line is actually wrong: you need to put the -ss before the -i or ffmpeg will report success but produce a corrupt file.

      1. This gave me troubles until i found your post, I put -ss first and it worked perfectly x

        ffmpeg -ss 00:00:00 -i input.mp4 -vcodec copy -acodec copy -t 02:51:23 output.mp4

  3. Hm, this is not the first time that I read this blogpost. It was always exactly what I was looking for. Maybe I should bookmark it. But google also finds it reliably.

  4. Synopsis:
    ffmpeg -i [input_file] -ss [start_seconds] -t [duration_seconds] [output_file]

    **use FFmpeg cut mp4 video without re-encoding**

    Example:
    ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -c copy cut_video.mp4

    **use FFmpeg cut mp4 video with re-encoding**

    Example:
    ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -async 1 -strict -2 cut_video.mp4

    To see more detailed, see this post [How to cut video with FFmpeg on windows 7][1]

    [1]: http://www.sthshare.com/wordpress/how-to-cut-video-with-ffmpeg-on-windows-7.html

  5. So, I noticed the cut file is actually transcoded from the source file. Any way to accomplish this without the transcoding? I really just need to extract 3 minutes from a long video — without modifying the original encoding.

  6. Thank you so much for this! However, I noticed that using this line directly as given leaves off the first few seconds of the segment I’m trying to cut out. Using sgcdffd’s suggestion to put the -ss before the -i gave the more accurate start time and recording time for me.

    This is what worked better for me:

    ffmpeg -ss 00:01:00.000 -t 00:00:10.000 -i INFILE.mp4 -vcodec copy -acodec copy OUTFILE.mp4

Leave a reply to caroline Cancel reply