Hi !
Thank you for PySceneDetect.
I ran into issues where after some serialization the resulting time frame was not the expected one.
For example:
frame_time_code=FrameTimecode(61, fps=14)
seconds=frame_time_code.get_seconds()
time_code=frame_time_code.get_timecode()
...
FrameTimecode(seconds, fps=14).get_frames() ==60# not 61FrameTimecode(time_code, fps=14).get_frames() ==60# not 61
I found the corresponding code with flooring (with int instead of round) :
| def_seconds_to_frames(self, seconds): |
| # type: (float) -> int |
| """ Converts the passed value seconds to the nearest number of frames using |
| the current FrameTimecode object's FPS (self.framerate). |
| |
| Returns: |
| Integer number of frames the passed number of seconds represents using |
| the current FrameTimecode's framerate property. |
| """ |
| returnint(seconds*self.framerate) |
| returnint(secs*self.framerate) |
I ran into the following code which seems to indicate this is on purpose. What is the reason?
| assertFrameTimecode(timecode='00:00:01', fps=1).frame_num==1 |
| assertFrameTimecode(timecode='00:00:01.9999', fps=1).frame_num==1 |
| assertFrameTimecode(timecode='00:00:02.0000', fps=1).frame_num==2 |
Have a nice day !
Hi !
Thank you for PySceneDetect.
I ran into issues where after some serialization the resulting time frame was not the expected one.
For example:
I found the corresponding code with flooring (with
intinstead ofround) :PySceneDetect/scenedetect/frame_timecode.py
Lines 227 to 236 in f6c61dd
PySceneDetect/scenedetect/frame_timecode.py
Line 307 in f6c61dd
I ran into the following code which seems to indicate this is on purpose. What is the reason?
PySceneDetect/tests/test_frame_timecode.py
Lines 114 to 116 in f6c61dd
Have a nice day !