Make sure you download a recent version of
ffmpeg, and don't use the one that comes with your distribution (e.g. Ubuntu). Packaged versions from various distributions are often outdated and do not behave as expected.
Or compile it yourself.
How to cut a video, without re-encoding
Use this to cut video from
ffmpeg -ss [start] -i in.mp4 -t [duration] -c copy out.mp4
Here, the options mean the following:
-ss specifies the start time, e.g.
83 (in seconds)
-t specifies the duration of the clip (same format).
ffmpeg also has a flag to supply the end time with
-c copy copies the first video, audio, and subtitle bitstream from the input to the output file without re-encoding them. This won't harm the quality and make the command run within seconds.
How to cut a video, with re-encoding
If you leave out the
-c copy option,
ffmpeg will automatically re-encode the output video and audio according to the format you chose. For high quality video and audio, read the x264 Encoding Guide and the AAC Encoding Guide, respectively.
ffmpeg -ss [start] -i in.mp4 -t [duration] -c:v libx264 -c:a aac -strict experimental -b:a 128k out.mp4