I have a video that was mastered at 25 fps, but every 24th frame is a duplicate of frame 23, causing the video to stutter
I want to delete every 24th frame of the video, and then if possible change the frame rate to 24 frames a second with audio synched up, and keeping the quality and file size very similar
I thought I was close but this didn't work:
ffmpeg -i in.mkv -filter:v "select=mod(n+1,24),setpts=N/24/TB,fps=24" -c:v libx264 -preset slow -crf 18 -c:a copy out.mkv
this was causing more duplicating (frame 1 and 2 are now duplicated, and also causing frame 24 and 25 to be the same)
Is changing the frame rate from 25 (default) to 24 (out video) causing re-duplicating of frames I am trying to delete in the first place.
Can anyone assist me with tweaking this?
+ Reply to Thread
Results 1 to 19 of 19
-
-
If every 23rd and 24th frame are duplicates, what is frame 25 ? Where numbers/positions are the next duplicates ?
If it's drop 1 duplicate frame every 25 frames , regardless of where the "position" of the duplicates are - it should be -vf decimate=cycle=25 . That should give you 24 fps, in sync . That would imply the original content was 24fps, and it was converted to 25fps by inserting 1 frame every second to make up 25fps. You'd just be reversing the process
Unless... Is the duplicate a "placeholder" for a dropped frame ? ie. Is the stutter actually a missing frame ? If you removed frame 24, so it goes 23,25, is the motion ok or is there a jump ? If there is a jump, that would imply a dropped frame that was replaced by a duplicate. There are other ways to deal with this, I won't get in to this unless this is your case. -
Frame 24 is a duplicate of frame 23, and then frame 48 is a duplicate of frame 47, and so on....no dropped frames
The video was rendered at 25 frames per second, which is confusing, at least to me.
I just want to get rid of all duplicate frames to stop the stuttering as each second there is a stutter caused by one duplicate frame
I have tried using the duplicate frame filter (mpdecimate filter) but the issue is this movie has an opening music cue, opening titles, an intermission, all with static screens, so this didn't work
Seems everything i tried above ended up adding more duplicate frames, usually frame 1 and 2 became duplicated, -
@jedi: Some form of telecine? 2:2:2:2:2:2:2:2:2:2:2:3 pulldown (used for 24fps progressive ->25fps "interlaced" =50 fields per second conversion)?
Upload a sample so someone may take a look.Last edited by Sharc; 27th Jan 2025 at 13:32.
-
In Avisynth:
Code:LWLibavVideoSource("0127.mp4") TDecimate(cycle=25)
In ffmpeg try (video only for demo):
Code:ffmpeg -i "0127.mp4" -an -c:v libx264 -crf 18 -pix_fmt yuv420p -vf fps=25.0,decimate=cycle=25 "out_decimated.mp4"
Last edited by Sharc; 27th Jan 2025 at 14:42.
-
I did try that suggestion and it didnt work, I have a link to a sample of the video file if someone wants to see if they can get it to work
-
-
If frame 23 and 24 are duplicates, and frame 47 and 48 are duplicates, should I be using -vf decimate=cycle=24? not 25?
-
The pattern changes slightly between 24 and 25 frames. The next duplicate (3rd set) is 25 frames away, not 24
eg. 23,24, 47,48, 72,73
The decimation is adaptive . 25 works ok on this sample, but check on a longer sequence . Sometimes you might need a different ratio. In that case, you migth need avisynth, because ffmpeg's decimate filter only does 1 in x decimation. You might need to use other ratios like 2 in 49 etc...
Similar Threads
-
FFmpeg changed frames per second in video files
By keyboard in forum Newbie / General discussionsReplies: 1Last Post: 7th Apr 2024, 09:36 -
How to export frames from a video with timecode in filenames (ffmpeg)?
By eliio in forum Newbie / General discussionsReplies: 0Last Post: 13th Jun 2022, 11:25 -
Trimming Video at Specific Frames
By caivs in forum EditingReplies: 6Last Post: 19th Oct 2020, 19:20 -
ffmpeg cut point wrong with 5 reference frames video
By Budman1 in forum EditingReplies: 9Last Post: 8th Aug 2020, 12:06 -
FFmpeg - Image Video zoom to/from specific area.
By daigo99 in forum Video ConversionReplies: 0Last Post: 6th Apr 2020, 22:40