Posts: 118
Threads: 5
Joined: 2017 Jun
Thanks: 59
Given 58 thank(s) in 44 post(s)
Country:
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.
Posts: 1,554
Threads: 60
Joined: 2015 Jan
Thanks: 229
Given 626 thank(s) in 372 post(s)
Country:
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.
Posts: 118
Threads: 5
Joined: 2017 Jun
Thanks: 59
Given 58 thank(s) in 44 post(s)
Country:
2019-03-30, 03:26 PM
(This post was last modified: 2019-03-30, 03:26 PM by Plissken1138.)
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.
deleted user
Unregistered
Thanks:
Given thank(s) in post(s)
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).
Posts: 118
Threads: 5
Joined: 2017 Jun
Thanks: 59
Given 58 thank(s) in 44 post(s)
Country:
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!
deleted user
Unregistered
Thanks:
Given thank(s) in post(s)
Great, glad it worked for ya!
Posts: 1,554
Threads: 60
Joined: 2015 Jan
Thanks: 229
Given 626 thank(s) in 372 post(s)
Country:
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...