Using ffmpeg to change frame rate

I am trying to convert a video clip (MP4, yuv420p) from 30 frames per second to 24 frames per second. The number of frames is correct, so my output should change from 20 minutes at a speed of 30 frames per second to 25 minutes at a speed of 24 frames per second. Everything else should remain unchanged.

Try to ensure that everything I try to use with ffmpeg converts the frame rate, but changes the number of frames while keeping the same duration, or changes the duration without changing the frame rate.

So, I usually tried things like this:

ffmpeg -y -r 30 -i seeing_noaudio.mp4 -r 24 seeing.mp4

(I do it on windows, but usually it will be on linux). This converts the frame rate, but reduces the frames, so the total duration does not change.

Or I tried

ffmpeg -y -i seeing_noaudio.mp4 -filter:v "setpts=1.25*PTS" seeing.mp4

Which changes the duration, but not the frame rate.

, ffmpeg .

+28
5

:

ffmpeg -y -i seeing_noaudio.mp4 -vf "setpts=1.25*PTS" -r 24 seeing.mp4

:

- -

ffmpeg -y -i seeing_noaudio.mp4 -c copy -f h264 seeing_noaudio.h264

ffmpeg -y -r 24 -i seeing_noaudio.h264 -c copy seeing.mp4
+32

"-r" :

ffmpeg -y -r 24 -i seeing_noaudio.mp4 seeing.mp4

. "-r" , , . . avifrate.exe avi . ffmpeg, , , .

+7

, ffmpeg . 24 , 25 , , . ffmpeg -i inputfile -r 25 outputfile webm, matroska h264, matroska : Lavc56.60.100

6 , , , ( , ). , , , , .

, . , :

#!/bin/bash
#This script will decompress all files in the current directory, video to huffyuv and audio to PCM
#unsigned 8-bit and place the output #in an avi container to ease frame accurate editing.
for f in *
do
ffmpeg -i "$f" -c:v huffyuv -c:a pcm_u8 "$f".avi
done

, , , , . , , .

+2

, .

ffmpeg -i input.mp4 -r 24 output.mp4
0

fps. :

ffmpeg -i <input> -filter:v fps=fps=30 <output>

fps 59.6 30.

0
source

All Articles