一. 安装moviepy模块
1.如果你用的PyCharm,导包的时候报错后 可以直接按Alt+Shift+Enter ( install moviepy)
2.也可以在终端输入 pip install moviepy,(前提是安装好了pip及配好了环境)

文章图片
二.MP4转MP3格式
【pycharm|【Python实现视频转文字操作】】这个MP4转MP3的操作,很多app都要收钱或开vip,所以自己敲代码实现还省钱了
#导入editor包中的AudioFileClip类
from moviepy.editor import AudioFileClipmp4=AudioFileClip("E:\Python\转换的素材MP4\p1.MP4")
mp4.write_audiofile("E:\Python\转换的素材MP4\p1.mp3")
print("导入完成")

文章图片
三.mp3转文字 首先在讯飞开放平台-以语音交互为核心的人工智能开放平台中购买语言转写的API,先登录,新用户实名登录后有免费使用的转换时长。申请时注明项目。

文章图片

文章图片
然后就是引用了知乎博主的代码,同时有更详细的操作 python将音频/视频文件转为word文本 - 知乎个人主页地址:皮小孩的个人站点 前言:今天朋友在群里面问有没有音频转文字的免费软件?我就去网上搜了一下,发现网上大多数是超出一定时长就收费的,而我朋友的音频比较多,加起来有几个小时,于是我想着能不能…

文章图片
https://zhuanlan.zhihu.com/p/350877084

文章图片

文章图片

文章图片
成功把视频中的语音转换成了文本。
推荐阅读
- numpy学习|numpy04——搜索相关功能的函数并获取帮助
- python|数字图像处理-Python实现BMP图片(位图)旋转-代码实例
- Leetcode|【lc刷题】557 反转字符串中的单词 III_Day04 + 反转小结
- Matplotlib|Python matplotlib seaborn(学习笔记)
- Phthon|Python词云
- 大数据分析|Python matplotlib plotly
- 解释器
- 构建python基础镜像
- Python "爬虫"出发前的装备之简单实用的 Requests 模块