八、Python+FFmpeg,实战直播推流

1,环境变量

python.exe 的路径添加到环境变量中。

2,创建 py 文件,调用 ffmpeg

import subprocess
import time
#ffmpeg 录屏:5 秒
ffmpeger=subprocess.Popen('ffmpeg -thread_queue_size 16 -f gdigrab -i desktop -s 1280x720
-vcodec libx264 -y test2.mp4',
shell=True, stdin=subprocess.PIPE)
time.sleep(5)
ffmpeger.stdin.write('q'.encode("GBK"))
ffmpeger.communicate()
#ffmpeg 推流:rtmp
ffmpeger = subprocess.Popen('

相关推荐

  1. 、Python+FFmpeg,实战直播

    2024-04-29 14:52:01       12 阅读
  2. 四、搭建 FFmpeg,实战直播

    2024-04-29 14:52:01       11 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-29 14:52:01       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-29 14:52:01       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-29 14:52:01       19 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-29 14:52:01       20 阅读

热门阅读

  1. C语言-嵌入式-STM32:有哪些接口协议?

    2024-04-29 14:52:01       13 阅读
  2. Mac shell 环境变量配置

    2024-04-29 14:52:01       9 阅读
  3. Vue.js(过渡)

    2024-04-29 14:52:01       13 阅读
  4. Linux内核驱动开发-001字符设备开发-002led杂项驱动

    2024-04-29 14:52:01       12 阅读
  5. Stylus入门使用方法

    2024-04-29 14:52:01       14 阅读
  6. UKP3D轴侧图出图按照哪些标准

    2024-04-29 14:52:01       10 阅读