Ubuntu – How to set duration for avconv

avconvffmpegvideo

I'm trying to cut a portion from an mp4 video with avconv, but it doesn't seem to care about the -t param.

My command line is

avconv -t 10 -i GOPR0001.MP4 cut.MP4

This will process the whole video. At the same time ffmpeg works as expected with

ffmpeg -t 10 -i GOPR0001.MP4 cut.MP4

Creating a 10 sec video.

I'm using avconv version 0.8.6-4:0.8.6-0ubuntu0.12.04.1.

Best Answer

I can reproduce this issue (trying to use avconv to convert 20 seconds of internet radio stream into a wav file). So here's a fix which worked for me: simply permute the -t and -i options!

In your case, I'm suggesting trying

ffmpeg -i GOPR0001.MP4 -t 10 cut.MP4

I'm also suggesting that someone files a bug report.

EDIT: in fact it's not a bug -- it's a feature!

https://bugzilla.libav.org/show_bug.cgi?id=399

Apparently the bug was in ffmpeg ;-) The logic is apparently that -t is an output option, so should go after the input options. Go figure.