资源简介
gpac库把H265与AAC封装成MP4的接口(新),https://blog.csdn.net/LLL347/article/details/85886975

代码片段和文件信息
#include “MP4Writer.h“
#include
#include “gpac/isomedia.h“
#include “gpac/constants.h“
extern “C“ {
#include “gpac/internal/media_dev.h“
}
#define INIT_STATUS 0
#define CONFIG_STATUS 1
#define CONFIG_FINISH 2
static s8 GetSampleRateID(u32 SamplRate)
{
switch (SamplRate)
{
case 96000: return 0;
case 88200: return 1;
case 64000: return 2;
case 48000: return 3;
case 44100: return 4;
case 32000: return 5;
case 24000: return 6;
case 22050: return 7;
case 16000: return 8;
case 12000: return 9;
case 11025: return 10;
case 8000 : return 11;
case 7350 : return 12;
default: return -1;
}
}
//gf_m4a_get_profile
static u8 GetAACProfile(u8 AudioType u32 SampleRate u8 Channel)
{
switch (AudioType)
{
case 2: /* AAC LC */
{
if (Channel <= 2) return (SampleRate <= 24000) ? 0x28 : 0x29; /* LC@L1 or LC@L2 */
if (Channel <= 5) return (SampleRate <= 48000) ? 0x2A : 0x2B; /* LC@L4 or LC@L5 */
return (SampleRate <= 48000) ? 0x50 : 0x51; /* LC@L4 or LC@L5 */
}
case 5: /* HE-AAC - SBR */
{
if (Channel <= 2) return (SampleRate <= 24000) ? 0x2C : 0x2D; /* HE@L2 or HE@L3 */
if (Channel <= 5) return (SampleRate <= 48000) ? 0x2E : 0x2F; /* HE@L4 or HE@L5 */
return (SampleRate <= 48000) ? 0x52 : 0x53; /* HE@L6 or HE@L7 */
}
case 29: /*HE-AACv2 - SBR+PS*/
{
if (Channel <= 2) return (SampleRate <= 24000) ? 0x30 : 0x31; /* HE-AACv2@L2 or HE-AACv2@L3 */
if (Channel <= 5) return (SampleRate <= 48000) ? 0x32 : 0x33; /* HE-AACv2@L4 or HE-AACv2@L5 */
return (SampleRate <= 48000) ? 0x54 : 0x55; /* HE-AACv2@L6 or HE-AACv2@L7 */
}
default: /* default to HQ */
{
if (Channel <= 2) return (SampleRate < 24000) ? 0x0E : 0x0F; /* HQ@L1 or HQ@L2 */
return 0x10; /* HQ@L3 */
}
}
}
static void GetAudioSpecificConfig(u8 AudioType u8 SampleRateID u8 Channel u8 *pHigh u8 *pLow)
{
u16 Config;
Config = (AudioType & 0x1f);
Config <<= 4;
Config |= SampleRateID & 0x0f;
Config <<= 4;
Config |= Channel & 0x0f;
Config <<= 3;
*pLow = Config & 0xff;
Config >>= 8;
*pHigh = Config & 0xff;
}
/* 返回的数据包括起始的4个字节0x00000001 */
static u8* FindNalu(u8 *pStart u32 Size u8 *pNaluType u32 *pNaluSize)
{
u8 *pEnd;
u8 *pCur;
u8 *pOut;
u8 NaluType;
if (4 >= Size)
return NULL;
/* 找第一个0x00000001 */
pCur = pStart;
pEnd = pStart + Size - 4;
while (pCur < pEnd)
{
if ( (0 == pCur[0]) && (0 == pCur[1]) && (0 == pCur[2]) && (1 == pCur[3]) )
break;
pCur++;
}
if (pCur >= pEnd)
return NULL;
Nalu
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 16959 2019-01-11 15:46 MP4Writer.cpp
文件 810 2019-01-05 23:19 MP4Writer.h
相关资源
- MP4编解C源代码
- 监控专用MP4文件播放器
- mp4转TS工具
- 格式工厂所缺失的mp4creator.exe
- qt_ffmpeg_mp4_export_and_import.zip
- 基于ffmpeg将avi视频转换为mp4视频
- (补充)修改output-example,将H.264AAC帧
- ffmpeg转换MP4为JPG帧图片
- ffmpeg提取mp4关键帧保存为jpg.zip
- mp4_play.zip
-
KindEditor与jwpla
yer集成,优化kindEdi - mp4测试视频,可以用它测试处理MP4文
- ffmpeg封装H264成MP4、AVI视频格式,及提
- 嵌入式音频视频混合为mp4(mp4v2+faac
- PkgPack.7z
- 理光MP4001、5001复印机维修手册
- 10s测试短片MP4
- 使用gpac封装MP4源码(新)
- QLV直转MP4工具
- MP4v2录制rtsp流存为MP4文件
- qsv转MP4.zip
- MP4超快超清晰压制工具绿色注册版
- ISO_IEC_14496-12_2015
- 腾讯视频QLV格式直转MP4工具
- HandBrake视频转换VS2010编译通过
- 如何使用mp4v2将H264+AAC裸流录制成mp4文
- 各种格式mp4、wmv、avi、mov等的视频转
- nginx搭建flv流媒体教程与资源
- SNMP大全--snmp4j(get trapset取mib)
- qlv转mp4,亲测可用,找了几天才找到
评论
共有 条评论