Fix macOS build compatibility with FFmpeg 5-8 - #368
Open
jasontitus wants to merge 8 commits into
Open
Conversation
Decord was written against FFmpeg 4.x APIs which have breaking changes in newer versions. This adds version-gated preprocessor guards to support FFmpeg 5 through 8 while maintaining backward compatibility. - Add bsf.h include for AVBSFContext (FFmpeg 5+) - Use const AVCodec*/const AVInputFormat* signatures (FFmpeg 5+) - Replace av_stream_get_side_data with av_packet_side_data_get (FFmpeg 7+) - Replace channels/channel_layout with ch_layout API (FFmpeg 6+) - Gate avcodec_close calls removed in FFmpeg 7+ - Fix buffersink pix_fmts option via format filter (FFmpeg 7+) - Skip -rdynamic linker flag on macOS (unsupported by Apple ld) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
FFmpeg 7+ changed the buffer source filter's pix_fmt option from AV_OPT_TYPE_INT to AV_OPT_TYPE_PIXEL_FMT, requiring format name strings instead of integer values. Also sanitize sample_aspect_ratio with zero denominators which cause infinity values rejected by FFmpeg 7+. https://claude.ai/code/session_01KjK6BLv2fUvXjZo1JU4e6S
Fix FFmpeg 7.x filter graph compatibility
Replace missing count_down.mov and sample-mov-file.mov references with big_buck_bunny.mp4 and file_example_MOV_1280_1_4MB.mov, update shape assertions to match, and fix shape() calls to use shape property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
131 tests covering VideoReader, AudioReader, AVReader, bridge, NDArray, and logging. Uses big_buck_bunny.mp4 and an MP3 file as test-media fixtures tracked in git (.gitignore updated with exceptions for test-media/). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Document supported FFmpeg versions (4.x through 8.x) and the API changes each version requires. Remove outdated PPA instructions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
chr431
pushed a commit
to chr431/decord
that referenced
this pull request
Aug 15, 2026
从 dmlc/decord open issues/PR 筛选并本地验证后移植: - NDArray.pts int->int64_t(dmlc#269/dmlc#341);SkipFramesImpl 用 Drained() 判真 EOF,避免容器虚标帧数时死循环并采样 EOF 幽灵帧(dmlc#373/dmlc#342) - CheckKeyFrame EOF 出口 + GetFrameCount avg_frame_rate.den==0 防除零(dmlc#230) - FFmpeg 7 buffersink pix_fmts 类型变化守卫(libavfilter>=10,PR dmlc#368),新增 Windows FFmpeg 7.1 CI job - 帧索引缓存版本混入 LIBAVFORMAT_VERSION_INT,防止跨 FFmpeg 构建误用旧缓存(本地实测 7.1/8.1 时间戳不一致) - ctypes 默认 RTLD_LOCAL + DECORD_RTLD_GLOBAL 逃生开关,PATH 缺失兜底(dmlc#361/dmlc#362/dmlc#357) - _init_internal_api 显式 import _api_internal(PR dmlc#364);AVReader sample_rate 默认值与文档对齐为 -1(PR dmlc#237) - VideoReader.close()/上下文管理器(dmlc#222);GPU VP8 映射(dmlc#217);worker 停止后的 Push 可读报错(dmlc#321) - 新增回归:large_pts.mp4 大 PTS get_batch/seek、close/context manager、PATH 缺失、RTLD_GLOBAL 开关、AVReader 默认值 - 本地验证:Windows GPU FFmpeg 8.1 61 tests、CPU FFmpeg 8.1 60 tests、CPU FFmpeg 7.1 60 tests 全绿
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.
Summary
bsf.hinclude for AVBSFContext,const AVCodec*/const AVInputFormat*signatures,ch_layoutchannel API,av_packet_side_data_getreplacement, buffersinkpix_fmtsruntime option fix, and macOS linker flag fixTest plan
🤖 Generated with Claude Code