ORB-HD / deface

Video anonymization by face detection
MIT License
684 stars 95 forks source link

Fps option not working #27

Closed mysablehats closed 1 year ago

mysablehats commented 2 years ago

I've installed the latest version from the github, so I could use the fps option. I did something simplistic like:

deface plain01.2125294.20220419131915.avi --ffmpeg-config '{"codec": "libx264","fps": 100}'

Which did produce a video with 100fps, however it is sped up, instead of having all the frames from the original video.

What I think is happening, is that the reader is not reading all the 100fps and when playing and this is why.

So I put a print(meta) statement and it is in fact not read as the appropriate fps (in my case it was being read as 25fps, even though the video is 100fps).

I did a very quick fix which is available in my fork :

https://github.com/mysablehats/deface

It worked for me for 60, 100 and even 120 fps (it was running out of frames, but it still managed to produce a playable video with the same duration).

Hope this helps, cheers!

mdraw commented 1 year ago

Thank you! Closing because #28 is now merged. I don't have test videos for these cases but the fix looks reasonable and it doesn't cause any problems with my test inputs.