Fix IVTC failure on >8-bit sources (e.g. 10-bit ProRes 422)#46
Merged
Conversation
vivtc.VFM only accepts 8-bit YUV/GRAY, so IVTC on a 10-bit source such as ProRes 422 (yuv422p10le) failed with "VFM: input clip must be constant format YUV420P8, ...". descratch already guarded for this but the IVTC pass did not — in both the preview and the full-encode templates, so the export would fail the same way, not just the preview. Run VFM's field-matching on an 8-bit metrics copy (only converted when the source isn't already 8-bit) but emit the full-depth pixels via VFM's clip2 parameter, so 10-bit precision is preserved rather than truncated. VDecimate accepts 8..16 bit natively (confirmed against the bundled libvivtc), so it runs directly on the full-depth output and the soft-telecine path is unchanged. Verified end-to-end by decoding a 10-bit yuv422p10le ProRes 422 source through the real ffmpeg | vspipe pipe: previously errored, now processes cleanly (90->72 frames) with the output remaining yuv422p10le. Tests (both CI suites): - worker: test_57_ivtc_high_bit_depth_guard - app: "ivtc: VFM/VDecimate 8-bit guard + clip2" (adds a deinterlace param to buildJob) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds a small (2.9 MB, 30-frame) Apple ProRes 422 Standard telecine clip (yuv422p10le) under Tests/TestResources, matching the source from the bug report, plus generate_prores422_10bit_test.sh to reproduce it. The clip can also be dropped into the app to exercise the high-bit-depth IVTC path via the UI. Adds integration_high_bit_depth_test.dart (@tags(['heavy'])): probes the fixture, confirms it is >8-bit, then runs the worker end-to-end with IVTC and asserts a valid encode. Verified this test fails on the pre-fix template (the encode aborts at the VFM 8-bit error) and passes with the clip2 guard — a real regression guard the script-only tests could not provide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
A user reported that the preview (and, in fact, the full encode too) fails on a 10-bit ProRes 422 source:
The source decodes to
yuv422p10le(10-bit). This isn't a global 8-bit limitation — it's specific to the IVTC (Inverse Telecine) pass:vivtc.VFMonly accepts 8-bit YUV/GRAY.descratchalready had an 8-bit guard, but the IVTC pass had none — in bothpreview_template.vpyandpipeline_template.vpy, so the actual export would have failed identically, not just the preview.Fix
The IVTC block now runs VFM's field-matching on an 8-bit metrics copy (only converted when the source isn't already 8-bit) while emitting the full-depth pixels via VFM's
clip2parameter — so 10-bit precision is preserved rather than truncated to 8-bit.Confirmed against the bundled
libvivtcthatVDecimatealready accepts 8–16 bit natively (only VFM is 8-bit-limited), so VDecimate runs directly on the full-depth VFM output and the soft-telecine path needed no change.Test fixture
Adds
Tests/TestResources/prores422_10bit_telecine.mov— a small (2.9 MB, 30-frame) Apple ProRes 422 Standard telecine clip (yuv422p10le) matching the reported source, plusgenerate_prores422_10bit_test.shto reproduce it. It can be dropped into the app to exercise the high-bit-depth IVTC path via the UI.Tests
worker/tests/filter_integration_test.rs→test_57_ivtc_high_bit_depth_guardapp/test/integration_filter_parameters_test.dart→ivtc: VFM/VDecimate 8-bit guard + clip2(adds adeinterlaceparam to the test'sbuildJobhelper)clip2wiring appear in the generated script.app/test/integration_high_bit_depth_test.dart→ probes the ProRes fixture, confirms it is >8-bit, then runs the worker end-to-end with IVTC and asserts a valid encode. Verified it fails on the pre-fix template (encode aborts at the VFM 8-bit error) and passes with the fix — the real regression guard the script-only tests cannot provide.Manual verification
Decoded the 10-bit
yuv422p10lesource through the realffmpeg | vspipe | ffmpegpipe: previously errored, now processes cleanly (90→72 frames) with the output remainingyuv422p10le.🤖 Generated with Claude Code