Repository navigation
video: cross-language symmetry tests and shared example videos - #144
Merged
Merged
Conversation
Adds +makeArtifacts/+reader/readVideo.m and +readArtifacts/+reader/readVideo.m,
mirroring NDR-python's tests/symmetry/{make,read}_artifacts/reader/
test_read_video.py, so the frame API of ndr.reader.video is checked against
the Python port (PyAV/FFmpeg) in both directions: numframes, framesize,
dimensionorder, datatype, frametimes, t0_t1, epochclock, getchannelsepoch,
metadata, and exact pixels of first/last RGB frames per channel, a SelectC
read and an out-of-order greyscale read.
The inputs are two new generated fixtures, byte-identical to NDR-python's
(written by its tools/make_example_data.py):
example_video.avi 6-frame 12x16 uncompressed 24-bit RGB, 10 frames/s
example_video_grey.avi the same as 8-bit with a grey palette
('Grayscale AVI' storage)
Both are stored bottom-up as VideoWriter writes them, and uncompressed so
VideoReader reads them on every platform and the ports must agree pixel for
pixel. Frame times compare to 1e-6 s, since each port measures them
through its own decoder.
Written without access to MATLAB: not run locally. The symmetry workflows
in both repos run it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QjkvVXsdCVw6NNe5SnGNyX
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #144 +/- ##
==========================================
+ Coverage 54.88% 54.94% +0.06%
==========================================
Files 164 164
Lines 9598 9598
==========================================
+ Hits 5268 5274 +6
+ Misses 4330 4324 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MATLAB half of the
ndr.reader.videosymmetry tests. The Python half and the Python port are in VH-Lab/NDR-python#33. Both use branchclaude/clever-bardeen-hf5jgx, so NDR-python'stest-symmetry.ymlchecks out this branch.Changes
tools/tests/+ndr/+symmetry/+makeArtifacts/+reader/readVideo.m: runs the frame API on the two example videos and writesmetadata.jsonandreadFrames.json. These record:numframes,framesize,dimensionorder,datatype,frametimes,t0_t1,epochclock, channels and image metadata;SelectCread, and an out-of-order greyscale read.tools/tests/+ndr/+symmetry/+readArtifacts/+reader/readVideo.m: verifies those artifacts from both sources (matlabArtifacts,pythonArtifacts). It mirrors NDR-python'stests/symmetry/{make,read}_artifacts/reader/test_read_video.py.example_data/example_video.avi: 6-frame 12×16 uncompressed 24-bit RGB, 10 fps. R =20*frame + col, G =10*row + frame, B =200 - 10*frame - col.example_data/example_video_grey.avi: the same layout as 8-bit with a 256-entry grey palette ('Grayscale AVI' storage). Pixel value is30*frame + 4*row + col.example_data/Readme.md: documents both files. The README stays identical to NDR-python's.Design notes
tools/make_example_data.py, like the other synthetic fixtures. That script writes the AVI bytes directly, laid out asVideoWriterwrites them: BI_RGB frames stored bottom-up.VideoReadercan read these on every platform (MPEG-4 needs GStreamer on Linux), and since nothing is lossy the two ports must agree pixel for pixel.Verification
I wrote this without access to MATLAB. NDR-python's cross-language symmetry run on this branch (run 39476490054, attempt 2) is the first time these files ran, and they passed:
makeArtifacts/readVideopassed (7/7 makeArtifacts tests).readArtifacts/readVideopassed for bothSourceType=matlabArtifactsandSourceType=pythonArtifacts(14/14 readArtifacts tests).VideoReaderreads the grey-palette AVI as Grayscale (C=1), matching Python pixel for pixel.🤖 Generated with Claude Code
https://claude.ai/code/session_01QjkvVXsdCVw6NNe5SnGNyX