资源简介
1、解析rtpdump文件获取rtp包。
2、将rtp包解为hevc/h265裸流并存为265文件。
资源是一个完整的vs2012工程。
对应的CSDN博文http://blog.csdn.net/andyshengjl/article/details/79330610
代码片段和文件信息
#include
#include
#include “h265frame.h“
#include “RtpDump.h“
#include “rtpframe.h“
using namespace std;
#pragma comment(lib “shlwapi.lib“)
int main(int argc char* argv[])
{
H265frame *pHevcframe = NULL;
RD_buffer_t rdBuff;
char szInFileName[256] = ““;
char szOutFileName[256] = ““;
FILE *pInFile = NULL;
FILE *pOutFile = NULL;
if(argc<2){
cout << “RD2Hevc rtpdumpfile“ << endl;
return -1;
}
strcpy(szInFileNameargv[1]);
if(strcmp(PathFindExtension(szInFileName)“.rtpdump“)!=0){
cout << “input file error:[filename].rtpdump“ << endl;
return -1;
}
strcpy(szOutFileNameszInFileName);
strcpy(szOutFileName+strlen(szOutFileName)-7“h265“);
pInFile = fopen(szInFileName “rb+“);
if (pInFile == NULL){
cout << “open input file error:“ << szInFileName << endl;
return -1;
}
pOutFile = fopen(szOutFileName“wb“);
if(pOutFile == NULL){
fclose(pInFile);
cout << “open output file error:“ << szInFileName << endl;
return -1;
}
if(RD_header(pInFileNULL1)<0){
fclose(pInFile);
fclose(pOutFile);
cout << “rtpdump file error“ << endl;
return -1;
}
unsigned long ulBeginTS = 0;
unsigned long ulEndTS = 0;
u_char *pPayload = NULL;
int iGoodframe = -1;
pHevcframe = new H265frame();
while(RD_read(pInFile&rdBuff)>0){
RTPframe hevcRtp((const unsigned char *)rdBuff.p.datardBuff.p.hdr.length);
pPayload = hevcRtp.GetPayloadPtr();
cout << “HEVC SQN:“ << hevcRtp.GetSequenceNumber() << “ time:“ << hevcRtp.GetTimestamp() << “ len:“ << rdBuff.p.hdr.length << “ payloadsize:“ << hevcRtp.GetPayloadSize() << “ marker:“ << hevcRtp.GetMarker() << endl;
iGoodframe = pHevcframe->handleHevcframe(hevcRtp.GetSequenceNumber()hevcRtp.GetTimestamp()hevcRtp.GetPayloadPtr()hevcRtp.GetPayloadSize());
if(iGoodframe<0){
break;
}
if(iGoodframe == 0){
continue;
}
if(ulBeginTS == 0){
ulBeginTS = hevcRtp.GetTimestamp();
}
ulEndTS = hevcRtp.GetTimestamp();
fwrite(pHevcframe->m_buf1pHevcframe->m_buflenpOutFile);
}
cout << “durations: “ << (ulEndTS-ulBeginTS)/90000 << “s\n“;
delete pHevcframe;
fclose(pInFile);
fclose(pOutFile);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 76800 2018-02-16 21:59 RD2Hevc\Debug\RD2Hevc.exe
文件 7179 2018-02-14 22:33 RD2Hevc\h265fr
文件 2946 2018-02-16 18:17 RD2Hevc\h265fr
文件 2225 2018-02-16 18:10 RD2Hevc\RD2Hevc.cpp
文件 880 2018-02-14 22:25 RD2Hevc\RD2Hevc.sln
..A..H. 31744 2018-02-16 21:59 RD2Hevc\RD2Hevc.v11.suo
文件 4340 2018-02-14 22:50 RD2Hevc\RD2Hevc.vcxproj
文件 1430 2018-02-14 22:45 RD2Hevc\RD2Hevc.vcxproj.filters
文件 383 2018-02-14 23:38 RD2Hevc\RD2Hevc.vcxproj.user
文件 3412 2018-02-14 23:42 RD2Hevc\RtpDump.cpp
文件 3171 2018-02-14 22:48 RD2Hevc\RtpDump.h
文件 2312 2018-02-14 19:38 RD2Hevc\rtpfr
目录 0 2018-02-16 22:00 RD2Hevc\Debug
目录 0 2018-02-16 21:59 RD2Hevc
----------- --------- ---------- ----- ----
136822 14
相关资源
- MT6771T_LTE-A_Smartphone_Application_Processor
- 解码hevc解析h265流
- ffmpegh265rtmp.zip
- 在QT中使用RTP进行视频的采集和传输
- 流媒体相关协议标准RTP/RTSP/RTCP PDF文档
- RTMP_H265推流直播技术研讨
- 海思rtp封包发送
- h265 裸流文件
- openHEVC-hm10.0
- 使用gpac封装MP4源码(新)
- 论文研究-一种简化的HEVC率失真优化技
- smartprinter3.6免注册
- High Efficiency Video Coding(HEVC_book)
- High Efficiency Video Coding (Hevc) Algori
- HEVC/h.265视频编码解码
- H.265金山云演进之路
- 4K H265码流测试文件.h265
- h265/hevc 格式的mp4测试文件
- RtspRtcpRtpLoad_h264.tar.gz
- 简单的RTSP RTP RTCP推送H264码流服务器实
- Elecard HEVC Analyzer v1.14
- rtsp 服务器代码,VC可编译使用,RTS
- H265标准文档最新版,2018.2
- T-REC-H.265-201410-I!!PDF-E.pdf
- HEVC/H265 协议、学习资料包
- 新一代高效视频编码H.265HEVC原理、标
- h265/HEVC测试用视频数据
- 编译FFmpeg3.2.2生成的库文件及头文件
- DDS-RTPS 实时发布订阅协议 DDS互操作协
- h264码流rtp传输demo
评论
共有 条评论