I took a while to find how to trim a video using ffmpeg.
ffmpeg -i video.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:00:04 trimmed_video.avi
Will trim the video to 4 seconds starting from the beginning.
The -vcodec , -acodec options are required so that ffmpeg knows in what video/audio format you want for the new video.