GithubHelp home page GithubHelp logo

libgb28181psmux's Introduction

1 项目概述

PS打包在实际项目中很难直接调试,而SIP很容易抓包调试,实际中经常有人问PS如何打包,而各自的实现也不尽相同,在对接时经常会遇到困扰,我们将PS打包部分独立出来以求更多的人完善。

例子中有VLC播放的SDP。打开本机的7000端口, 播放RTP payload 96的PS流。

海康,大华,东方网力等大部分平台都测试过。

2 示例代码:

Gb28181PsMux PsMuxer;
添加两个流
StreamIdx h264Idx = PsMuxer.AddStream(PSMUX_ST_VIDEO_H264);
StreamIdx g711Idx = PsMuxer.AddStream(PSMUX_ST_PS_AUDIO_G711A);

const int psFrameMax = 1024*1024;
char* psFrameOutBuf = new char[psFrameMax];
int psFrameSize = 0;

封装音频,psFrameSize为实际ps包的大小
int r = PsMuxer.MuxAudioFrame(g711buf, g711len, pts, dts, g711Idx, psFrameOutBuf, &psFrameSize, psFrameMax);
if(r == MUX_OK && psFrameSize > 0){
...
}

PsMuxer.MuxH264SingleFrame(h263buf, h264len, pts, dts, g711Idx, psFrameOutBuf, &psFrameSize, psFrameMax);
if(r == MUX_OK && psFrameSize > 0){
...
}

libgb28181psmux's People

Contributors

7956968 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.