FFMPEG Splitting MP4 with Same Quality
If you want to just split the video without re-encoding it, use the copy
codec for audio and video. Try this:
ffmpeg -ss 00:00:00 -t 00:50:00 -i largefile.mp4 -acodec copy \
-vcodec copy smallfile.mp4
Note that this only creates the first split. The next one can be done with a command starting with ffmpeg -ss 00:50:00
.
This can be done with a single command:
ffmpeg -i largefile.mp4 -t 00:50:00 -c copy smallfile1.mp4 \
-ss 00:50:00 -c copy smallfile2.mp4
This will create smallfile1.mp4
, ending at 50 minutes into the video of largefile.mp4
, and smallfile2.mp4
, starting at 50 minutes in and ending at the end of largefile.mp4
.
An Alternate way of doing it is:
Create a 2-min clip, starting after 10 minutes:
ffmpeg -i input.mp4 -ss 00:10:00 -to 00:12:00 -c copy output.mp4
-i
input file-ss
start time in seconds or in hh:mm:ss-to
end time in seconds or in hh:mm:ss-c
codec to use
The quality of the file stays the same because we use -c copy
to copy the original audio + video streams to the output.
Reference, List of commonly used FFmpeg commands: DigitalFortress