Skip to content

skvideo.io.FFmpegWriter.writeFrame doesn't write frames deterministically? #138

@t-sasatani

Description

@t-sasatani

There appears to be an issue with skvideo.io's writeFrame function, where it sometimes fails to write frames without generating any exceptions. I found this while investigating why the maximum number of reconstructed_frame_index doesn't match the number of frames in the exported .avi file. We need to strictly match the data stream buffer index with the output video frame index to synchronize video timestamps and develop video repair functions; this issue is critical for these usages.

Summary

  • The number of non-excepted skvideo.io.FFmpegWriter.writeFrame calls doesn't match the number of frames in the exported video
  • There is a reshape and casting for the input array before calling writeFrame, so it's unlikely that the input data is broken.

Status

Failing tests for this issue are in:

This can also run by:

pdm run pytest tests/test_stream_daq.py::test_writer_returns_match_avi_frame_count

which currently results in:

FAILED tests/test_stream_daq.py::test_writer_returns_match_avi_frame_count - AssertionError: write_frame True returns (116) != AVI frames (94)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions