How to cut part of mp4 video using ffmpeg without losing quality?

25,869
ffmpeg -i 40minvideo.mp4 -t 1500 -acodec copy -vcodec copy 25minvideo.mp4

-t 1500 processes the first 1500 seconds (25 min * 60 sec/min)

-acodec copy and -vcodec copy copy the codec data without transcoding (which would incur quality loss).

Share:
25,869
user1788736
Author by

user1788736

Updated on March 26, 2020

Comments

  • user1788736
    user1788736 over 4 years

    hi all i got an mp4 video using ffmpeg but now i want to cut part of this mp4 . For example i only want first 25 min of the mp4 video from 40 min video. could you guys tell me what command i can use in ffmpeg for windows to achieve this task ?

    ffmpeg 40minvideo.mp4

  • llogan
    llogan over 11 years
    Alternatively, -t 00:25:00 can be used. If the input contains additional video and audio streams then -map 0 can be added to also copy these since ffmpeg by default will copy only video stream with the highest resolution and the audio stream with the most channels.