Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to remove every 25th dupe frame from h264 video
Here's the situation - I have a h264 mkv of some remastered docu that was shot on film, and it shows as 25 fps in media info but every 25th frame is a dupe (I checked it frame by frame) which makes that annoying stutter, especially visible in panning shots. I'd like to try using ffmpeg to drop every 25th dupe frame and make it a 24 fps video that plays smooth and doesn't lose sync with audio, but I'm a noob at ffmpeg and got kinda lost looking thru documentation... If some kind soul with knowledge would spell it for me I'd be one happy noob.
Thanks given by:
Using AviSynth:
Thanks given by: Plissken1138
Also Avisynth:

Thanks given by: Plissken1138
If a 24fps video has been converted to 25fps by duplicating every twenty-fourth frame, then althor's solution will work.  If a 23.976fps video has been converted to 25fps through duplication, there will be an additional duplicate every thousand frames, in which case using Telecide() or an equivalent function might be better.  It's worth checking to see if there are additional duplicates.
Thanks given by: Plissken1138
Uh, oh, avisynth...

Does it work with ffmpeg (if at all possible)?

Tried opening .avs in VirtualDub,


it said it didn't recognize tdecimate, then tried


it opened the file but didn't do anything from what I could see - rendered sample still had every 25th dupe.
Thanks given by:
For SelectRangeEvery you may may need to specify the correct offset, otherwise it will be removing the wrong frames.

For tdecimate, you need to install the plugin first possibly?

Personally I prefer SelectRangeEvery when possible to use, as it's more controlled, where I think TDecimate could run into problems if the footage has intended duplicate frames in some places (like slow motion).
Thanks given by: Plissken1138
I'm worse in finding my way around avisynth then around ffmpeg so this is all going a bit over my head but I guess it's cracked.

Since first dozen hundred frames or so are just some film restoration info (white text on black background)
I determined this pattern of dupe frames from earliest visible and moving shot:


so, deducing backward, it starts with dupe frames


and I also guessed that 23.976 scenario Chewtobacca mentioned isn't the case here...

Now, I made input.avs like this

SelectRangeEvery(25,24,1,true) <--- as I understood, this means "from every 25 frames take 24, starting with 1"

and, by going thru VDub timeline, looks like that's the winning combo!

Thanks to everyone!
Thanks given by:
Great, glad it worked for ya!
Thanks given by:
Another potential complication is that as this is a documentary, it might draw on different sources and handle them differently.  If that is the case, it's worth double-checking such sections to see if the same solution works with all the material.  But it does sound as if you are lucky and this is a straightforward case of 24-to-25fps conversion through duplication.  I wish problematic videos were always so easily handled...
Thanks given by:

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Help] Merge Video into mkv MrBrown 3 844 2023-05-11, 02:04 PM
Last Post: stwd4nder2
  Smart Rendering for H264 ? Falcon 2 1,017 2022-10-10, 08:11 PM
Last Post: Falcon
  Best way to manage variable frame rates? alexpeden2000 2 1,333 2022-06-11, 02:10 PM
Last Post: alexpeden2000
  A stubborn intent to render yuv444 10bit video Amadian 4 1,663 2022-03-15, 11:57 AM
Last Post: Amadian
  AV1 (AOMedia Video 1) [main thread] spoRv 24 5,903 2022-01-08, 10:08 PM
Last Post: spoRv
  [Help] Sync audio to video (different fps and rips) JackForrester 14 5,077 2021-09-05, 01:57 AM
Last Post: JackForrester
  How to convert 50p (25p) to 23.976 with Dupe Frames? PDB 6 2,317 2021-08-13, 02:39 PM
Last Post: PDB
  [Help] Frame-accurate subtitles theprion 3 1,629 2021-05-15, 11:11 PM
Last Post: Beber
  Interlaced video in HQ codec pipefan413 10 5,529 2020-05-19, 02:13 AM
Last Post: pipefan413
  [Help] Correct Bad Frame Rate Conversion CSchmidlapp 29 21,276 2019-05-24, 10:17 PM
Last Post: zoidberg

Forum Jump:

Users browsing this thread: 1 Guest(s)