I'm having trouble finding a cli application that can take a video file (avi, mkv, and mp4 preferably) and cut out very short clips (2-6 seconds) with precision time accuracy. I've tried ffmpeg, mencoder, avidemux, and mp4box but they all cut on keyframes which creates 6+ second clips. Is there a tool that will re-encode the input file and cut the accurate time or cut inaccurately, re-encode, and then cut accurately?
You can accurately cut videos with FFmpeg. Note that the order of input options is important.
This would for example cut 5 seconds, starting from 5 minutes, 3 seconds and 123 milliseconds.
Read the input options from left to right: First the input will be decoded, then it will start encoding, and it'll output video at the time specified by
This, however, will not work accurately:
FFmpeg will try to estimate the starting position without actually decoding the video, which will always be inaccurate. See also: