ffmpeg

FFmpeg RGB转H264

允我心安 提交于 2020-12-06 18:15:52
前言 下面代码是在我的上一篇博客: FFmpeg RGB转YUV 的代码的基础上修改而来的,创建了编码器并进行 H264 编码,进一步将 RGB 格式像素数据转换成 H264 格式像素数据,亲测有效。 <br /> 完整代码 #include <iostream> extern "C" { #include <libavformat/avformat.h> #include <libswscale/swscale.h> } #pragma comment(lib,"avformat.lib") #pragma comment(lib,"avcodec.lib") #pragma comment(lib,"avutil.lib") #pragma comment(lib,"swscale.lib") using namespace std; int main() { char infile[] = "dove_BGRA.rgb"; char outfile[] = "out.264"; // 源图像参数 int width = 640; int height = 360; int fps = 25; //1 打开RGB和H264文件 FILE *fpin = fopen(infile, "rb"); if (!fpin) { cout << infile << "open

人工智能-语音合成-语音识别

拈花ヽ惹草 提交于 2020-12-06 05:26:50
图灵机器人: http://www.tuling123.com 百度开发平台: http://ai.baidu.com/ 下载 baidu-api 如果已安装pip,执行 pip install baidu-aip 即可。 ffmpeg 先下载文件,再配置到系统路径 下载完安装包,解压后,将该绝对路径 配置到系统路径。 配置成功如下: 打开电脑的录音机。 jieba中文分词 1. 2.创建应用 3.自动生成 4. 语音合成 1. 2.复制代码到一个新的py文件中。 3.右键运行,即可将文字转成语音。 代码: # 语言合成 文字 ->语音 from aip import AipSpeech """ 你的 APPID AK SK """ APP_ID = ' 11262331 ' API_KEY = ' Weu6QCLgU8oCPvULqpOSer7c ' SECRET_KEY = ' wMThGsaL8NPdNgE6z4A3Rmes1DvWNBO1 ' client = AipSpeech(APP_ID, API_KEY, SECRET_KEY) result = client.synthesis( ' 你好呀,我的贝贝 ' , ' zh ' , 1 , { ' vol ' : 5 , ' spd ' : 6 , ' pit ' : 3 , ' vol ' : 9 , ' per '

EasyDarwin流媒体服务器的简介和搭建

早过忘川 提交于 2020-12-06 04:10:54
一:简介 EasyDarwin开源流媒体服务器(www.easydarwin.org)现在使用Go版本实现了。最新的代码提交,已经支持了推流(或者拉流 )的同时进行本地存储。 本地存储的原理,是在推流的同时启动ffmpeg作为一路Client来做存储。ffmpeg在demux和mux的工作方面已经十分成熟,我们 没必要再重复发明轮子。因此这种做法十分取巧而且简单有效,也不会侵入原来的代码架构。如下图所示: 官方链接:https://ffmpeg.zeranoe.com/builds/ 二:搭建EasyDarwin流媒体服务 1.准备一台主机 192.168.175.200 vip 2.关闭防火墙和selinux 命令:[root@vip ~ ]# iptables -F && systemctl stop firewalld && setenforce 0 3.下载安装包(打开浏览器) https://github.com/EasyDarwin/EasyDarwin/releases 4.装包解包 命令:[root@vip ~]# tar -zvxf EasyDarwin-linux-8.1.0-1901141151.tar.gz 5.修改配置 命令:[root@vip ~]# cd EasyDarwin-linux-8.1.0-1901141151/ 命令:[root@vip

Node.js - Buffer Data to Ffmpeg

风格不统一 提交于 2020-12-05 12:50:23
问题 I used Node.js and Ffmpeg to create animations. Because I was trying to avoid third-party avi/mp4 parsers, I decided to output the animation as raw rgb24 data file and then use some program to convert it to mp4 file. I found that Ffmpeg is free and open source which can do exactly it. So, I made a Node.js application which allocates a Buffer of size 1920 x 1080 x 3 (width times height times number of bytes per pixel), then I created a rendering context library, and finally I animated frame by

Node.js - Buffer Data to Ffmpeg

◇◆丶佛笑我妖孽 提交于 2020-12-05 12:47:02
问题 I used Node.js and Ffmpeg to create animations. Because I was trying to avoid third-party avi/mp4 parsers, I decided to output the animation as raw rgb24 data file and then use some program to convert it to mp4 file. I found that Ffmpeg is free and open source which can do exactly it. So, I made a Node.js application which allocates a Buffer of size 1920 x 1080 x 3 (width times height times number of bytes per pixel), then I created a rendering context library, and finally I animated frame by

Node.js - Buffer Data to Ffmpeg

倖福魔咒の 提交于 2020-12-05 12:45:05
问题 I used Node.js and Ffmpeg to create animations. Because I was trying to avoid third-party avi/mp4 parsers, I decided to output the animation as raw rgb24 data file and then use some program to convert it to mp4 file. I found that Ffmpeg is free and open source which can do exactly it. So, I made a Node.js application which allocates a Buffer of size 1920 x 1080 x 3 (width times height times number of bytes per pixel), then I created a rendering context library, and finally I animated frame by

【融云分析】基于 ffmpeg 实现重采样和混音

非 Y 不嫁゛ 提交于 2020-12-05 10:13:54
音频概念介绍 采样率 一秒钟内对声音信号的采样次数称为采样率,单位 Hz。采样率越高所表示的声波越平滑,对声音的还原度就越好,需要的存储空间也会更大。在数字音频领域常见的采样率有: 8000Hz 电话所用采样率 22050Hz 无线电广播所用采样率 32000Hz miniDV 数码视频 camcorder、DAT(LPmode) 所用采样率 44100Hz 音频 CD,也常用于 MPEG-1 音频(VCD,SVCD,MP3)所用采样率 48000Hz miniDV、数字电视、DVD、DAT、电影和专业音频所用的数字声音所用采样率 96000或192000Hz DVD-Audio、一些 LPCMDVD 音轨、BD-ROM(蓝光盘)音轨、和 HD-DVD(高清晰度 DVD )音轨所用所用采样率 采样精度 对声音信号的每一次采样在计算机中都表示为一个数字,数字的取值范围越大所表示的声音振幅的变化范围就越大,在 Android 中支持的采样精度有三种,定义在 AudioFormat 中 // 一次采样需要 2 个字节表示 public static final int ENCODING_PCM_16BIT = 2; // 一次采样需要 3 个字节表示 public static final int ENCODING_PCM_8BIT = 3; // 一次采样需要 4 个字节表示

开源流媒体平台如何用FFMPEG将RTSP视频流推给EasyDarwin做公网拉流分发?

白昼怎懂夜的黑 提交于 2020-12-05 05:54:39
EasyDarwin是基于Darwin Streaming Server扩展、维护的开源流媒体服务器解决方案,经过TSINGSEE青犀视频团队近10年的维护,现在已经非常稳定。最关键是团队一直秉承着开源的态度,这在国内可以说非常不容易了。 最近在研究EasyDarwin做拉流分发的时候,忽然想到是否可以用FFMPEG实现拉RTSP流然后推给EasyDarwin,如果可以的话,那么FFMPEG拉过来的RTSP流就可以在处理之后推给EasyDarwin。 那么,接下来将为大家讲述一下实现过程。 如何用FFMPEG拉RTSP流推给EasyDarwin做公网分发 1.首先需要下载FFMPEG。我下载的是下面的版本,如图所示: 查看版本: 2.利用FFMPEG拉转推RTSP的命令: ffmpeg .exe -i rtsp://admin:a 1234567 @ 192.168.10.213:554 /Streaming/Channels/ 101 -vcodec libx 264 -acodec libvo_aacenc -rtsp_transport tcp -f rtsp rtsp:// 192.168.99.148 /test.sdp 如下图所示: 在EasyDarwin的管理页面里,我们可以看到这条记录,如下图: 3.用VLC拉取流播放效果如下: 来源: oschina 链接:

Generate a movie with ffmpeg from a changing still image url?

我与影子孤独终老i 提交于 2020-12-04 12:48:19
问题 I need to create a movie/stream with ffmpeg from a HTTP url that points to an image. This image gets updated 1 time per second. I already know how to convert from MPEG-4 to flv for example using the ffmpeg command line, but now I need to start from this still image that gets updated. I would like ffmpeg to 'GET' the url 1 time per second for example. regards, Wim 回答1: The command line option needed is -loop_input . I am currenly using this command line to do it: ffmpeg -loop_input

Generate a movie with ffmpeg from a changing still image url?

本小妞迷上赌 提交于 2020-12-04 12:27:51
问题 I need to create a movie/stream with ffmpeg from a HTTP url that points to an image. This image gets updated 1 time per second. I already know how to convert from MPEG-4 to flv for example using the ffmpeg command line, but now I need to start from this still image that gets updated. I would like ffmpeg to 'GET' the url 1 time per second for example. regards, Wim 回答1: The command line option needed is -loop_input . I am currenly using this command line to do it: ffmpeg -loop_input