Conversation
…://github.com/Omarabdalgwad/typed-ffmpeg into fix-livingbio#649-ffmpeg/info.py-incompatible
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #797 +/- ##
==========================================
+ Coverage 78.88% 79.97% +1.08%
==========================================
Files 51 51
Lines 3419 3425 +6
==========================================
+ Hits 2697 2739 +42
+ Misses 722 686 -36
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
hello @lucemia , could you review these commits and give me your feedback |
There was a problem hiding this comment.
Pull request overview
This PR fixes FFmpeg version compatibility issues in the info.py module by updating the codec and coder flag parsing logic to correctly handle the flag format across different FFmpeg versions. The changes add proper bounds checking and position-based parsing for flag strings.
Changes:
- Updated
CodecFlagsenum to reflect actual FFmpeg codec flags (decoding, encoding, video, audio, subtitle, data, attachment, intraframe_only, lossy, lossless) - Refactored
parse_codec_flags()to use position-based parsing with bounds checking instead of index-based access - Refactored
parse_coder_flags()to use position-based parsing with bounds checking instead of index-based access - Added comprehensive test coverage for the parsing functions
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| src/ffmpeg/info.py | Updated CodecFlags enum with correct FFmpeg flags; refactored parse_codec_flags() and parse_coder_flags() with bounds checking to prevent index errors |
| src/ffmpeg/tests/test_ffmpeg.py | Added test functions for codec and coder flag parsing including full flag strings, empty strings, and individual character testing |
@Omarabdalgwad |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
thanks! |
|
@lucemia thank you |
fixes ffmpeg/info.py incompatible in different ffmpeg versions
closes #649
What changed
Updated parse_codec_flags to parse codec flags reliably across different FFmpeg versions.
Updated parse_coder_flags to parse encoder/decoder flags consistently.
Added tests to cover the new behavior
Why
FFmpeg outputs flag strings that may differ between versions, which caused incorrect parsing and inconsistent results