Skip to content

Comments

Fixed#797

Merged
lucemia merged 25 commits intolivingbio:mainfrom
Omarabdalgwad:fixed
Jan 21, 2026
Merged

Fixed#797
lucemia merged 25 commits intolivingbio:mainfrom
Omarabdalgwad:fixed

Conversation

@Omarabdalgwad
Copy link
Contributor

@Omarabdalgwad Omarabdalgwad commented Jan 20, 2026

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

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.97%. Comparing base (57852c9) to head (13aa319).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Flag Coverage Δ
3.10 79.97% <100.00%> (+1.08%) ⬆️
3.11 79.94% <100.00%> (+1.08%) ⬆️
3.12 79.94% <100.00%> (+1.08%) ⬆️
backend 79.97% <100.00%> (+1.08%) ⬆️
python 79.97% <100.00%> (+1.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/ffmpeg/info.py 100.00% <100.00%> (+49.31%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Omarabdalgwad
Copy link
Contributor Author

hello @lucemia , could you review these commits and give me your feedback

@lucemia lucemia requested review from Copilot and lucemia and removed request for Copilot January 21, 2026 01:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 CodecFlags enum 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

@lucemia
Copy link
Contributor

lucemia commented Jan 21, 2026

hello @lucemia , could you review these commits and give me your feedback

@Omarabdalgwad
Thank you for your PR. It looks good and addresses the issue effectively.
I am ready to merge it after a few minor changes and formatting suggestions are applied.

Omarabdalgwad and others added 3 commits January 21, 2026 07:00
@lucemia
Copy link
Contributor

lucemia commented Jan 21, 2026

@Omarabdalgwad

thanks!

@lucemia lucemia merged commit 27cc312 into livingbio:main Jan 21, 2026
5 checks passed
@Omarabdalgwad
Copy link
Contributor Author

@lucemia thank you

@Omarabdalgwad Omarabdalgwad deleted the fixed branch January 29, 2026 19:13
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.

ffmpeg/info.py incompatible in different ffmpeg version

2 participants