-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add color_range to CodecContext/Frame
- Loading branch information
1 parent
1de6a50
commit 8aa5fe7
Showing
7 changed files
with
121 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from av.video.reformatter import ColorRange, Colorspace | ||
import av | ||
|
||
from .common import TestCase, fate_suite | ||
|
||
|
||
class TestColorSpace(TestCase): | ||
def test_color_range(self): | ||
container = av.open( | ||
fate_suite("amv/MTV_high_res_320x240_sample_Penguin_Joke_MTV_from_WMV.amv") | ||
) | ||
stream = container.streams.video[0] | ||
|
||
self.assertEqual(stream.color_range, None) | ||
|
||
for packet in container.demux(stream): | ||
for frame in packet.decode(): | ||
self.assertEqual(frame.color_range, ColorRange.JPEG) # a.k.a "pc" | ||
self.assertEqual(frame.colorspace, Colorspace.ITU601) | ||
return |