C++ 高性能网络开发库 LibSourcey

码农软件 · 软件分类 · 高性能网络开发库 · 2019-08-31 15:12:09

软件介绍

LibSourcey 是跨平台 C++11 模块和类的集合,为开发人员提供了一个快速开发基于 p2p 和媒体流应用程序的高性能网络的库。可以把它看作 libuv 与 FFmpeg,OpenCV 和 WebRTC 特性的高度结合,所有这些都具有 stl(C++标准库)的易用性和可读性。

使用 LibSourcey 一个很好的出发点是 PacketStream,它可用来创建用于管道,处理并输出任意数据分组的动态委托链。分层分组处理器和动态功能的方法使得它能够快速且容易地开发出复杂的数据处理应用程序。

例如,下面的代码将介绍如何捕捉实时摄像头流,将其编码为 H.264,并通过互联网实时广播它:

// Create a PacketStream to pass packets from the
// input device captures => encoder => socket
PacketStream stream;

// Setup the encoder options
av::EncoderOptions options;
options.oformat = av::Format("MP4", "mp4",
    av::VideoCodec("H.264", "libx264", 400, 300, 25, 48000, 128000, "yuv420p"),
    av::AudioCodec("AAC", "libfdk_aac", 2, 44100, 64000, "s16"));

// Create a device manager instance to enumerate system devices
av::DeviceManager devman;
av::Device device;

// Create and attach the default video capture
av::VideoCapture::Ptr video;
if (devman.getDefaultCamera(device)) {
    video.open(device.id, 640, 480, 30);
    video.getEncoderFormat(options.iformat);
    stream.attachSource(video, true);
}

// Create and attach the default audio capture
av::AudioCapture::Ptr audio;
if (devman.getDefaultMicrophone(device)) {
    audio.open(device.id, 2, 44100);
    audio.getEncoderFormat(options.iformat);
    stream.attachSource(audio, true);
}

// Create and attach the multiplex encoder
av::MultiplexPacketEncoder::Ptr encoder(options);
stream.attach(encoder);

// Attach the output net::Socket instance (instantiated elsewhere)
// to broadcast encoded packets over the network
stream.attach(socket);

// Start the stream
// This method call will start the device captures and begin
// pumping encoded media into the output socket
stream.start();

本文地址:https://www.codercto.com/soft/d/13577.html

从零开始学微信公众号运营推广

从零开始学微信公众号运营推广

叶龙 / 清华大学出版社 / 2017-6-1 / 39.80

本书是丛书的第2本,具体内容如下。 第1章 运营者入门——选择、注册和认证 第2章 变现和赚钱——如何从0到100万 第3章 决定打开率——标题的取名和优化 第4章 决定美观度——图片的选取和优化 第5章 决定停留率——正文的编辑和优化 第6章 决定欣赏率——版式的编辑和优化 第7章 数据的分析——用户内容的精准营销 书中从微信运营入门开始,以商业变......一起来看看 《从零开始学微信公众号运营推广》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具