无线流媒体服务器接口开发指南-V3.6

合集下载

手把手教你搭建流媒体服务器

手把手教你搭建流媒体服务器

流媒体服务器流媒体指以流方式在网络中传送音频、视频和多媒体文件的媒体形式。

相对于下载后观看的网络播放形式而言,流媒体的典型特征是把连续的音频和视频信息压缩后放到网络服务器上,用户边下载边观看,而不必等待整个文件下载完毕。

由于流媒体服务器流媒体技术的优越性,该技术广泛应用于视频点播、视频会议、远程教育、远程医疗和在线直播系统中。

作为新一代互联网应用的标志,流媒体技术在近几年得到了飞速的发展。

而流媒体服务器又是流媒体应用的核心系统,是运营商向用户提供视频服务的关键平台。

其主要功能是对媒体内容进行采集、缓存、调度和传输播放,流媒体应用系统的主要性能体现都取决于媒体服务器的性能和服务质量。

因此,流媒体服务器是流媒体应用系统的基础,也是最主要的组成部分。

主要产品流媒体服务器:大并发视频服务器、直播时移服务器、P2P直播服务器、视频交互应用服务器视频应用管理:媒体内容管理系统、H.264/MPEG-4编码工具、机顶盒终端管理系统、节目导航与发布系统。

架设使用Windows Media Encoder这个软件即可实现网上广播服务,不过,借助于Wi ndows Media Services,利用Windows Media Encoder制作的流媒体文件,我们的网络广播站功能将更为强大。

下面,我们将利用Windows Media Encoder单独建立广播站,并将其纳入Windows Media Services,实现更强大的功能。

1. 安装Windows Media Services。

首先安装Windows 2000 Server或者Windows .Net Server,然后打开“开始-控制面板-管理工具-管理您的服务器”或“开始-控制面板-添加或删除程序-添加/删除Windows组件”(建议使用第二种),在其中勾取“Web应用程序服务器”,也就是2000 Server中的IIS服务器,单击“下一步”进行添加;添加IIS完毕后,再次启动添加/删除Windows组件程序,并勾取Windows Me dia Service项,单击详细信息,在其中选择“用于Web的Windows Media Service s Administrator”以启动Windows Media Services的Web管理功能(2000中可能没有这些选项,只需要安装Windows Media Services即可);2. 安装Windows Media Encoder。

iVMS-4200 User Manual(客户端)

iVMS-4200 User Manual(客户端)


约定
在本手册中为了简化描述,做以下约定:

网络视频监控软件iVMS-4200简称为软件。 网络硬盘录像机、混合型网络硬盘录像机、视频服务器、NVR、IP Camera和IP Dome等统一称为设 备。 点击为鼠标左键单击;双击为鼠标左键双击;右键单击为鼠标右键单击。 部分图片为示意图,请以软件实际界面为准。

符号约定
在本文中可能出现下列标志,它们所代表的含义如下。 符号
注意
说明 表示有潜在风险,如果忽视这些文本,可能导致错误或不可预知的结果。 表示是正文的附加信息,是对正文的强调和补充。
说明Βιβλιοθήκη iiVMS-4200 用户手册
目录
目录
前言 ............................................................................................................................................................................ i 目录 ........................................................................................................................................................................... ii 1. iVMS-4200 简介 ........................................................................................................

流媒体服务器的搭建

流媒体服务器的搭建

流媒体服务器的搭建1.确定服务器的需求在开始搭建流媒体服务器之前,我们应该明确自己的需求。

例如,我们需要支持的用户数量、业务类型,以及预算等。

这些因素将指导我们选择合适的服务器硬件和软件。

2.选择流媒体服务器软件目前比较流行的流媒体服务器软件有Nginx、Apache、Wowza Media Server等。

根据自己的需求选择合适的服务器软件。

在本文中,将以Nginx为例进行搭建。

3.准备服务器硬件和操作系统根据自己的需求选择合适的服务器硬件,例如CPU、内存、硬盘等。

同时,选择一个支持的操作系统。

常用的操作系统有Linux(如Ubuntu、CentOS)、Windows Server等。

4.安装流媒体服务器软件5.配置流媒体服务器在安装完成后,需要进行一些配置工作。

例如,配置Nginx作为流媒体服务器、设置监听端口、支持的流媒体格式等。

在配置文件中,可以设置HTTP流媒体选项,如hls(HTTP Live Streaming)、rtmp(Real-Time Messaging Protocol)等。

6.创建流媒体内容在完成服务器的基本配置后,需要创建流媒体内容。

可以将音频、视频文件上传至服务器,或使用ffmpeg等工具进行转码。

转码后的内容保存在服务器上特定的目录中,供用户访问。

7.安全设置8.测试流媒体服务器在完成所有配置后,需要进行测试以确保服务器正常工作。

可以使用不同的终端设备,如电脑、手机、平板等,通过指定的URL访问流媒体内容。

如果能够正常播放,说明服务器搭建成功。

9.监控和维护流媒体服务器的搭建是一个持续的过程。

在运行过程中,需要定期进行监控和维护。

可以使用监控工具,如Nagios、Zabbix等,监控服务器的负载、带宽、连接数等。

同时,定期更新服务器软件和安全补丁,保持服务器的稳定和安全性。

总结流媒体服务器的搭建是一个复杂的过程,需要根据自己的需求选择合适的硬件和软件,并进行相应的配置和测试。

NODE无线音乐流媒体播放器用户手册说明书

NODE无线音乐流媒体播放器用户手册说明书

NODE WIRELESS MUSIC STREAMEROWNER’S MANUALIncluded AccessoriesThank you for purchasing your NODE. It is the gold-standard of hi-resolution, multi-room audio players, a network music streamer that works with any amplifier or active speakers to conveniently bring the enjoyment of hi-resolution music to everyday life.UNLOCK THE WORLD OF HIFI. The NODE is the ultimate HiFi streamer that easily connects to any amplified stereo system to help you discover a universe of audio streaming. With all the inputs and outputs to please the most ardent audiophile, the NODE connects your gear to all the music ever recorded.TAKE YOUR HIFI WI-FI. Enhanced dual-band Wi-Fi provides best-in-class performance even in crowded airspace. Bluetooth performance benefits from state-of-the-art aptX HD, supporting 24-bit streaming directly from your device, and the ability to transmit studio-quality music from the NODE out to Bluetooth headphones, while built-in AirPlay 2 makes for easy integration into the Apple ecosystem. Of course, the premium DAC design means that no matter what or how you’re streaming, the NODE helps you listen in audiophile-grade quality.FROM ANYWHERE TO EVERYWHERE. Seamlessly connect the NODE to multiple Bluesound speakers throughout your home with the BluOS Controller App and create an intuitive multi-room music system unlike any other. The NODE is easier to control than ever – from a smart device with the BluOS App, a computer, touch panel controls with presets, voice assistants like Siri, Alexa, or Google Voice, or by programming your own IR remote. The NODE can also be built into smart home control systems for a premium whole-home audio integration.This Owner’s Manual will provide you with a more detailed overview of your NODE and its features. It also includes some troubleshooting tips and tricks and networking best practices. The Quick Setup Guide included with your NODE will help you get it on the network and ready to listen to your music.If you need more help or information please visit or send us an ****************************WELCOME TO #LIVINGHIFIStereo RCA to RCAMini Jack to Toslink120V AC Power Cord 230 V AC Power Cord Ethernet CableCOAX OUT Using a coax cable (not provided), connect one end to the COAX OUT of the NODE and the other end to the corresponding coax input of compatible devices such as receivers, computer soundcards or other digital processors. Connecting via the Coax Out will bypass the NODE’s internal DAC.OPTICAL OUT Using a Digital Optical cable (not provided), connect one end to the OPTICAL OUT of the NODE and the other end to the corresponding digital audio input of compatible devices such as receivers, computer soundcards or other digital processors. Connecting via the Optical Out will bypass the NODE’s internal DAC.OPTICAL IN/ANALOG IN Using a 3.5mm Stereo Audio Cable (not provided), connect one end to the Analog In of the NODE and the other end to the corresponding analog output of other compatible devices. The source will show as an Analog Input in the BluOS App. Using the 3.5mm Mini Jack to Toslink adaptor (included with the NODE), a digital optical source can also be added. This will appear as Optical Input in the BluOS App.TRIGGER OUT A 12V DC signal is available using TRIGGER OUT. The 12V DC signal can be used to control or activate other external devices equipped with a corresponding 12V trigger input using a 3.5mm mono audio cable.IR IN An infrared extender can be connected to allow for programmable learning remotes to control volume and source selection when a NODE is stored in a way that the front panel IR sensor is not N PORT The LAN PORT connection can be used with the Ethernet cable provided. This is an optional connection since the NODE can be connected to the network through a Wi-Fi connection to your router. To setup the NODE using the LAN Port a Wired Ethernet connection is required. Using the Ethernet cable provided, connect one end of the Ethernet cable to the LAN port of your wired Ethernet broadband router and the other end to the NODE’s LAN B INPUT (TYPE A) Connect a USB mass storage device to the USB input. Typical USB mass storage devices compatible with the NODE include portable flash memory devices and external hard drives (FAT32 formatted).USB OUTPUT (TYPE A) The NODE is capable of transferring digital audio (USB Audio 2.0) through to an external DAC via the USB Type-A slot. Using a USB cable (not provided), connect one end to the USB output of the NODE and the other end to the corresponding USB input on a separate DAC device. Select your USB DAC from the NODE’s Audio settings page in the BluOS App to bypass the NODE’s internal DAC via USB audio out. *this feature will be available through a future BluOS software update.HDMI eARC Using a HDMI cable (not provided), connect one end to the eARC input of the NODE and the other end to an ARC-enabled HDMI output on your television. You may be required to enable ARC in your TV settings. Consult you TV user manual for more information. The source will appear as HDMI ARC in the BluOS App. Currently only PCM audio playback is supported, please ensure your TV settings are set accordingly.AC MAINS INPUT The NODE comes supplied with two separate AC power cords. Select the AC power cord appropriate for your region. Before connecting the plug to the wall outlet, connect firmly the other end of the AC powercord to NODE’s AC Mains input socket. Never force the plug into a wall outlet. An adaptor may be necessary in certain regions. Always disconnect the plug from the wall outlet first, before disconnecting the cable from the NODE’s AC Mains input socket.STATUS INDICATOR Below is a table of the LED blink codes and their corresponding descriptions 491112131410LED BLINK CODE DESCRIPTION Short blue flash, then red Powering up, rebooting the unitSolid green Hotspot ModeFlashing green Connecting to NetworkWhite pulse Software update availableSolid red Upgrade ModeAlternate flashing red and green Upgrading Flashing blue Mute Mode Solid white IndexingSolid blue Connected to Network – ready to use with BluOS AppFlashing red Factory Reset in processSolid purple Hotspot Mode timed outPLA Y/PAUSE BUTTON This button has multiple functions – a visual indicator of network connectivity and a PLAY/PAUSE button. For a full listing of LED Blink Codes, please see #4 – Blink Codes. For an ungrouped Player, press the button to Play and Pause the stream. If listening to an internet radio stream, the Pause- function will work for 30 seconds. At this point, the buffer is full and the stream will Stop. When a Player is grouped, pressing the PLAY/PAUSE button will Mute that Player while other Players continue the stream. The Player’s LED will flash blue when muted. This button is also used for Factory Reset functions. See steps for Factory Reset later in this manual.HEADPHONE JACK A 3.5mm headphone jack is located on the front of the NODE.AUDIO OUT Connect to the corresponding analog audio input of an amplifier, receiver, stereo system or active speakers.Connecting via the analog audio out will use the NODE’s internal DAC.SUBW (SUBWOOFER) OUT A subwoofer can be connected directly to the NODE. Connect SUBW OUT to a powered(“active”) subwoofer. Alternatively, you can connect the NODE to a Bluesound subwoofer over the network.7856161715151PRESETS The NODE has 5 programmable preset buttons. These presets are configured using the presetsmenu in the BluOS App.VOLUME SLIDER/TAP Use the LED slider to vary volume level. Tap the • buttons at either end of the slider to vary thevolume level in 1db intervals, or tap the slider in the direction you wish to adjust to vary the level by 3db intervals. These volume tap methods allow you to fine-tune your volume setting.PREVIOUS TRACK/NEXT TRACK These buttons can be used to go back to the previous track or skip to the next track inyour current play queue.23WARNING!THIS IS A FACTORY RESET OF YOUR PLAYER. ALL CUSTOMIZATION INCLUDING WI-FI NETWORK CONFIGURATION, FILE SHARES AND SAVED PLAYLISTS WILL BE LOST. YOU WILL HAVE TO RE-CREATE THESE ONCE COMPLETE. THIS PROCESS IS ONLY RECOMMENDED IF YOUR PLAYER IS NOT FUNCTIONING AND AN INTERNET FIRMWARE UPGRADE HAS FAILED. FOR ANY Q UESTIONS OR CONCERNS CONTACT AN AUTHORISED BLUESOUND CUSTOMER REPRESENTATIVE BEFORE PROCEEDING!Steps to Factory Reset:1.Disconnect the player from electrical power.2.Wait 30 seconds3.Reconnect the power4.Once the LED turns Red, press and hold the PLAY/PAUSE button. The LED willimmediately turn Green and then back to Red - continue to hold the button for 30 seconds5.After 30 seconds, the LED will begin to blink red – then release the button6.All customization to the Bluesound player will be removed and restored to factory settingsIMPORTANT: Removing your finger from the PLAY/PAUSE button at any time before the LED begins flashing red will cancel the factory reset and leave the player in Upgrade Mode. Just start the steps again to factory reset the player.You will know the factory reset is successful if the player returns to Hotspot mode (wireless connection - the LED will turn solid green). If the player is connected to your network through a wired Ethernet connection, it will simply connect as if it was a new player (LED will turn solid blue).NODE。

UltrantMediaServer安装指南

UltrantMediaServer安装指南

IMMAAC® ULTRANT® MEDIA SERVER 1.8.8安装指南PRERELEASE -12/13/2011© 2011 IMMAAC®. All rights reserved.安装IMMAAC® Ultrant® Media Server 1.8.8本指南,包括最终用户协议,以及其描述的软件,只能按照提供的许可证许可条款使用。

除任何此类许可证允许,未经IMMAAC事先书面许可,本指南及软件的任何部分不能被复制,存储,或以任何形式(如电子,机械,录制)或其他方式传播。

请注意,本指南中的内容是受版权法保护,即使它不是包含最终用户许可协议的分发软件。

北京意玛科创网络技术有限公司(IMMAAC®)中国,北京市,海淀区,上地信息路一号本软件和文档是商业软件。

IMMAAC拥有本软件的相关知识产权。

您一旦安装、复制、使用本软件,即意味着您已经接受本协议各项条款。

1.您可以无限期、无限量使用、复制本软件。

2.您可以将本软件复制提供给他人,但未经授权不得将其用于商业用途。

3.本软件受著作权法和国际公约保护,您无权对本软件的程序和文档进行任何修改。

4.使用本软件由用户自己承担风险,IMMAAC®确保本软件的适用性、无瑕疵、无病毒等。

对在任何情况下因使用或不能使用本软件所产生的直接、间接、偶然、特殊及后续的损害及风险,IMMAAC®不承担任何责任。

5.IMMAAC®会对本软件的用户提供直接的技术服务,用户可以通过电话、QQ、MSN等通讯方式与我们联系,我们也会尽力通过社区或邮件的形式提供帮助信息。

6.IMMAAC®会尽力改进、修正本软件。

目录第一部分: 安装服务系统要求 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 准备安装 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 升级 . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . 5 安装服务 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 启动和停止服务 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 卸载服务 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6第二部分: 验证安装验证安装文件 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 验证流媒体服务 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7第一部分:安装服务在安装IMMAAC® Ultrant® Media Server之前,请查阅系统需求并且备份您现有的数据,然后再执行安装。

流媒体的存储 方案

流媒体的存储 方案

流媒体的存储方案引言在现代社会中,随着数字媒体的普及和流媒体的快速发展,流媒体的存储方案成为了一个重要课题。

流媒体的存储方案涉及到如何有效地存储、管理和提供流媒体内容。

本文将介绍几种常见的流媒体存储方案,并分析其优缺点。

1. 本地存储方案本地存储方案是最简单和最常见的流媒体存储方案之一。

用户可以将流媒体文件存储在本地硬盘上,然后通过本地网络或其他方式进行访问和播放。

本地存储方案的优点是简单易用、成本低廉。

然而,本地存储方案存在一些明显的缺点,如存储空间有限、无法实现多用户访问和共享。

2. 云存储方案云存储方案是一种将流媒体文件存储在云服务器上的方式。

用户可以通过云平台提供的接口上传、管理和播放流媒体文件。

云存储方案的优点是无限存储空间、高可用性和易用性。

此外,云存储方案还可以实现多用户访问和共享流媒体内容。

然而,云存储方案需要付费,并且对于大规模的流媒体存储可能存在性能上的问题。

3. 分布式存储方案分布式存储方案是一种将流媒体文件分布式地存储在多台服务器上的方式。

用户可以通过分布式存储系统访问和播放流媒体文件。

分布式存储方案的优点是横向扩展性强、高可用性和高性能。

分布式存储方案可以通过副本备份和数据冗余技术保证数据的安全性和可靠性。

然而,分布式存储方案的实现和管理相对复杂,需要一定的技术和资源。

4. CDN 存储方案CDN(内容分发网络)存储方案是一种通过将流媒体文件缓存到全球分布的节点上,实现快速访问和传输的方式。

用户可以通过最近的节点访问和播放流媒体内容,提高用户的体验。

CDN存储方案的优点是高速传输、减轻源服务器压力、提供全球范围的服务。

然而,CDN存储方案需要额外的成本,且对于小规模的流媒体应用可能不划算。

5. 数据库存储方案数据库存储方案是一种将流媒体文件存储在关系型或非关系型数据库中的方式。

用户可以通过数据库查询语言访问和检索流媒体内容。

数据库存储方案的优点是数据管理和检索方便、支持高级查询。

流媒体服务器搭建方案

流媒体服务器搭建方案

流媒体服务器搭建方案随着互联网的快速发展,越来越多的媒体文件需要像音乐、视频、直播等以流媒体形式进行传输,让用户能够快速、稳定、高品质地享受这些内容。

因此,流媒体服务器的搭建成为一个必不可少的环节。

接下来将介绍一种流媒体服务器搭建方案。

一、服务器硬件选型首先,需要考虑服务器硬件选型。

在这里,我们需要考虑以下几个方面:1. 处理器流媒体服务器需要快速高效地处理数据,因此处理器的速度和性能非常重要。

如果希望支持更多的并发用户数量,建议选择具备多核心处理器的服务器。

2. 存储设备由于流媒体服务器需要存储大量的媒体文件,因此存储设备的性能也至关重要。

建议选择固态硬盘或RAID方案,以提高媒体文件的读取速度。

3. 内存大量的并发用户会导致服务器频繁地读取媒体文件和进行计算工作,因此要选择足够的内存。

建议选择至少8GB以上的内存。

4. 网络带宽流媒体传输需要消耗大量的宽带,服务器的网络带宽也需要考虑。

建议选择高速的宽带,以降低用户体验的延迟。

二、流媒体服务器软件选型流媒体服务器软件包括Nginx、Apache等,这里我们推荐使用Nginx。

Nginx是一个高性能的Web服务器,功能丰富,可用于反向代理、负载均衡和HTTP缓存等许多应用场景,而且它非常快,并且能够高效地处理大量的并发请求,同时有效地减少了对硬件资源的消耗。

三、流媒体服务器安装和配置1. 安装Nginx在Ubuntu系统上,可以使用以下命令安装Nginx:sudo apt updatesudo apt install nginx2. 创建媒体文件目录在Nginx服务器上,需要创建一个目录,用于存储媒体文件。

使用以下命令创建目录:sudo mkdir -p /var/www/html/media3. 配置Nginx服务器可以通过编辑Nginx配置文件/etc/nginx/nginx.conf来配置Nginx服务器。

首先,在http块中添加以下代码:http {...server {listen 80;server_name your_server_domain_name;root /var/www/html;index index.php index.html index.htm;}...}其中,listen指定监听的端口号,server_name指定服务器的域名,root指定根目录,index指定默认页面。

流媒体服务器安装步骤

流媒体服务器安装步骤

流媒体服务器安装步骤流媒体服务器是一种用于传输音频和视频内容的服务器,可以通过网络实时播放媒体文件。

安装流媒体服务器可以帮助用户在互联网上共享媒体内容,满足用户的音视频播放需求。

下面是安装流媒体服务器的步骤:1. 选择一个合适的操作系统:根据自己的需求和技术背景,选择一个适合的操作系统,如Windows、Linux或Mac OS。

一般来说,Linux是安装流媒体服务器的首选操作系统,因为它更稳定、灵活且易于管理。

2. 下载和安装所需的软件:根据流媒体服务器的选择,在官方网站上下载所需的软件。

最常用的流媒体服务器软件包括FFmpeg、VLC Media Player和Wowza Streaming Engine等。

根据操作系统的不同,下载对应的版本进行安装。

3. 配置流媒体服务器:安装完成后,需根据自己的需求进行配置。

主要包括以下几个方面:- 网络设置:配置服务器的网络连接,确保服务器能够正常访问互联网。

- 文件路径设置:设置媒体文件的路径,确保服务器可以找到播放的媒体文件。

- 端口设置:配置流媒体服务器的端口,确保客户端可以正常访问服务器。

4. 添加媒体内容:准备好要播放的媒体文件,将其添加到流媒体服务器中。

具体操作可以参考相关的文档或手册。

一般来说,可以通过命令行或图形界面的方式添加媒体内容。

5. 启动服务器:在完成配置和添加媒体内容后,启动流媒体服务器。

根据不同的软件,有不同的启动方式。

一般来说,可以通过命令行输入相应的指令或者在图形界面上点击启动按钮来启动服务器。

6. 测试服务器:在服务器启动后,可以使用浏览器或媒体播放器进行测试。

尝试访问流媒体服务器的URL,在播放器中输入相应的链接地址,验证服务器是否正常工作。

以上就是安装流媒体服务器的基本步骤。

在具体操作过程中,还需要根据软件的不同进行相应的配置和调试。

安装流媒体服务器需要一定的技术实力,如果遇到问题,可以参考相应的技术文档或寻求技术支持。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

无线流媒体服务器接口开发指南(Ver 3.6)版本号状态内容作者日期3.5 Release J 2011-03-233.6 Release J 2011-05-19术语解释术语描述OWSP v3 Open Wireless Surveillance Protocol,开放无线监控系统协议。

v3表示基础版本号为3.0TLV Type-Length-Value,类型长度值1 概述无线流媒体服务器的侦听端口是15961,工作在TCP协议上,设备的连接和数据交换就是通过这个端口。

无线流媒体服务器地址、端口号和设备ID由我们提供,设备可以提供设置界面或接口允许修改设置。

参考文档:StreamDef.h (2010-03-22)对接的工作流程推荐如下:1)播放流程设备发送versioninfo, register, formatinfo,然后发送keepalive当服务器发送request,设备开始发送视(音)频数据(不在发送keepalive)当服务器发送suspend,设备停止发送视(音)频数据,继续发送keepalive用户打开播放器,可以看到视频。

当关掉播放器时,只有少量的数据传输,表示成功。

2)云台协议通过播放器可以进行云台控制表示成功。

3)音频支持音频支持amr_wb和amr_nb两种编码方式在播放器端可以听到正确的音频。

注意AudioDataFormat中对参数配置2 网络数据包格式定义2.1 组成目前定义了三种数据包:控制、视频和音频。

通常情况下,数据包由公用包头、特定包头、有效数据组成,如下:ControlPacketHeader公用包头特定包头有效数据公用包头:所有的通信包都具有公用包头,它定义两个字段:包长度(length)和包类型(message)。

特定包头:描述与特定包的相关信息,有些数据包如果没有附加信息,则可能没有该部分,如心跳包。

有效数据:只在音、视频包中才会出现,一般是指一帧视频数据或者音频块。

2.2 公用包头typedef struct _CommonPacketHeader{u_int32 length;u_int32 message;} CommonPacketHeader;说明:包长度length是需要转换成为网络字节序即big-endian,即01 02 03 04表示是0x01020304。

另外,包长度值是指随后数据的字节长度,即整个数据包的长度减去自身的长度(4字节u_int32)。

命令字message仍为little-endian即04 03 02 01 表示是0x010203042.3 包类型命令字即公用包头的message字段,目前主要有以下类型的包:1)版本号请求,命令字为MSG_CMD_VERSION_INFO(40)2)注册请求,命令字为MSG_CMD_REGISTER(41)3)流格式信息请求,命令字为MSG_STREAM_FORMAT_INFO(200)描述视频及音频的相关格式信息。

4)音视频数据,视频数据包,MSG_STREAM_VIDEO_DA TA(210)音频数据包,MSG_STREAM_AUDIO_DATA(211)音视频交织包,目前不支持,MSG_STREAM_VIDEO_AUDIO_DATA (212)3 连接与注册服务器缺省使用15961端口来侦听连接请求,连接请求由设备发起,当连接成功后,设备再发送注册请求,每一个设备都由一个系统唯一的device_id所标识。

3.1 通信协议版本号的验证连接后,设备首先发送4字节的V e r s i o n I n f o通信协议版本号给服务器,服务器根据版本信息进行相应处理,不需要应答。

t y p e d e f s t r u c t_V e r s i o n I n f o{u_i n t16v e r s i o n M a j o r;//m a j o r v e r s i o nu_i n t16 v e r s i o n M i n o r;//m i n o r v e r s i o n}V e r s i o n I n f o;发送字节流顺序00 00 00 08 [ 1 ] 28 00 00 00 [ 2 ] 02 00 01 00 [ 3 ][1] 包长。

[2] 命令字。

0x28表示MSG_CMD_VERSION_INFO(40)[3] 版本号。

versionMajor = 0x0002,versionMinor = 0x00013.2 注册请求由设备发出,格式如下:CommPacketHeader + L o g i n R e q u e s tt y p e d e f s t r u c t_L o g i n R e q u e s t{c h a r u s e r N a m e[S T R_L E N_32];c h a r p a s s w o r d[S T R_L E N_16];u_i n t32d e v i c e I d;u_i n t8f l a g;u_i n t8r e s e r v e[3];}L o g i n R e q u e s t;说明:1)用户名和密码如果不足右补0x00。

2)设备注册成功以后,不再发送注册请求,直到出现错误需要重新连接或者复位时,才需要发送该请求。

设备发送字节流顺序示例:00 00 00 3C [ 1 ] 29 00 00 00[ 2 ] 70 76 72 30 36 00…00 [ 3 ] 00 00 00 ... 00 [ 4 ] FB 02 00 00 [ 5 ] 00 [ 6 ] 00 00 00 [ 7 ][1] 包长。

Sizeof(CommPacketHeader) + sizeof(L o g i n R e q u e s t)-4[2] 命令字。

0x29表示MSG_CMD_REGISTER(41)[3] 用户名。

32个字节,可以使用设备的型号本例为”pvr06”。

[4] 密码。

16个字节,可以为全0。

[5] 设备ID。

0x 02FB(763)[6] 标志位。

[7] 保留。

3个字节3.3 注册请求响应由服务器发出,格式如下:CommPacketHeader + LoginResponsetypedef struct _LoginResponse{u_int16 result;u_int16 reserve;} LoginResponse;Result为_RESPONSECODE_SUCC(01)时表示注册成功。

服务器应答字节流示例:00 00 00 08 [ 1 ] 2A 00 00 00[ 2 ] 01 00 [ 3 ] 00 00 [ 4 ][1] 包长。

[2] 命令字。

0x2A表示MSG_CMD_REGISTER_ANSWER(42)[3] 结果。

0x01表示成功[4] 保留。

4 发送数据包设备成功注册到服务器后,就准备发送音、视频数据。

在第一次发送数据之前需要先发送流格式信息请求,对音视频数据的格式进行描述。

然后不断的发送实际数据。

只有当修改了参数后,需要再次发送流格式信息请求,否则不需要再次发送。

对于视频,每一帧需要作为一个单独的视频包发送。

4.1 流格式信息包由设备发出,格式如下:CommPacketHeader + SystemPackDataFormat + ExpandDataHeader + ExpandData其中,SystemPackDataFormat的结构体如下:typedef struct _SystemPackFormat{StreamDataFormat sd;VideoDataFormat vd;AudioDataFormat ad;} SystemPackDataFormat;当仅视频时,则不用填A u d i o D a t a F o r m a t当仅音频时,则不用填V i d e o D a t a F o r m a t如果音频或视频信息有变化,则需要再次向服务器发送格式信息包,否则不需要再次发送。

对于StreamDataFormat字节流顺序如下1. StreamDataFormat 流数据格式1.1 u_int32 fileLabel文件标识,DEFAULT_STREAM_FORMA T_FILE_LABEL (0x6B5C49FA)1.2 u_int16 size;随后的videoDataFormat 或者audioDataFormat部分的字节长度。

如果仅采集视频,则只需要VideoDataFormat而不需要audioDataFormat部分,则size = sizeof(VideoDataFromat)。

1.3 u_int8 versionMajor主版本号STREAM_VERSION_MAJOR(0x02)1.4 u_int8 versionMinor;次版本号STREAM_VERSION_MINOR (0x00)1.5 u_int8 videoChannelMask;视频通道标识,表示描述的是设备中第几路视频信息1:表示第一通道。

2:表示第二通道。

4:表示第三通道。

8:表示第四通道。

9:表示第五通道。

10:表示第六通道。

11:表示第七通道。

12:表示第八通道。

13:表示第九通道。

14:表示第十通道。

15:表示第十一通道。

16:表示第十二通道。

17:表示第十三通道。

18:表示第十四通道。

19:表示第十五通道。

20:表示第十六通道1.6 u_int8 audioChannelMask;音频通道标识,表示描述的是设备中第几路音频信息。

1:表示第一通道。

2:表示第二通道。

4:表示第三通道。

8:表示第四通道。

9:表示第五通道。

10:表示第六通道。

11:表示第七通道。

12:表示第八通道。

13:表示第九通道。

14:表示第十通道。

15:表示第十一通道。

16:表示第十二通道。

17:表示第十三通道。

18:表示第十四通道。

19:表示第十五通道。

20:表示第十六通道1.7 u_int8 packetType;包类型标识,取值为SPT_SYSTEM(0x61)1.8 u_int8 dataType;表示StreamData类型,值定义如下:typedef enum _StreamDataType{SDT_VIDEO = 0,SDT_AUDIO = 1,SDT_VIDEO_AUDIO = 2} StreamDataType;1.9 u_int32 reserve;保留。

2. VideoDataFormat 视频数据格式2.1u_int32 codecId;编码器ID,’H264’2.2u_int32 bitrate码流,单位为kb2.3u_int16 width;图像宽度。

相关文档
最新文档