1

Kinovea Version: 2025.2
OS: Windows 11 (64-bit)

Description:
When importing standard H.264 MP4/MKV video files, Kinovea miscalculates the total frame count and cuts off/loops the video before reaching the physical end of the clip.

VLC and QuickTime play the full clip perfectly (e.g., 9 seconds/237 frames).

Kinovea imports the same video but stops rendering frames prematurely (e.g., cuts off at frame 220/9.38s), meaning final actions are entirely skipped.

Adjusting container formats or re-encoding does not always resolve the issue, suggesting a bug in the underlying video decoding library's frame handling.

2

1798702 - DEBUG - [Main] - PreferencesManager - Exporting Preferences.xml
1798702 - DEBUG - [Main] - PreferencesManager - Exported prefs to temp file: 0 ms.
1798704 - DEBUG - [Main] - PreferencesManager - Exported prefs total time: 1 ms.
1798704 - DEBUG - [Main] - RootKernel - Debug logs enabled.
1845972 - DEBUG - [Main] - VideoReaderFFMpeg - Changing decoding size: 1046x587 -> 230x129
1845972 - DEBUG - [Main] - VideoReaderFFMpeg - ChangeDecodingSize, stopping pre-buffering.
1845972 - DEBUG - [Main] - VideoReaderFFMpeg - Stopping prebuffering thread.
1845972 - DEBUG - [Main] - PreBuffer - Unblocking prebuffering thread and making room for a non blocking addition. ? --> 11776] [106496 --> ? (25 frames).
1845972 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread, cancellation detected. After ReadFrame().
1845972 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Exiting PreBuffering thread.
1845986 - DEBUG - [Main] - VideoReaderFFMpeg - Seeking to [106496] completed. Final position:[106496], decoded: 17 frames.
1845986 - DEBUG - [Main] - VideoReaderFFMpeg - Starting prebuffering thread.
1845986 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread started.
1845986 - ERROR - [PreBuffering] - VideoReaderFFMpeg - Frame not read in the middle of the working zone. Reached timestamp:[106496], in [0 --> 114688].
1846004 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - [Seek] - First decoded frame [12288] already after target [0]. Force seek 4 more seconds back to [-49152]
1846017 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Seeking to [0] completed. Final position:[0], decoded: 1 frames.
1868327 - DEBUG - [Main] - VideoReaderFFMpeg - Changing decoding size: 230x129 -> 880x495
1868327 - DEBUG - [Main] - VideoReaderFFMpeg - ChangeDecodingSize, stopping pre-buffering.
1868327 - DEBUG - [Main] - VideoReaderFFMpeg - Stopping prebuffering thread.
1868327 - DEBUG - [Main] - PreBuffer - Unblocking prebuffering thread and making room for a non blocking addition. ? --> 11776] [106496 --> ? (25 frames).
1868327 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread, cancellation detected. After ReadFrame().
1868327 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Exiting PreBuffering thread.
1868338 - DEBUG - [Main] - VideoReaderFFMpeg - Seeking to [106496] completed. Final position:[106496], decoded: 17 frames.
1868339 - DEBUG - [Main] - VideoReaderFFMpeg - Starting prebuffering thread.
1868339 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread started.
1868339 - ERROR - [PreBuffering] - VideoReaderFFMpeg - Frame not read in the middle of the working zone. Reached timestamp:[106496], in [0 --> 114688].
1868345 - DEBUG - [Main] - VideoReaderFFMpeg - Changing decoding size: 880x495 -> 1046x587
1868345 - DEBUG - [Main] - VideoReaderFFMpeg - ChangeDecodingSize, stopping pre-buffering.
1868345 - DEBUG - [Main] - VideoReaderFFMpeg - Stopping prebuffering thread.
1868345 - DEBUG - [Main] - PreBuffer - Unblocking prebuffering thread and making room for a non blocking addition. [106496 --> 106496] (1 frames).
1868353 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - [Seek] - First decoded frame [12288] already after target [0]. Force seek 4 more seconds back to [-49152]
1868363 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Seeking to [0] completed. Final position:[0], decoded: 1 frames.
1868364 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread, cancellation detected. Before ReadFrame().
1868364 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Exiting PreBuffering thread.
1868376 - DEBUG - [Main] - VideoReaderFFMpeg - Seeking to [106496] completed. Final position:[106496], decoded: 17 frames.
1868378 - DEBUG - [Main] - VideoReaderFFMpeg - Starting prebuffering thread.
1868378 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread started.
1868378 - ERROR - [PreBuffering] - VideoReaderFFMpeg - Frame not read in the middle of the working zone. Reached timestamp:[106496], in [0 --> 114688].
1868390 - DEBUG - [Main] - VideoReaderFFMpeg - Changing decoding size: 1046x587 -> 956x537
1868390 - DEBUG - [Main] - VideoReaderFFMpeg - ChangeDecodingSize, stopping pre-buffering.
1868390 - DEBUG - [Main] - VideoReaderFFMpeg - Stopping prebuffering thread.
1868390 - DEBUG - [Main] - PreBuffer - Unblocking prebuffering thread and making room for a non blocking addition. [106496 --> 106496] (1 frames).
1868392 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - [Seek] - First decoded frame [12288] already after target [0]. Force seek 4 more seconds back to [-49152]
1868402 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Seeking to [0] completed. Final position:[0], decoded: 1 frames.
1868404 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread, cancellation detected. Before ReadFrame().
1868404 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Exiting PreBuffering thread.
1868415 - DEBUG - [Main] - VideoReaderFFMpeg - Seeking to [106496] completed. Final position:[106496], decoded: 17 frames.
1868417 - DEBUG - [Main] - VideoReaderFFMpeg - Starting prebuffering thread.
1868417 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread started.
1868417 - ERROR - [PreBuffering] - VideoReaderFFMpeg - Frame not read in the middle of the working zone. Reached timestamp:[106496], in [0 --> 114688].
1868427 - DEBUG - [Main] - VideoReaderFFMpeg - Changing decoding size: 956x537 -> 1040x584
1868427 - DEBUG - [Main] - VideoReaderFFMpeg - ChangeDecodingSize, stopping pre-buffering.
1868427 - DEBUG - [Main] - VideoReaderFFMpeg - Stopping prebuffering thread.
1868427 - DEBUG - [Main] - PreBuffer - Unblocking prebuffering thread and making room for a non blocking addition. [106496 --> 106496] (1 frames).
1868431 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - [Seek] - First decoded frame [12288] already after target [0]. Force seek 4 more seconds back to [-49152]
1868443 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Seeking to [0] completed. Final position:[0], decoded: 1 frames.
1868444 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread, cancellation detected. Before ReadFrame().
1868444 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Exiting PreBuffering thread.
1868458 - DEBUG - [Main] - VideoReaderFFMpeg - Seeking to [106496] completed. Final position:[106496], decoded: 17 frames.
1868459 - DEBUG - [Main] - VideoReaderFFMpeg - Starting prebuffering thread.
1868459 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread started.
1868459 - ERROR - [PreBuffering] - VideoReaderFFMpeg - Frame not read in the middle of the working zone. Reached timestamp:[106496], in [0 --> 114688].
1868465 - DEBUG - [Main] - VideoReaderFFMpeg - Changing decoding size: 1040x584 -> 1046x587
1868465 - DEBUG - [Main] - VideoReaderFFMpeg - ChangeDecodingSize, stopping pre-buffering.
1868465 - DEBUG - [Main] - VideoReaderFFMpeg - Stopping prebuffering thread.
1868465 - DEBUG - [Main] - PreBuffer - Unblocking prebuffering thread and making room for a non blocking addition. [106496 --> 106496] (1 frames).
1868473 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - [Seek] - First decoded frame [12288] already after target [0]. Force seek 4 more seconds back to [-49152]
1868485 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Seeking to [0] completed. Final position:[0], decoded: 1 frames.
1868486 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread, cancellation detected. Before ReadFrame().
1868486 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Exiting PreBuffering thread.
1868499 - DEBUG - [Main] - VideoReaderFFMpeg - Seeking to [106496] completed. Final position:[106496], decoded: 17 frames.
1868500 - DEBUG - [Main] - VideoReaderFFMpeg - Starting prebuffering thread.
1868500 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - PreBuffering thread started.
1868500 - ERROR - [PreBuffering] - VideoReaderFFMpeg - Frame not read in the middle of the working zone. Reached timestamp:[106496], in [0 --> 114688].
1868516 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - [Seek] - First decoded frame [12288] already after target [0]. Force seek 4 more seconds back to [-49152]
1868527 - DEBUG - [PreBuffering] - VideoReaderFFMpeg - Seeking to [0] completed. Final position:[0], decoded: 1 frames.

3

Hi, I have started the work to update to the latest FFMpeg version. (It's likely not a problem in the library itself but in how Kinovea uses it, but the refactoring to adapt to the latest version should help fix these issues.)

If you could send me a private link to the file as an example it would help my tests (joan at kinovea dot org).

edit: oops, I just realized you already sent me the video! Thanks.