Skip to content

Conversation

@Arcanixhades0
Copy link

This PR adds small reproducible scripts and documentation demonstrating an import-order issue between torchcodec and transformers' audio modules and a minimal runtime workaround that preloads the system libavcodec before loading torchcodec's extension.\n\nFiles added:\n- scripts/torchcodec_preload/repro_fail_order.py — repro that imports torchcodec first and may fail\n- scripts/torchcodec_preload/repro_fix_ctypes_preload.py — preloads libavcodec via ctypes then loads torchcodec and transformers\n- scripts/torchcodec_preload/README.md — instructions to inspect libavcodec and run examples\n\nTesting notes:\n- In some environments (including the container used to create this PR), ffmpeg/libavcodec may not be installed; may return nothing. Run locally to find a candidate path.\n- Recommended local test sequence:\n 1) \n 2) Could not find libavcodec via ctypes.util.find_library('avcodec').
Run ldconfig -p | grep avcodec to locate a system lib, or set LD_PRELOAD. — should preload and succeed\n 3) — demonstrates the original failing order\n\nRationale and suggested next steps:\n- This PR intentionally adds only examples and docs to help reproduce and triage loader/symbol-version mismatches without modifying library code.\n- If maintainers prefer, we can follow up with either a small runtime helper in to optionally preload ffmpeg libs, or open a reproducible issue on the torchcodec repo and collaborate on a longer-term fix.\n\nIf you want me to also add a small helper function and unit tests in this PR, say so and I will prepare the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant