VideoHelp Forum




+ Reply to Thread
Results 1 to 19 of 19
  1. 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?
    Quote Quote  
  2. Try -vf decimate=cycle=24
    Video only, audio has to be adapted later.
    Quote Quote  
  3. Nope, that didn't work either, so frustrating
    Quote Quote  
  4. 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.
    Quote Quote  
  5. 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,
    Quote Quote  
  6. @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.
    Quote Quote  
  7. In Avisynth:
    Code:
    LWLibavVideoSource("0127.mp4")
    TDecimate(cycle=25)
    returns 24fps progressive frames


    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.
    Quote Quote  
  8. I have never used Avisynth, but I will see if I can figure out how to use it
    Quote Quote  
  9. You don't need avisynth for this . Did you try the suggestion in post #4 ?

    -vf decimate=cycle=25 should give you the same thing as avisynth's TDecimate(cycle=25) . They both perform 1 in 25 decimation, giving you 24fps
    Quote Quote  
  10. 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
    Quote Quote  
  11. Originally Posted by Jedi1985Knight View Post
    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
    What "didn't work" exactly ?

    Works ok here

    Code:
    ffmpeg -i 0127.mp4 -vf decimate=cycle=25 -c:v libx264 -crf 18 -preset:v slow -an -c:a copy ffmpegdecimate.mkv
    Image Attached Files
    Quote Quote  
  12. If frame 23 and 24 are duplicates, and frame 47 and 48 are duplicates, should I be using -vf decimate=cycle=24? not 25?
    Quote Quote  
  13. Originally Posted by Jedi1985Knight View Post
    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...
    Quote Quote  
  14. @jedi: See my post#8. I added for ffmpeg.
    Image Attached Files
    Quote Quote  
  15. poisondeathray +1, -vf decimate=cycle=25 did the job.
    Quote Quote  
  16. Yes, thank you

    this worked:

    ffmpeg -i 0127.mp4 -vf decimate=cycle=25 -c:v libx264 -crf 18 -preset:v slow -an -c:a copy out.mkv

    but for some reason I have no audio now?
    Quote Quote  
  17. Delete the "-an" for no audio
    Quote Quote  
  18. ok, thank you everyone for the help!!
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!