資源簡介
H264 rtp 打包
代碼片段和文件信息
import?java.io.*;
import?java.net.*;
public?class?MyTest?
{
//?主函數
public?static?void?main(String?arg[])?throws?IOException
{
????????//String?fileName?=?“F:/test22.264“;
String?fileName?=?“F:/camera.h264“;
????????InitSocket();
//ReadFromFile.readFileByBytes(fileName);
????????file?=?new?File(fileName);
????????in?=?new?FileInputStream(file);
????????
????????int?seq_num?=?0;
????????int bytes=0;
????????
????????//?時間戳增量
????????float?framerate?=?25;
????????int?timestamp_increse=0ts_current=0;
???? timestamp_increse=(int)(90000.0?/?framerate);?//+0.5);
????????//?rtp包緩沖
????????byte[]?sendbuf?=?new?byte[1500];
????????
????????while(!(0?==?in.available()))?{
????????
???????? NALU_t?n?=?new?NALU_t();
???????? GetAnnexbNALU(n);?//?每執行一次?文件指針指向本次找到的N
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????232??2012-07-05?16:40??NALDecoder\.classpath
?????文件????????386??2012-07-05?16:40??NALDecoder\.project
?????文件???????5867??2012-07-10?15:40??NALDecoder\bin\MyTest.class
?????文件????????459??2012-07-10?15:40??NALDecoder\bin\NALU_t.class
?????文件???????1888??2012-07-10?15:40??NALDecoder\bin\ReadFromFile.class
?????文件??????16440??2012-07-10?15:40??NALDecoder\src\MyTest.java
?????目錄??????????0??2012-07-09?14:37??NALDecoder\bin
?????目錄??????????0??2012-07-05?16:41??NALDecoder\src
?????目錄??????????0??2012-07-05?16:40??NALDecoder
-----------?---------??----------?-----??----
????????????????25272????????????????????9
- 上一篇:android 攝像頭獲取數據
- 下一篇:安卓實時視頻傳輸
評論
共有 條評論