如何在 VLCJ 中使用 SDP 文件 [英] How to use SDP-File with VLCJ

查看:51
本文介绍了如何在 VLCJ 中使用 SDP 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试用 java 实现一个显示视频流的应用程序.

i try to implement an application with java which displays a video stream.

实际上我正在使用 VLCJ:https://github.com/caprica/vlcj

Actually i'am using VLCJ: https://github.com/caprica/vlcj

当我尝试连接到网络摄像头的视频流时出现错误的问题:

The Problem i get an error when i try to connect to a video stream of a webcam:

[052989d4] rtp demux error: unspecified payload format (type 96)
[052989d4] rtp demux: A valid SDP is needed to parse this RTP stream.
[052989d4] core demux error: SDP required
[052989d4] core demux error: A description in SDP format is required to receive the RTP stream. Note that rtp:// URIs cannot work with dynamic RTP payload format (96).

对于网络摄像头,我得到了一个 SDP 文件:

For the webcam i got a SDP-File:

m=video 61000 RTP/AVP 96
c=IN IP4 230.0.1.1
a=rtpmap:96 H264/90000

问题:我如何配置 VLCJ 或如何将 SDP 与 VLCJ 一起使用,实际上我正在使用这样的 VLCJ 嵌入式媒体播放器:

The question: How can i configure the VLCJ or how do i use the SDP with VLCJ, actually i'am using the VLCJ Embedded Media Player like that:

EmbeddedMediaPlayerComponent myMediaPlayer = new EmbeddedMediaPlayerComponent();
uk.co.caprica.vlcj.player.MediaPlayer mediaPlayer myMediaPlayer.getMediaPlayer();
mediaPlayer.setStandardMediaOptions();
mediaPlayer.playMedia("rtp://@230.0.1.1:61000");

我不知道如何将信息从 sdp 设置到 Java mediaPlayer,以便播放器能够连接到我的相机流.

I have no clue how to set the information from sdp to the Java mediaPlayer so that the player is able to connect to the stream of my camera.

有人有想法吗?请帮忙.

Has anybody an idea? Please help.

推荐答案

现在它可以工作了,我真的必须使用 SDP 文件作为媒体播放器的输入:

now it works, i really have to use the SDP-file as Input for the media-player:

String absolutPathToMySdp = "c:/temp/myTest.sdp";
mediaPlayer.playMedia(absolutPathToMySdp);

之后,我能够在我的 Swing-Panel 中看到我的相机流.谢谢.

Afterwards i was able to see the Stream of my Camera in my Swing-Panel. Thanx.

这篇关于如何在 VLCJ 中使用 SDP 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆