用python 向rtmp流服务器推流
代码
# _*_ coding:utf-8 _*_
'''
python3
opencv
ffmpeg
rtmp 推流视频直播pipe:: Invalid argumentb
'''
import cv2
import subprocess
import shlex
# ffmpeg 推流
class FfmpegRemp(object):
def __init__(self, rtmpfile, videoid):
self.rtmpUrl = "rtmp://127.0.0.1:1935/" + rtmpfile
self.video_stream_path = videoid
self.WIDTH = 640
self.HEIGHT = 420
self.FPS = 30.0
self.stat = True
def open_opencv(self):
cap = cv2.VideoCapture(self.video_stream_path, cv2.CAP_DSHOW
python+opencv+FFmpeg rtmp推流
最新推荐文章于 2024-08-03 01:09:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)