/
ilya.petrash
/
SimplePyScripts
Обзор
Документация
Войти
/
ilya.petrash
/
SimplePyScripts
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
opencv__examples/decode_fourcc.py
17 строк
408 B
gil9red
Refactoring. Using black code style
02 июн 2023, 11:58
02 июн 2023, 11:58
cab14cb
Код
Авторство
О чём код?
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" def decode_fourcc(v) -> str: v = int(v) return "".join(chr((v >> 8 * i) & 0xFF) for i in range(4)) if __name__ == "__main__": assert decode_fourcc(828601953) == "avc1" import cv2 assert decode_fourcc(cv2.VideoWriter_fourcc(*"XVID")) == "XVID" assert decode_fourcc(cv2.VideoWriter_fourcc(*"avc1")) == "avc1"