An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
Some of Our Sources
View All Sources
March 28, 2022 11:37 pm GMT
Original Link: https://dev.to/eliteraspberries/encode-and-decode-fourcc-codes-in-python-3k6b
Encode and decode FourCC codes, in Python
Convert the string "H264" to an integer code:
sum([ord(c) << (i * 8) for i, c in enumerate("H264")])
Convert the integer code (0x34363248) back to a string:
''.join([chr((0x34363248 >> (i * 8)) & 0xff) for i in range(4)])
See this gist: https://gist.github.com/eliteraspberries/b017f998c97c395881f0d2f05a08ec60
Original Link: https://dev.to/eliteraspberries/encode-and-decode-fourcc-codes-in-python-3k6b
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To