I'm trying to stream a video from an Android device to a PC by using the libstreaming library. To connect the two devices I open a Hotspot on the Android device and connect the PC to it.
我正在尝试使用libstreaming库将视频从Android设备流式传输到PC。要连接这两个设备,我在Android设备上打开一个热点并将PC连接到它。
I tried the examples 1 and 2 and got them running. With example 2 I receive a lot of UDP packets in Wireshark. But I am not able to open the stream in VLC Player. With example 1 I get nothing in Wireshark.
我尝试了示例1和2并让它们运行。在示例2中,我在Wireshark中收到了大量UDP数据包。但是我无法在VLC播放器中打开流。在示例1中,我在Wireshark中什么也得不到。
Can anybody tell me what I have to type in VLC to open the stream? I tried a lot of different things, but I'm not sure if I did it correctly. For example 1 I think it has to be something like rtsp://ipofandroiddevice:port
任何人都可以告诉我在VLC中键入什么来打开流吗?我尝试了很多不同的东西,但我不确定我是否做得正确。例如1我认为它必须像rtsp:// ipofandroiddevice:port
2 个解决方案
#1
I don't know the libstreaming library, but it looks like it sends RTP packets to an address.
我不知道libstreaming库,但它看起来像是将RTP数据包发送到一个地址。
In this case you should only open: rtp://@:port on your computer to get the video. Just be aware of NAT issues if you are streaming from outside an internal network.
在这种情况下,您只应在计算机上打开:rtp:// @:port以获取视频。如果您从内部网络外部进行流式传输,请注意NAT问题。
#2
The RTSP URL you posted in your question is missing some parameters, it should be something like,
您在问题中发布的RTSP URL缺少一些参数,应该是这样的,
rtsp://phone_local_ip:1234?h264=200-20-320-240
200 = buf | 20 = fps | 320 = width | 240 = height
200 = buf | 20 = fps | 320 =宽度| 240 =身高
There is a UriParser class in the library, you might need to check it our for other possible URL formats.
库中有一个UriParser类,您可能需要检查我们的其他可能的URL格式。
#1
I don't know the libstreaming library, but it looks like it sends RTP packets to an address.
我不知道libstreaming库,但它看起来像是将RTP数据包发送到一个地址。
In this case you should only open: rtp://@:port on your computer to get the video. Just be aware of NAT issues if you are streaming from outside an internal network.
在这种情况下,您只应在计算机上打开:rtp:// @:port以获取视频。如果您从内部网络外部进行流式传输,请注意NAT问题。
#2
The RTSP URL you posted in your question is missing some parameters, it should be something like,
您在问题中发布的RTSP URL缺少一些参数,应该是这样的,
rtsp://phone_local_ip:1234?h264=200-20-320-240
200 = buf | 20 = fps | 320 = width | 240 = height
200 = buf | 20 = fps | 320 =宽度| 240 =身高
There is a UriParser class in the library, you might need to check it our for other possible URL formats.
库中有一个UriParser类,您可能需要检查我们的其他可能的URL格式。