[FFmpeg-user] How to change video fps from 29.970 to 25?

Damian Głodny damian at artnmedia.pl
Fri Aug 29 09:01:46 CEST 2014


Hello, from a couple of days I am fighting with problem of fps conversion
with ffmpeg. I discovered that conversion from 23.976fps to 25fps is easy
and we can do it by speed up input video by 4%. Here I share how I did this
with ffmpeg filter (maybe someone will need it too):

 

-filter_complex "[0:v]setpts=24/25*PTS[v];[0:a]atempo=25/24[a]" -map "[v]"
-map "[a]" -r 25

 

Converted 23.976fps video with that filter will have 25fps and playback will
be smooth, great!

 

Unfortunately I dont have idea how I can convert video from 29.970 fps to 25
using ffmpeg. I think it should be done in two steps:

   1. Convert from 29.970 to 23.976. 

       This technique is called inverse telecine(?), but I dont have idea
how I can do it correctly with ffmpeg. 

       I tried many ffmpeg filters like pullup, telecine, fieldmatch,
decimate, but my output video always stuttering.

       Can someone help me with it?

 

  2. Convert from 23.976 to 25 by speed up video by 4%.

 

What do you think?

 

 

 

Here is console output for example video which I want to convert to 25fps
(but I need to convert other videos too, this one is my guinea pig):

 

ffmpeg -i da-foundraising-foundations-29.970fps.mp4

 

ffmpeg version N-65895-g96b2ba6 Copyright (c) 2000-2014 the FFmpeg
developers

  built on Aug 25 2014 22:10:37 with gcc 4.8.3 (GCC)

  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av

isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enab

le-iconv --enable-libass --enable-libbluray --enable-libbs2b
--enable-libcaca --

enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc
--enable-lib

modplug --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrw

b --enable-libopenjpeg --enable-libopus --enable-librtmp
--enable-libschroedinge

r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame
--en

able-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis

--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264
--enable-

libx265 --enable-libxavs --enable-libxvid --enable-decklink --enable-zlib

  libavutil      54.  7.100 / 54.  7.100

  libavcodec     56.  0.101 / 56.  0.101

  libavformat    56.  3.100 / 56.  3.100

  libavdevice    56.  0.100 / 56.  0.100

  libavfilter     5.  0.103 /  5.  0.103

  libswscale      3.  0.100 /  3.  0.100

  libswresample   1.  1.100 /  1.  1.100

  libpostproc    53.  0.100 / 53.  0.100

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
'da-foundraising-foundations-29.970fps.m

p4':

  Metadata:

    major_brand     : mp42

    minor_version   : 0

    compatible_brands: mp42mp41isomavc1

    creation_time   : 2013-02-23 19:26:52

  Duration: 00:13:28.74, start: 0.042667, bitrate: 2654 kb/s

    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1280x720,

2492 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 59.94 tbc (default)

    Metadata:

      creation_time   : 2013-02-23 19:26:52

      handler_name    : L-SMASH Video Handler

      encoder         : AVC Coding

    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 15

7 kb/s (default)

    Metadata:

      creation_time   : 2013-02-23 19:26:52

      handler_name    : L-SMASH Audio Handler

 

 

Thank you for your time.

 

 

---

Cheers!

 



More information about the ffmpeg-user mailing list