python opencv图片编码为h264文件
python部分
#!/usr/bin/env Python
# coding=utf-8
from ctypes import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import time
import numpy as np
import cv2
import struct
import datetime
from numba import jit
import os
cam_dict={}
class CamInfo:
def __init__(self, cam_no=0,deviceid="default",cam_name="default"):
self.cam_no = cam_no
self.deviceid = deviceid
self.cam_name = cam_name
@jit
def trans(data,size,height,width):
bbb = string_at(data,size)
nparr = np.fromstring(bbb, np.uint8)
r = nparr.reshape(height,width, 3)
return r
def str2char_p(str_v):
pStr = c_char_p( )
pStr.value = str_v
return pStr
def callb_
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/80330987
- 点赞
- 收藏
- 关注作者
评论(0)