How to use SDP-File with VLCJ

2019-08-10 19:14发布

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

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).

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

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");

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.

1条回答
我想做一个坏孩纸
2楼-- · 2019-08-10 20:02

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);

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

查看更多
登录 后发表回答