import queue
import sys
import threading
import time
import cv2
import subprocess as sp
import numpy as np
avs = ['qiaohu.mp4']
bb0 = b'\xff\xd8\xff\xe0\x00\x10JFIF'
bb = b'\xff\xd8\xff'
start = b'\xff\xd8\xff\xe0'
# data[6:] == 'jfif\0'
start1 = b'\xff\xd8\xff\xe1'
# data[6:] == 'exif\0'
end = b'\xff\xd9'
def createpp(command):
pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE, shell=False, bufsize=10 ** 8)
# pipe = sp.Popen(command, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)
return pipe
def printlog(pipe):
while True:
log = pipe.stderr.read(128)
if len(log) > 0:
print(log.decode('utf-8'))
def fingjpg(img1):
img = None
if len(img1) > 0:
ifn = img1.find(bb)
if ifn >= 0:
ifn1 = img1.fi
[python]管道 ffmpeg、subprocess、jpg、yuv、bgr24
最新推荐文章于 2022-08-01 16:59:35 发布
本文介绍了如何在Python环境中利用ffmpeg工具进行视频处理,包括读取视频帧为jpg、yuv和bgr24格式,同时探讨了subprocess模块在处理进程间的管道通信中的应用。
摘要由CSDN通过智能技术生成