当前位置: 首页 > news >正文

基于Whisper语音识别的实时视频字幕生成 (一): 流式显示视频帧和音频帧

Whishow

img1

Whistream(微流)是基于Whisper语音识别的的在线字幕生成工具,支持rtsp/rtmp/mp4等视频流在线语音识别

1. whishow介绍

whishow(微秀)是在线音视频流播放python实现,支持rtsp/rtmp/mp4等输入,也是whistream的前端。python实现原理如下:
if __name__ == "__main__":stm = STREAM()spc = SPROCESS()ply = PLAY()# url = sys.argv[1]url = "test.mp4"# 线程1:esc退出播放def engine():global plyimport keyboardwhile 1:if keyboard.is_pressed('esc'):breaktime.sleep(0.01)stm.running = Falsespc.running = Falseply.running = False# 线程2:读取视频流和音频流 (保存一级cache)def process1():global stmstm.read(url = "test.mp4",video_dst_frame_size=[-1,-1],cache_size=10*60)# 线程2:处理帧(保存二级cache)def process2():global spcwhile not check_stream():time.sleep(1)spc.run(cache_size=2*60,asr=False,step=1)# 播放视频 (播放二级cache)def process3():global plywhile not check_stream():time.sleep(1)ply.init_state(start=0,step=1)ply.run()p0 = threading.Thread(target=engine,args=())p1 = threading.Thread(target=process1,args=())p2 = threading.Thread(target=process2,args=())p3 = threading.Thread(target=process3,args=())p0.start()p1.start()p2.start()p3.start()

exe下载地址:https://github.com/coolEphemeroptera/Whishow/releases

whistream将在whishow基础上引入whisper进行在线语音识别生成视频字幕

2. 使用

python:

python whishow.py <视频路径>
例1:python whishow.py ./test.mp4
例2:python whishow.py rtmp://mobliestream.c3tv.com:554/live/goodtv.sdp

命令行:

./whishow.exe <视频路径>

显示如下:
img2

3. 联系我们

605686962@qq.com
coolEphemeroptera@gmail.com

http://www.lryc.cn/news/335364.html

相关文章:

  • STM32+ESP8266水墨屏天气时钟:文字取模和图片取模教程
  • 华为机试题
  • 【VUE】Vue3+Element Plus动态间距处理
  • 华为 2024 届校园招聘-硬件通⽤/单板开发——第一套(部分题目分享,完整版带答案,共十套)
  • 自己整理的ICT云计算题库四
  • 5.消息队列
  • 基于强化学习的对抗意图识别
  • vue canvas绘制信令图,动态显示标题、宽度、高度
  • 无影云电脑不能连接到本机的调试串口的解决方案
  • gpt科普1 GPT与搜索引擎的对比
  • Element-plus使用中遇到的问题
  • 如何使用Arduino IDE对STM32F103C8T6进行编程
  • 【迅为iMX6Q】开发板 Linux version 6.6.3 SD卡 启动
  • C语言每日一题(66)三数之和
  • vue3-element-admin实现同一个菜单多标签
  • 第三十六节 Java 网络编程
  • DRF的认证、权限、限流、序列化、反序列化
  • 解决:Cannot read properties of undefined (reading ‘validate‘)问题
  • 关于IP地址发展历程的详细探讨
  • 【LeetCode热题100】【二叉树】将有序数组转换为二叉搜索树
  • 文心一言和GPT-4全面比较
  • Mac的终端配置
  • 制作一个RISC-V的操作系统十-Trap和Exception(流 mtvec mepc mcause mtval mstatus trap完整流程)
  • 【爬虫开发】爬虫从0到1全知识md笔记第4篇:Selenium课程概要,selenium的介绍【附代码文档】
  • 对一个时间序列中的每个元素按照指定精度向上取整
  • 51单片机+TN901非接触式红外测温设计论文与源码PCB等资料
  • AI创业项目:AI旅游规划定制师
  • win 安装 Stable Diffusion
  • STM32F407+FreeRTOS+LWIP UDP组播
  • (源码+部署+讲解)基于Spring Boot + Vue的车位租赁系统设计与实现