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
#1
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.
Reply
Thanks given by:
#2
Using AviSynth:
Code:
tdecimate(cycle=25)
Reply
Thanks given by: Plissken1138
#3
Also Avisynth:

Code:
SelectRangeEvery(25,24,0,true)
assumefps("film")
Reply
Thanks given by: Plissken1138
#4
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.
Reply
Thanks given by: Plissken1138
#5
Uh, oh, avisynth...

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

Tried opening .avs in VirtualDub,

directshowsource("input.mp4")
tdecimate(cycle=25)

it said it didn't recognize tdecimate, then tried

directshowsource("input.mp4")
SelectRangeEvery(25,24,0,true)
assumefps("film")

it opened the file but didn't do anything from what I could see - rendered sample still had every 25th dupe.
Reply
Thanks given by:
#6
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).
Reply
Thanks given by: Plissken1138
#7
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:

1350,1351
1375,1376
1400,1401
1425,1426
1450,1451
1475,1476
...
1975,1976
2000,2001
...
2975,2976
3000,3001

so, deducing backward, it starts with dupe frames

0000,0001
0025,0026

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

Now, I made input.avs like this

directshowsource("input.mp4")
SelectRangeEvery(25,24,1,true) <--- as I understood, this means "from every 25 frames take 24, starting with 1"
assumefps("film")

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

Thanks to everyone!
Reply
Thanks given by:
#8
Great, glad it worked for ya!
Reply
Thanks given by:
#9
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...
Reply
Thanks given by:


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

Forum Jump:


Users browsing this thread: 1 Guest(s)