Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert deprecated cython extension class properties to new syntax part 4 #1291

Merged
merged 1 commit into from
Feb 25, 2024

Conversation

JoeSchiff
Copy link
Contributor

I had some trouble with the color_range property in av/video/codeccontext.pyx and tests/test_colorspace.py.

After my changes, stream.color_range now returns 2 instead of None and therefore fails the test. I have no idea which one is actually correct.

Here is some additional context which may or may not be related:

  1. I get this warning when opening the file used in tests/test_colorspace.py:
    container = av.open(fate_suite("amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv"))
    WARNING libav.avi:test_colorspace.py:9 scale/rate is 0/0 which is invalid. (This file has been generated by broken software.)

  2. The color_range property in av/video/codeccontext.pyx had unusal syntax. The decorator was used, but so was __get__ and __set__.

  3. There are two color_range data fields in ffmpeg:
    AVCodecContext::color_range
    https://ffmpeg.org//doxygen/6.0/structAVCodecContext.html#a255bf7100a4ba6dcb6ee5d87740a4f35
    AVFrame::color_range
    https://ffmpeg.org//doxygen/6.0/structAVFrame.html#a853afbad220bbc58549b4860732a3aa5

I'll do more research in the next few days, unless the solution is obvious to someone already.

@WyattBlue
Copy link
Member

I think 2 is correct and None is wrong. The old color_range getter looks like it incorrectly always returns None.

@WyattBlue WyattBlue merged commit 1e263c0 into PyAV-Org:main Feb 25, 2024
18 checks passed
@JoeSchiff
Copy link
Contributor Author

WyattBlue, testing with ffprobe confirms that you are correct. It feels good to unexpectedly squash that bug.

@JoeSchiff JoeSchiff deleted the convert_ext_syntax_chunked branch January 6, 2025 00:57
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.

2 participants