问题标签 [sdp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
4480 浏览

java - 如何将 H.264 UDP 数据包转换为可播放的媒体流或文件(碎片整理)

在将 SDP 会话的 UDP 流转换为可解码的 H.264 流时,我缺少一些基本的东西。我正在使用支持 H.264 的相机进行测试,并且可以直接使用播放器播放流。当我尝试播放翻译后的流时,播放器将无法识别它(缺少标题错误)。但是,我必须对 UDP 流进行解码,以便能够将其集成到 Java 应用程序中,该应用程序周围有一些解码器。

我已经看到以下问题的非常好的答案:

  1. 如何处理原始 UDP 数据包,以便它们可以被 directshow 源过滤器中的解码器过滤器解码
  2. 使用 ffmpeg (libavcodec) 通过 RTP 解码 H264 视频的问题

两者都有一些令人困惑的小差异(见下文)。

但首先让我们看一下简单的部分。正如我从相机看到的,发送了 SPS 和 PPS 数据包。所有剩余的数据包都是索引或不索引的分段帧。

对于所有没有帧的数据包(在我的情况下只有 NALUnitType 7 和 8),我去掉 RTP 标头(12 字节)并在前面添加起始字节 3 x 0 字节和 1 x 1(00 00 00 01)。

对于所有分段的帧数据包,我根据答案 1 的描述重建它们。所以详细地说,这意味着: RTP 标头的剥离(仅用于数据验证)。然后从有效载荷中解码片段信息:

第一个字节:[ 3 NAL UNIT BITS | 5 FRAGMENT TYPE BITS]
第二个字节:[ START BIT | 结束位 | 保留位 | 5 NAL 单位位]

如果设置了起始位,则会有一个新的有效载荷头构造如下:[3 NAL UNIT BITS(从第一个字节)| 5 NAL UNIT BITS(从第二个字节开始)]
这为我们提供了 NALUnitType 1 用于非 idr 切片或 5 用于 idr 切片。这是根据规范。

我采用这个新的有效负载标头(1 个字节)并将没有 2 个字节标头的有效负载附加到一个新包中。所有连续的片段都以相同的方式添加(12 字节 RTP 标头条,2 字节单元类型信息条),直到看到结束位信息。当看到结束时,我将开始字节(00 00 00 01)放在这个数据包的前面,并将它写到流中。

问题是由于未知原因无法解码。我读过的答案的答案 2 的不同之处在于,有效载荷标头的第二个字节也可能被放入转换后的数据包中。但我都尝试了,但仍然没有运气。

新建的流中可能还缺少其他东西吗?还是我在碎片整理中犯了错误?

0 投票
1 回答
5338 浏览

php - How send a message using SIP/SDP protocol in php

What i'm trying to do is implement a SIP client which listens for SIP messages.Ok so i have run the SIP client on a server 192.168.0.246 and the SIP server is running on 192.168.2.40.Now have a look at the below screen shot.

enter image description here

Its a trace file of the server running the client code on 192.168.0.246. As u can see the server receives messages from 192.168.2.40 using SIP/SDP protocol but when the client program running on 192.168.0.246 sends back message to 192.168.2.40 using UDP protocol its shown as UDP protocol, which is correct.But no response from 192.168.2.40 after this. So i'm assuming it has something to do with the protocol shown as UDP.So if i'm rite i should get that to SIP/SDP.

So my question is how to make this UDP change to SIP/SDP.

And here is my php code:

0 投票
2 回答
3961 浏览

port - SIP INVITE 请求端口搞砸了

使用resiprocate开发 NAT 遍历解决方案,它工作正常,但通常 SIP INVITE 获取失败,特别是在 cisco 路由器上

1. 1024端口发出SIP REGISTER

来源:107.108.188.26

目的地:107.108.188.52

用户数据报协议,Src 端口:1024 (1024),Dst 端口:sip (5060)

在此处输入图像描述

2. SIP 状态 200 OK

来源:107.108.188.52

目的地:107.108.188.26

用户数据报协议,Src 端口:sip (5060),Dst 端口:1024 (1024)

3. SIP/SDP 邀请

Source: 107.108.188.52 Destination:107.108.188.26 User Datagram Protocol, Src Port: sip (5060), Dst Port: sip (5060)

在此处输入图像描述

理想情况下,第 1 步和第 3 步中的发送端口应该是 1024。请指出我背后的任何可能原因

0 投票
1 回答
9861 浏览

caching - VLC RTP 网络缓存

我正在使用 RTP 从我的 android 手机的相机流式传输到我的计算机。我正在使用 VLC 接收流。我还使用手写的 .sdp 文件来查看 VLC 中的流。当我通过 RTSP 执行此操作时,我可以使用命令行 -> vlc "rtsp://224.1.1.1:8086" --network-caching=0 来删除 1000ms 缓存,从而消除延迟。所以现在我正在使用 -> myTest.sdp --network-caching=0 但它似乎没有影响。我试过把它增加到10秒,仍然没有影响。似乎如果我降低视频的质量,它会有更多的延迟。我需要做什么来删除任何类型的缓存/缓冲并始终只显示最新的帧?

0 投票
1 回答
1513 浏览

h.264 - Converting between SDP's sprop-parameter-sets and mkv's CodecPrivate

Is there some easy way to convert between h264 settings as stored in Matroska file:

and the same settings when streaming that matroska file using RTSP?:

Base-64 strings decodes to this:

which partially matches the data in mkv's CodecPrivate.

0 投票
1 回答
1881 浏览

video-streaming - Streaming H.264 video via RTP with VLC

I'm streaming an H264 movie through vlc 2.0.5. I've created the SDP file from reading the SDP packet through wireshark, and I was able to play the stream in vlc 1.1 and 0.9 (when the streamer is still vlc 2.0.5), but not in vlc 2.0.5. Streamer and Client are on the same computer (though it doesn't really matter).

The SDP file:

The vlc 2.0.5 client messages shows:

after it says the sdp file was successfully opened.

What could be the problem? How could vlc not being able to play its own stream by the SDP it created?

I would appreciate any suggestion.

Thank you,

Guy.

0 投票
1 回答
2780 浏览

android - 如何在android中播放sdp文件?

我正在使用以下代码播放 .3gp 格式的视频,它工作正常,但我在播放 .sdp url 时遇到问题。

我需要播放rtsp://ss1c6.idc.mundu.tv:554/prf0/cid_29.sdp格式,但它不起作用。请帮我。我尝试用VLCMX Player播放它。

0 投票
0 回答
7173 浏览

html - 如何从 sdp 文件观看我的视频?

我正在使用 ffmpeg 创建流媒体。它工作正常。我有一台服务器,通过 ffplay 我可以观看我的直播。我唯一的(大)约束是实时的。

我必须将其嵌入到可从移动设备访问的 HTML 页面中。我尝试使用 HTML5 视频标签,但我无法在其中包含 sdp 文件。

使用 ffmpeg,我从我的网络摄像头创建了一个流。我还创建了 sdp 文件,但在 HTML5 中不起作用。

代码在这里:

ffmpeg 服务器:

文件.sdp

ffplay:(有效)

如何在浏览器中查看流?

0 投票
1 回答
689 浏览

streaming - Failed to find network address

i installed openRTSP on UBUNTU and try to call url rtsp://simplelive.nexg.tv:554/starplus_mpeg.sdp using the command

i am getting the error

i want to get description of the screen can anyone please suggest why i am getting this error and how to resolve it ??

0 投票
1 回答
1495 浏览

android - Chrome/Android Jingle-SDP ICE 连接失败

我正在为 Android 设备开发一个应用程序,该应用程序允许语音/视频呼叫连接到 XMPP 服务器的其他启用 WebRTC 的设备。我已经成功地将应用程序用于 Android 设备之间的语音/视频聊天,现在我正在努力将该功能扩展到支持 WebRTC 的浏览器。我已经成功地进行了浏览器到浏览器的语音/视频通话,但是该系统在 SDP 协议上运行,而我构建的 Android 应用程序在 Jingle 协议上运行。我知道我可以重写 Android 应用程序以使用 SDP 协议,就像以前那样。但是,我想继续在 Android 设备上使用 Jingle 协议,

构建已经完成的 SDP / Jingle 翻译器(Phono 库具体来说)我目前有一个浏览器客户端和一个 Android 设备,可以成功协商语音/视频通话的媒体方面。然而,当一方试图连接到另一方时,事情似乎失败了。我的一部分认为失败在于 ICE / JINGLE 翻译。我注意到通过“onicecandidate”传递给浏览器的冰候选不包含任何用户名和密码信息。我曾尝试将由浏览器客户端生成的原始 SDP 报价中的用户名和密码信息复制到每个适当的候选冰(语音与视频)中,但这并没有取得任何成功。我也尝试过在传输节中不包含任何用户名和密码信息,但这也没有产生任何结果。

在整个通信过程中,我在浏览器端运行了wireshark,我继续看到浏览器和Android设备之间的绑定错误,直到Android设备最终发送“会话终止”信号。具体来说,我看到以下内容:

STUN 158 绑定请求用户:r8bGP7y5LklOOKEb:IjgBbKgXQe9V8Pur

过时凭据用户:r8bGP7y5LklOOKEb:IjgBbKgXQe9V8PurSTUN 130 绑定错误响应错误代码:274(未知错误代码

最终错误响应停止显示,然后开始显示如下消息:

ICMP 186 目的地不可达(端口不可达)

我对谈判的 ICE / 运输部分仍然很陌生,所以我不确定是否有任何 Wireshark 日志相关,或者我是否正确诊断了问题。

有谁知道我可能做错了什么?或者有任何在基于 SDP 的客户端和基于 Jingle 的客户端之间建立连接的经验吗?

澄清我在 ICE 翻译中所做的事情。

SDP候选人:

a=candidate:[foundation] [component-id] [transport type] [priority] [connection address] [port] [candidate type] [username] [password] [generation]

叮当候选人:

从 Jingle 到 SDP 时,我使用以下映射:

从 SDP 到 Jingle 时,我使用以下映射:

我在 Chrome 中获得的 ICE 候选人示例:

我从 Jingle 获得的 ICE 候选人的一个例子: