资源简介
linux环境,基于rtmp推流源代码,源文件可以下载参考学习
代码片段和文件信息
#include “AACEncoder.h“
AACEncoder::AACEncoder(int sampleRate int channals int bitrate) {
mEncoder = faacEncOpen(sampleRate channals &mMaxSample &mBufLength);
if (mEncoder != NULL) {
faacEncConfigurationPtr conf = faacEncGetCurrentConfiguration(mEncoder);
conf->inputFormat = FAAC_INPUT_16BIT;
conf->outputFormat = 1;
conf->aacobjectType = LOW;
conf->allowMidside = 0;
conf->useLfe = 0;
conf->bitRate = bitrate;
conf->bandWidth = 0.5 * bitrate;
faacEncSetConfiguration(mEncoder conf);
mDataBuf = new char[mBufLength];
}
}
AACEncoder::~AACEncoder() {
if (mEncoder != NULL) {
faacEncClose(mEncoder);
delete[] mDataBuf;
}
}
std::pair AACEncoder::encode(int sample char* data) {
if (mEncoder == NULL || (int) mMaxSample < sample) {
return std::make_pair(-1 NULL);
}
int size = faacEncEncode(mEncoder reinterpret_cast(data) sample reinterpret_cast(mDataBuf) mBufLength);
if (size < 0) {
return std::make_pair(-1 NULL);
}
return std::make_pair(size mDataBuf);
}
std::pair AACEncoder::getmetadata() {
unsigned char *buf;
unsigned long size;
faacEncGetDecoderSpecificInfo(mEncoder &buf &size);
memcpy(mDataBuf buf size);
delete[] buf;
return std::make_pair(size mDataBuf);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
....... 97 2017-03-09 17:44 live-rtmp-publisher-master\CMakeLists.txt
....... 26 2017-03-09 17:44 live-rtmp-publisher-master\config.h.in
....... 307 2017-03-09 17:44 live-rtmp-publisher-master\README.md
....... 1456 2017-03-09 17:44 live-rtmp-publisher-master\src\AACEncoder.cpp
....... 998 2017-03-09 17:44 live-rtmp-publisher-master\src\AACRTMPPackager.cpp
....... 1087 2017-03-09 17:44 live-rtmp-publisher-master\src\AACStream.cpp
....... 767 2017-03-09 17:44 live-rtmp-publisher-master\src\CMakeLists.txt
....... 550 2017-03-09 17:44 live-rtmp-publisher-master\src\cv\CvVideoSource.cpp
....... 927 2017-03-09 17:44 live-rtmp-publisher-master\src\cv\MotionDetector.cpp
....... 427 2017-03-09 17:44 live-rtmp-publisher-master\src\FilteredVideoSource.cpp
....... 1680 2017-03-09 17:44 live-rtmp-publisher-master\src\H264Encoder.cpp
....... 1716 2017-03-09 17:44 live-rtmp-publisher-master\src\H264RTMPPackager.cpp
....... 1423 2017-03-09 17:44 live-rtmp-publisher-master\src\H264Stream.cpp
....... 498 2017-03-09 17:44 live-rtmp-publisher-master\src\include\AACEncoder.h
....... 423 2017-03-09 17:44 live-rtmp-publisher-master\src\include\AACRTMPPackager.h
....... 452 2017-03-09 17:44 live-rtmp-publisher-master\src\include\AACStream.h
....... 414 2017-03-09 17:44 live-rtmp-publisher-master\src\include\AudioSource.h
....... 559 2017-03-09 17:44 live-rtmp-publisher-master\src\include\cv\CvVideoSource.h
....... 806 2017-03-09 17:44 live-rtmp-publisher-master\src\include\cv\MotionDetector.h
....... 615 2017-03-09 17:44 live-rtmp-publisher-master\src\include\FilteredVideoSource.h
....... 502 2017-03-09 17:44 live-rtmp-publisher-master\src\include\H264Encoder.h
....... 493 2017-03-09 17:44 live-rtmp-publisher-master\src\include\H264RTMPPackager.h
....... 656 2017-03-09 17:44 live-rtmp-publisher-master\src\include\H264Stream.h
....... 426 2017-03-09 17:44 live-rtmp-publisher-master\src\include\MemoryPool.h
....... 643 2017-03-09 17:44 live-rtmp-publisher-master\src\include\PacketQueue.h
....... 715 2017-03-09 17:44 live-rtmp-publisher-master\src\include\PCMSource.h
....... 339 2017-03-09 17:44 live-rtmp-publisher-master\src\include\RTMPPackager.h
....... 374 2017-03-09 17:44 live-rtmp-publisher-master\src\include\RTMPPublisher.h
....... 1037 2017-03-09 17:44 live-rtmp-publisher-master\src\include\V4L2Source.h
....... 225 2017-03-09 17:44 live-rtmp-publisher-master\src\include\Videofr
............此处省略17个文件信息
相关资源
- h323plus音视频聊天Demo
- webRTC信令服务器实现音视频聊天
- 基于arm的车载娱乐系统.zip
- 网络视讯平台应用研究
- rtsp解析实现音视频实时传输
- RTP流传输音视频
- 抖音快手无水印视频批量
- Elecard Video Format Analyzer
- e语言-易语言抖音视频自动上传协议源
- 全球抖音解析采集软件1.5.zip
- 快抖(抖音视频在线播放)浏览器插
- 抖音批量视频永久有效.zip
- ios采集音视频数据并通过rtmp上传到
- MPEG-DASH白皮书第一版及其翻译
- 音视频WebRTC实时互动直播技术实战视
- 利用ffmpeg实现RTSP,RTMP推流以及保存到
- 基于Qt5音视频播放器
评论
共有 条评论