Djdefrag/QualityScaler

A cast to integer causes the extracted and upscaled frame count to be incorrect, on NTSC frame rate videos

Chipcraft opened this issue · 4 comments

frame_rate = int(cap.get(cv2.CAP_PROP_FPS))

https://github.com/Djdefrag/QualityScaler/blob/b92bb701e703430b13d7341a41aa8699972ae809/QualityScaler.py#LL455C5-L455C50

Example, input video FPS 23.976, original frame count 1212: (23 / (24000/1001)) * 1212 = 1162.6615 (i.e., 1163).

The same applies to every other video that uses frame rates that are non-even.

Everything works correctly when the cast to int is removed: frame_rate = cap.get(cv2.CAP_PROP_FPS)

Hi my friend,

thank you, i will integrate this fix asap :)

Hi my friend,

thank you, i will integrate this fix asap :)

Well that was quick =)

Didn't notice until now. Same affects the video reconstruction:

frame_rate = int(cap.get(cv2.CAP_PROP_FPS))

Ok perfect, changing this line too. Thanks! :D