Is it possible to use ffmpeg to trim off X seconds from the beginning of a video with an unspecified length?

Try:

ffmpeg -i input.flv -ss 2 -vcodec copy -acodec copy output.flv

I think the input parameter is supposed to be first.


Turns out this command will trim the video from 2 seconds on, as expected:

ffmpeg -i input.flv -ss 2 -vcodec copy -acodec copy output.flv

The issue was with the keyframe interval in input.flv. It was set to 5 seconds, which yielded 3 seconds worth of black frames at the beginning of the video (5 - 2 = 3). I've since changed my keyframe interval to 1 second, though 2 seconds would probably also yield the desired results in my case.

UPDATE: Updated ordering of -i and -ss parameters per Dave's answer, which I've accepted for credit.


Use -ss and -to before -i like this:

ffmpeg -ss 00:01:10 -to 00:02:10 -i input -c copy output