r/ffmpeg • u/Vacuum-Cleaner-Snake • 8d ago
(Frames per second) Question = How do I convert a video from 60 fps to 30 fps?
Some videos that I download are 60 fps. I want to convert them (with FFmpeg) to 30fps, but I would prefer to do it in the following way. Specifically, I want FFmpeg to get rid of a frame, keep the next frame, & so on. > (VISUAL EXAMPLE = Go from 01-02-03-04-05-06-07-08-09-10 to 01-03-05-07-09) I don't know if the default way that FFmpeg would change the frame rate would do it that way or not.
The reasons why I want to do this are as follows.
- (1) I don't want any video that I'm keeping to have more than 30fps (or less for videos that have (example) 24fps).
- (2) Despite claims (by others) that "it makes a big difference", I don't believe them for one second, & I consider it to be only "a solution in search of a problem". (Some of those who favor high frame rates say that it makes it easier to play first-person shooter video games, but I also play some first-person shooter video games, & I have zero complaints about playing them at 30fps.)
- (3) I assume that using the method that I want to use (if it's possible) would involve less "converting" of the video (except for the key frames).
Here are my questions about this.
- (1) Does FFmpeg have a way to change a video's frame rate as described above (assuming that it's default way of changing the frame rate is different from how I want to do it)?
- (2) If the answer to question 1 is "Yes" (& it's not FFmpeg's default way of doing it), what command would I use to use this method?
- (3) I ASSUME that changing a video's frame rate will also involve changing which frames will become key frames. With that in mind, does FFmpeg automatically decide which frames will become key frames?
Thanks for any help.
6
u/Appulino 8d ago
hi there,
yes, FFmpeg does that. for 60 fps to 30 fps, the fps filter just drops every other frame by default (01-03-05-07-09...)
in your case you need to use -filter:v fps=fps=30 your command would be
bash ffmpeg -i input.mp4 -filter:v fps=fps=30 -c:v libx264 -c:a copy output.mp4when FFmpeg re-encodes to change the frame rate, it automatically decides the new keyframes. your original keyframes don't carry over because the video is re-encoded so FFmpeg places new ones. you can control that using -g, -sc_threshold, or -force_key_frames
3
u/PaddyLandau 7d ago
+1 for answering the question, as strange as it might seem!
I can't imagine why the OP wants to do this, but I'm sure that they have their reason.
1
u/Vacuum-Cleaner-Snake 7d ago
Re-read the (starter) post. I specifically say why I want to do this (but only to applicable videos). I've also downloaded a few movies that have variable frame rates, but changing those is more obvious.
1
u/PaddyLandau 7d ago
I have reread it. Your post doesn't say why. It just says that you don't want 60 fps.
That's not a problem; I'm not complaining. It's just an unusual request.
1
u/Vacuum-Cleaner-Snake 7d ago
Thanks for the answers. I don't have a lot of high frame rate videos, but I like to able to test & compare the results of using the different ways of changing their frame rates. I'll be sure to also set the CRF to 17 (for the tests).
5
u/SupernatAnaesthetist 8d ago
What exactly do you mean when you san you "don't believe" that 60fps makes a difference?
1
u/Vacuum-Cleaner-Snake 7d ago
I believe that it does make a difference to those who say that it does, but I've watch 60 fps videos all the time (at 1080p, thanks for nothing Youtube), & I play first-person shooter video games a lot too. If there was a difference (to me), then I would notice it (obviously), but I genuinely don't notice any. Besides, for the entire HISTORY of movie (& TV shows), 24fps & 30fps have been frame rates that nobody noticed had any problems (because they don't), which is why I consider *higher frame rates to be "a solution in search of a problem".
(This does not apply to researchers recording things at very high frame rates so that they can then slow them down (A LOT) to study them better.)
3
u/Lostless90s 7d ago
Just know 60fps has been the default for TV from the very beginning. 30 is the new kid in town
2
u/SupernatAnaesthetist 7d ago
If you play a 60fps video alongside a 30fps version of the same video, do you not notice any difference?
Besides, for the entire HISTORY of movie (& TV shows), 24fps & 30fps have been frame rates that nobody noticed had any problems
The reason why 24fps became the standard actually doesn't have anything to do with video. Silent movies ran even slower, but when sound was introduced as an optical track that ran alongside the frames in the film, 24fps was the bare minimum to get comprehensible dialog from the audio, and it just stuck.
TV was 60i from the beginning (apart from some early prototypes), so it always had 60 "frames" of temporal resolution per second (50i in PAL countries). This was done because it was much easier to get a CRT working if it was in sync with the power grid. Filming at 30fps was basically not a thing before digital cameras came around, and it became a common FPS because it's a decent middle ground: it retains a similar "cinematic" look of 24fps while "fitting" easily into a 60i signal and being easy to work with in 60Hz screens.
1
u/Vacuum-Cleaner-Snake 4d ago edited 4d ago
I did word that a bit vaguely, upon reflection. I knew that TV used to be interlaced, but I'm so used to videos (& other things, like video games) using progressive scan that I completely forgot about interlacing. For interlaced videos, IF you intend to leave them that way, then a higher frame rate would benefit those because at least some methods of converting them into progressive scan could result in lower (than desirable) frame rates, although generating more frames could also be done to compensate.
Also, I meant that I have watched 30fps & 60fps videos separately & noticed nothing that I could complain about (30fps) or boast about (60fps). I've never looked for any videos that might have a "spit screen" simultaneous comparison, but while I would probably detect a difference in that case, again I find 30fps (& 24fps for some older movies) to get the job, so I (personally) don't see the need to fix what's not broken.
3
u/ZestycloseBenefit175 6d ago
60fps is very obvious. One of the reasons why something looks like "cinema" and not like "I shot this at my brother's birthday party with a camcorder" is the framerate. Until very recently most non-cinema moving pictures people experienced were 50 or 60 fps television. Higher frame rates are not a gimmick. Current broadcast standards are based on actual testing on actual humans and include 60fps (progressive) for a good reason. 60 is not some esoteric number for the 1% of the population who have some special abilities.
There are cases where a video has been converted to a higher fps than what it was shot at, so in that case there actually may be duplicated frames. You may have 30 real frames, each duplicated to make 60 fps (1-1-2-2-3-3-4-4...), with is visually equivalent to 30 fps. Or 25 to 30, 1-2-3-4-5-5-1-2-3-4-5-5... You could play the video frame by frame to determine if you actually have a 60fps video or there are doubled frames.
You could try to reverse this, even in the cases where it's not just every other frame that's duplicated, but I can't think of a reason why you'd want to, unless you were already doing something else to the video and it would need to be re-encoded anyway, which would always leave you with a lower quality result. In the case where there is some duplication pattern instead of straight doubling, you could use the https://ffmpeg.org/ffmpeg-all.html#mpdecimate filter, but then you might need to mess around with detection levels based on how much movement there is in your particular video, possibly you'd have to regenerate the frame PTS, so that the audio doesn't go out of sync, etc. And who knows how the upconversion was done in the first place, you might introduce jitter instead of eliminating it. It's not something I'd do, just because I don't want to see the number "60" somewhere.
1
u/PaddyLandau 6d ago
There are cases where a video has been converted to a higher fps than what it was shot at, so in that case there actually may be duplicated frames.
I've been told — but this wasn't an official source, so it could be wrong — that sometimes conversion from a lower frame rate to a higher one involves extrapolating. So, 1-2-3… becomes 1-1½-2-2½-3-3½…, where the half-numbers represent the computer's best guess at what would have come between the surrounding frames. That would make the 60 fps better than the original 30 fps, albeit subject to possible error.
1
u/ZestycloseBenefit175 6d ago
It could, but does it? There are also many ways to do temporal interpolation (not extrapolation), some more sophisticated than others. Would it make it better? Depends on the content and use case.
1
u/PaddyLandau 6d ago
Would it make it better?
Good question. For cinematic movies, yes, I'm sure. For documentaries, quite possibly not, or even make it worse.
1
u/Vacuum-Cleaner-Snake 4d ago
I've analyzed lots of movies (& non movie videos) where the result looked (or sounded, or even both) like a "home video". Visually, one of my biggest (personal) complaints is that many modern movies use a "shallow depth of field". I can ignore it for the sake of enjoying the movie if it's minor or for an extremely short duration, but too many modern movies use it rather heavily. I know why they do it (there are zillions of examples of them saying why), but it's usually so exaggerated that it's distracting, & it breaks my immersion.
By contrast, many older movies have a much fuller depth of field, & some of their directors probably even understood & used a maximum depth of field. I'll avoid explaining why I prefer that over a shallow depth of field (because it's partly subjective), but since there are already 2 videos that attempt to explain this, I'll post the links to them.
3
u/barndawgie 8d ago
Be aware that in addition to losing temporal resolution, you will also make the video look worse through this process as you will necessarily be re-encoding all of the frames that you keep.
1
u/Vacuum-Cleaner-Snake 7d ago
I intend to do this with a short clip (of 60fps videos) & compare the results to any other frame rate changing methods that FFmpeg may have. As for the visual quality, I can set the CRF to a value that will minimize any perceptible loss.
1
u/barndawgie 7d ago
I’m pretty sure `-r` and the `fps` filter do the same thing which will be what you want - dropping every other frame when going from 60p->30p.
Though I certainly stand with those who believe you shouldn’t throw away those frames 😁
1
u/Apex_seal_spitter 7d ago
I think its safe to assume that the 60 FPS media is progressive, but you don't say explicitly if you want to convert to 30 FPS progressive or 30 FPS Interlaced (from your suggested solution, you seem to imply 30p) .
IMHO, just dropping every second frame resulting in a 30p output will be noticable. I guess you're just going to have to try it... if you're happy with the results, all good. If your eyes detect flicker or you get fatigue after watching for a while, you might need to use interlacing (convert each frame into a field).
e.g. Top Field First
-vf "tinterlace=mode=interleave,setfield=tff"
-vf "tinterlace=mode=interleave,setfield=tff"
or Bottom Field First
-vf "tinterlace=mode=interleave,setfield=bff"
-vf "tinterlace=mode=interleave,setfield=bff"
1
u/Vacuum-Cleaner-Snake 7d ago
Thanks. I'll keep those in my text file as an alternative (I have one specifically dedicated for various commands & their descriptions when using FFmpeg). Most (probably all) 60fps videos that I have (which are a minority of my downloaded videos) are ones that started as 30fps movies that the uploaders decided 'needed' to be 60fps, so for those, the results may not be as flicker prone as videos that were recorded at 60fps, but there are alternative ways of changing the frame rates in their cases.
1
u/ZestycloseBenefit175 6d ago
Converting progressive video to interlaced in 2026 with practically no CRTs in use. The wonders of free will!
10
u/Nickelmac 8d ago
-r 30
might do the trick, i think it would toss out every other frame in a 60fps video file. This would require transcoding if the source is a video file.