-
Notifications
You must be signed in to change notification settings - Fork 417
Closed
Description
I just noticed that both flag fields (flags, flags2) in the codec context are type long in C but they should be unsigned long. The current setup leads to some strange errors when naively setting, for example, the CLOSED_GOP flag ... could we change this?
...
stream = container.add_stream("h264", 60)
stream.flags |= 0x80000000 # set cgop flagresults in
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "av\\codec\\context.pyx", line 119, in av.codec.context.CodecContext.flags.__set__
OverflowError: Python int too large to convert to C long
The current way to set this flag (in v14.0.1) is to use the corresponding signed representation of the flag. This is slightly unintuitive and not very self-explanatory:
stream = container.add_stream("h264", 60)
stream.flags |= -2147483648 # set cgop flagMetadata
Metadata
Assignees
Labels
No labels