[FFmpeg-user] Dropping 1 frame every n seconds

Steve steve at aatw.com
Mon Jun 1 00:51:54 CEST 2015


On 31 May 2015, at 23:18, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Sun, May 31, 2015 at 14:38:02 +0200, Paul B Mahol wrote:
>> Dana 31. 5. 2015. 11:46 osoba "Steve" <steve at aatw.com> napisala je:
> 
>>> At 25fps, dropping 1 frame would allow the the audio to be pitched/time
>> stretched by 4% and dropping 1 frame every 2 seconds would allow for 2%
> 
>> See select and framestep filter documentation.
> 
> (I may be wrong, but:)
> 
> This isn't complete, the video won't play faster after dropping the
> frames, due to the timestamps of the retained frames. I think that
> after dropping one in N frames, you need to increase the speed using
> the setpts filter with a factor of (N-1)/N.
> 
>  setpts=24/25*PTS
> 
> Just figuring this out from the top of my head, it's late. ;-)
> 

Hi Moritz,

Sorry I probably should have explained better, I don’t just want to drop the frame and leave it blank or adjust the frame rate from 25 to 24fps. Essentially I want to remove it, then bring the following frames forward one frame to fill it’s place. So the 25fps rate is maintained, but every nth second, one frame is dropped and the adjacent frames brought forward by one frame. I hope this will allow the picture to keep in sync with the sound once the audio is speeded up.

I guess I could a/ export to an image sequence b/ delete the relevant frames c/ renumber the remaining frames to be sequential and then d/ re-encode it at 25fps with the modified audio but I wonder if that approach is overkill and whether a filter can be configured to do it?

One other thing I forgot to add, the source is all i-frame only so no problem with dropping or moving p or b frames

Many Thanks

Steve


> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list