python_rtmpstream - Python rtmp 推流
创始人
2024-11-14 14:05:21

文章目录

    • 一、关于 python_rtmpstream
    • 二、安装
    • 三、运行测试程序


一、关于 python_rtmpstream

python_rtmpstream 基于ffmpeg api函数实现推送rtmp流,实现了音视频同步。

  • github : https://github.com/lipku/python_rtmpstream

二、安装

1、下载代码

git clone https://github.com/lipku/python_rtmpstream.git cd python_rtmpstream git submodule update --init 

2、安装依赖库

pip install wheel conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge conda install ffmpeg  或者 apt install libavcodec-dev libavformat-dev libswscale-dev 

3、修改 python/CMakeLists.txt 文件, 根据python和ffmpeg安装路径修改如下部分(这一步一定要做,很多错误都是这里没改引起的)

set(PYTHON_EXECUTABLE /opt/anaconda3/envs/python37/bin/python)  #python bin dir  include_directories("/opt/anaconda3/envs/python37/include") #ffmpeg include dir find_library(AVCODEC_LIBRARY avcodec /opt/anaconda3/envs/python37/lib) #ffmpeg lib dir find_library(AVFORMAT_LIBRARY avformat /opt/anaconda3/envs/python37/lib) find_library(AVUTIL_LIBRARY avutil /opt/anaconda3/envs/python37/lib) find_library(SWSCALE_LIBRARY swscale /opt/anaconda3/envs/python37/lib) 

如果是 python3.10 以下,不能用相对路径,需要将如下部分改成绝对路径

include_directories("../streamer")  pybind11_add_module( ../streamer/streamer.cpp)  

4、安装python库

cd python pip install . 

三、运行测试程序

python test_stream.py 

更多详细使用请参考 https://github.com/lipku/nerfstream


2024-08-03(六)

相关内容

热门资讯

裸辞做“一人公司”,我后悔了 去年这个时候,一位以色列程序员正在东南亚旅行。他顺手把一个在脑子里转了很久的想法做成了产品,一个让任...
南京建成国内首个Pre-6G试... 4月21日,2026全球6G技术与产业生态大会在南京开幕。全息互动技术展台前,一名远在北京的工作人员...
超梵求职受邀参加“2025抖音... 超梵求职受邀参加“2025抖音巨量引擎成人教育行业生态大会”,探讨分享优质内容传播,服务万千学员。 ...
摩托罗拉Razr 2026(R... IT之家 4 月 22 日消息,摩托罗拉宣布新一代 Razr 折叠手机将于 4 月 29 日在美国发...
库克卸任,特纳斯领航:苹果新纪... 苹果首席执行官蒂姆·库克将卸任,硬件工程主管约翰·特纳斯将接任,苹果公司今天宣布此事。 库克将在夏季...