android librtmp 推送h264流 aac流 基本过程总结五 推流aac

本文总结了使用Android的librtmp库推送H264视频流和AAC音频流的基本过程,重点探讨了如何实现AAC音频的推流操作。
摘要由CSDN通过智能技术生成

android librtmp 推送h264流 aac流 基本过程总结三 推流aac

1,aac 编码初始化
定义编码的结构体
typedef struct AudioEncodeFaacInformation
{
	faacEncHandle   hEncoder;
	faacEncConfigurationPtr pConfiguration;
	int init_flag;
	unsigned long   nInputSamples;
	unsigned long   nMaxOutputBytes;
}AudioEncodeFaac;

int Audio_Encode_Init_Faac(AudioEncodeFaac *args, int nSampleRate, int channel)
{
	int ret = 0;
	if (args == NULL)
		return -1;
	memset(args, 0, sizeof(AudioEncodeFaac));
	args->hEncoder = faacEncOpen(nSampleRate, channel, &args->nInputSamples, &args->nMaxOutputBytes);
	args->pConfiguration = faacEncGetCurrentConfiguration(args->hEncoder);
	if (args->pConfiguration == NULL)
	{
		goto end;
	}
	// 设置编码配置信息  
	/*
	PCM Sample Input Format
	0   FAAC_INPUT_NULL         invalid, signifies a misconfigured config
	1   FAAC_INPUT_16BIT        native endian 16bit
	2   FAAC_INPUT_24BIT        native endian 24bit in 24 bits      (not implemented)
	3   FAAC_INPUT_32BIT        native endian 24bit in 32 bits      (DEFAULT)
	4   FAAC_INPUT_FLOAT        32bit floating point
	*/
	args->pConfigur
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值