1、功能说明
265视频对接
2、操作说明
2.1 设备都是265格式的视频
启动时调用
int TTXNET_SetMediaInfo(int nAudioType, int nAudioChannel, int nAudioSamplesPerSec, int nAudioBitPerSamples, int nVideoCoder)
将nVideoCoder配置为TTX_VIDEO_CODEC_H265
不同通道的视频格式不一样
//获取视频参数
//@nChannel: 通道号从0开始
//@nStreamType: TTX_STREAM_TYPE_MAIN 或 TTX_STREAM_TYPE_SUB
//@nVideoCoder: 音频类型TTX_VIDEO_CODEC_H264 等TTX_VIDEO_CODEC_H265
//如果不同通道的视频格式不一样时,请重载此接口,例如通道1是264,通道2是265
//如果是同一个视频格式,则不需要重载GetVideoParam接口
virtual bool GetVideoParam(int nChannel, int nStreamType, int& nVideoCoder) { return false; }
重载GetVideoParam,根据通道格式不同,返回不同的视频格式
示例:
bool GetVideoParam(int nChannel, int nStreamType, int& nVideoCoder)
{
if (nChannel == 1)
{
nVideoCoder = TTX_VIDEO_CODEC_H264;
}
else
{
nVideoCoder = TTX_VIDEO_CODEC_H265;
}
return true;
}
说明:I帧数据前面需要加上vps,sps和pps
2.2 远程回放
//取得文件信息
virtual void GetFileInfo(TTXFILEInfo_S* pFileInfo) = 0;
//文件信息
typedef struct _tagTTXFILEInfo_S
{
int nYear; //年 2013
int nMonth; //月 5
int nDay; //日 29
int nBegHour; //开始时间
int nBegMinute;
int nBegSecond;
_u64long u64BegPts; //文件起始的时间戳
unsigned int uiTotalMinSecond; //文件总时长,毫秒
unsigned int uiAudioCodec; //音频解码器类型 TTX_AUDIO_TYPE_G726_40KBPS
unsigned int uiAudioChannel; //音频通道
unsigned int uiAudioSamplesPerSec; //音频采样率
unsigned int uiAudioBitPerSamples; //音频每个取样所需的位元数
unsigned int uiInfoCodec; //信息帧解码器 TTX_INFO_CODEC_WKP
unsigned int uiVideoCodec; //视频帧解码器 TTX_VIDEO_CODEC_H264
unsigned char ucResolution; //分辨率 TTX_RESOLUTION_720P
char szReserve[59]; //保留字段
} TTXFILEInfo_S, *LPTTXFILEInfo_S;
uiVideoCodec返回相应的视频格式