Using FFMPEG I get an error when trying to insert a fade after about 35 mins in a long video - is this possible?

时间:2019-04-08 13:01:38

标签: ffmpeg

I have a source video that is an hour long from which I want to extract a couple of minutes towards the end and add a video fade in at the start of the cropped section.

Using FFMPEG, I'm specifying the following command:

ffmpeg -i MyLongVideo.mp4 -q:v 0 -y -ss 00:50:00.000 -to 00:52:00.000 -vf "fade=t=in:st=3000.0:d=1.0, scale=iw*min(1280/iw\,720/ih):ih*min(1280/iw\,720/ih),pad=1280:720:(1280-iw)/2:(720-ih)/2" ./testoutput.ts

This is intended to crop from the source video from 50:00.000 to 52:00.00 and fade in from the 50th minute for 0.5 seconds (so at 3000 seconds in - st=3000.0).

This command that we build programmatically, works on shorter videos or when you crop from before about 35 minutes. For this longer video though I get an error that says:

[fade @ 0000025399981e80] Value 3000.000000 for parameter 'st' out of range [0 - 2147.48]

The 2147.48 is around the 35 minutes in seconds which explains why this command works for shorter videos or on crops earlier than 35 minutes.

I've seen a number of other issues with FFMPEG talking about this 'magic' 2147.48 number with parameter values. Is this some sort of hard limit?

Is there a way to do what I want to do? I could do this in two passes - extract the section of video and then add the fade, but I'd rather do it in one command if possible - and it works for shorter/earlier crops.

1 个答案:

答案 0 :(得分:1)

从2018年11月12日之后或2018年10月7日之前获取ffmpeg版本。之间存在版本回归。