- 博客(11)
- 资源 (14)
- 收藏
- 关注
原创 ffmpeg decode resample
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <windows.h>extern "C"{#include <libavutil/frame.h>#include <libavutil/mem.h>#include <libavcodec/avcodec.h>#include <libavformat/av...
2020-09-29 17:30:30 163
原创 音频重采样,生成packet格式的PCM数据
1. int64_t src_ch_layout = AV_CH_LAYOUT_MONO; int64_t dst_ch_layout = AV_CH_LAYOUT_STEREO; int src_rate = 16000; int dst_rate = 44100; AVSampleFormat src_fmt = AV_SAMPLE_FMT_S16; AVSampleFormat dst_fmt = AV_SAMPLE_FMT_S16P;对上面的PC...
2020-09-25 11:22:40 518
原创 FFMPEG 实现音频resample(重采样)
#define __STDC_CONSTANT_MACROS#include <string.h>extern "C"{#include "libavutil/avutil.h"#include "libavdevice/avdevice.h"#include "libavformat/avformat.h"#include "libavcodec/avcodec.h"#include "libswresample/swresample.h"#include "lib...
2020-09-14 17:28:43 1889 3
原创 FFMPEG decode mp4, SDL play
#include <iostream>//Refresh Event#define SFM_REFRESH_EVENT (SDL_USEREVENT + 1)#define SFM_BREAK_EVENT (SDL_USEREVENT + 2)extern "C" { #include <libavformat/avformat.h> #include <libavcodec/avcodec.h> #includ.
2020-09-11 17:31:28 249
转载 PCM音频数据
目录什么是PCM? PCM数据格式 FFmpeg支持的PCM数据格式 FFmpeg中Packed和Planar的PCM数据区别 字节序 PCM音频数据的处理 参考1. 什么是PCM?PCM(Pulse Code Modulation,脉冲编码调制)音频数据是未经压缩的音频采样数据裸流,它是由模拟信号经过采样、量化、编码转换成的标准数字音频数据。描述PCM数据的6个参数:Sample Rate : 采样频率。8kHz(电话)、44.1kHz(CD)、48kHz(DVD)。 Sa
2020-09-05 21:39:02 372
原创 FFMPEG encode PCM
存在问题:播放速度太快/** * *本程序实现了音频PCM采样数据编码为压缩码流(MP3,WMA,AAC等)。 * */#include <stdio.h>#define __STDC_CONSTANT_MACROSextern "C"{#include "libavformat/avformat.h"#include "libavformat/avio.h"#include "libavdevice/avdevice.h"#include "l...
2020-09-04 17:32:12 267
转载 avcodec_encode_audio2返回-22
错误原因该函数的主要功能:根据音频编码器和音频frame数据编码成音频packt数据。 返回-22主要原因:参数错误,具体如下 音频编码器的参数(声道数,采样率,采样格式,位宽,采样数)和frame的参数不一致。 编码格式对应的采样数和frame的采样数不一致。 只要声道数,采样率,采样格式,位宽,采样数,任何一个参数不一致,都需要进行重采样。 AAC对应的采样数(nb_samples)和frame大小(frame_size)都是1024. AAC对应的采样数(nb_samples)
2020-09-04 16:28:01 1626
原创 FFMPEG encode audio
#include <stdint.h>#include <stdio.h>#include <stdlib.h>extern "C"{#include <libavcodec/avcodec.h>#include <libavutil/channel_layout.h>#include <libavutil/common.h>#include <libavutil/frame.h>#inclu...
2020-09-04 13:33:13 269 1
原创 FFMPEG 音频编码
extern "C"{#include "libavformat/avformat.h"#include "libavcodec/avcodec.h"}/* check that a given sample format is supported by the encoder */static int check_sample_fmt(const AVCodec *codec, enum AVSampleFormat sample_fmt){ const enum AVSampleFo..
2020-09-03 23:43:47 607 1
转载 FFMPEG编码元素YUV数据为H264格式
#include <stdio.h>#define __STDC_CONSTANT_MACROS#ifdef _WIN32//Windowsextern "C"{#include "libavutil/opt.h"#include "libavcodec/avcodec.h"#include "libavformat/avformat.h"};#else//Linux...#ifdef __cplusplusextern "C"{#endif#incl...
2020-09-03 16:28:59 256
原创 FFMPEG获取摄像头数据,并编码为H264格式
#define __STDC_CONSTANT_MACROS#include <string.h>extern "C"{#include "libavutil/avutil.h"#include "libavdevice/avdevice.h"#include "libavformat/avformat.h"#include "libavcodec/avcodec.h"#include "libswresample/swresample.h"#include "lib...
2020-09-03 16:00:41 1277
libjingle学习笔记
2017-01-03
RPM for Oracle11g
2016-10-05
Java编程思想第四版完整中文高清版
2015-06-03
Beginning.Python.From.Novice.to.Professional,2nd.Edition
2015-05-10
UNIX环境高级编程(第二版中文)
2015-04-16
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人