包含rtpjava的词条

博主:adminadmin 2022-12-27 20:00:12 54

今天给各位分享rtpjava的知识,其中也会对进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

java里有没有播放音乐的函数

JMF就是最简单的方法,你是做播放器的话,那就最合适不过了,JMF封装的非常好,用户接口简单易用,比用别的方法都简单。我原来也专门看过。官方的JMF介绍文档写的很通俗易懂,这个框架我觉得重点是java的RTP协议,可以用java开发远程会议之类的东西,播放只是它最基本的功能而已,所以你用的话只看看那些基本的东西就够了。java的基本类库里也有sound包,但是没有音频知识这个东西估计你够强能看懂,如果你单纯搞一个播放器,而非处理音频,就用JMF就可以

java rtpstream怎么用

1.出现Local Data AddressDoes not belong to any of this hosts local interfaces错误:

主要问题是发送视频和音频的程序需要在服务器上运行,你可以选择Win2000 Server 或者Win2003 Server,问题就解决了。

2.传输声音和视频的方法如下:

a.传输声音或者视频文件

编译完AVTransmit2.java后,再命令提示符中输入命令:java AVTransmit2 file:test.wav 224.224.123.123 22222(注意文件的类型是.wav 或者.mov 、.mpg的文件,不可以是.mp3、.rmvb等其他不支持的文件。传输支持文件格式有限,我也没有办法,应该在添加相关的插件就行了,希望大家提供帮助),其中test.wav即传输的文件名,224.224.123.123为多播地址,22222为端口号.

接收方法:编译完AVReceive.java后,在命令提示符中输入命令:java AVReceive 224.224.123.123/22222即可接受到声音文件

b.传输麦克风的音频,在传输之前先检查电脑录音控制的选项是否为麦克风.(步骤:打开桌面任务栏上的音量控制,选择选项----属性-----调节音量选择录音,之后在下面的音量控制属性中选中麦克风。单击确定。接着跳到录音控制,选择麦克风就行了)。使用的命令是:java AVTransmit2 dsound:// 224.224.123.123 22222,此时就开始传输声音了。

接收方法同上

c.传输摄相头视频,使用的命令为:java AVTransmit2 vfw://0 224.224.123.123 22222

接收方法同上

d.关于广播、组播和单播

广播:对于局域网广播你可以使用广播的地址,如你的子网掩码是255.255.225.0,即C类的默认子网掩码,你的广播地址可以是192.168.3.255。(注:我的局域网ip地址分配为192.168.3.X)。如子网掩码不同,你可以参照相关的网络常识自己推算。

接收时也使用多播地址来接受,假如发送方的机器地址为:192.168.3.46。发送时在发送放的机器上运行java AVTransmit2 file:test.wav 192.168.3.255 22222,接收时使用java AVReceive2 224.224.123.123 22222。才能完成接收.这和网上的说法不同,端口号不要填错,地址任意。按网上的说法,使用的接收地址应为为192.168.3.46,可是我没有成功,总是出现Local Data AddressDoes not belong to any of this hosts local interfaces的错误,而使用多播地址反而成功了。具体的参数我就不多介绍了,有问题可以给我留言。

组播:使用组播地址发送,组播地址接收即可

单播:假如你只想给某台机子发送,那么就在发送方输入命令,如:java AVTransmit2 file:test.wav 192.168.3.47 22222,这时你只会将声音流文件发送给47号计算机。而接受时还是使用多播地址,如java AVReceive2 224.224.123.123 22222。这是就听到声音了。

总之,使用RTP传输,在接受时都在使用多播地址,在发送时根据情况而定,至于ttl你可以不去管它。不只大家是怎么实现的,反正网上的资料让我变的很失望,真正的成功源于实践。下面摘取一段让大家欣赏(尽信书则不如无书)

网上摘取:

Transmitting Audio and Video over RTP

 The AVTransmit2 class is very similar to the VideoTransmit, but uses RTP managers

 to send the video and audio streams.

 Since the media tracks are transmitted in multiple sessions, you'll need to

 use one Player per track on the receive side. Using JMStudio, you can

  start multiple Players from the "File" menu using the "New Window"

  item. Then either:

 use the "Open URL..." item to open one RTP session per track. The URL to use is:

rtp://sourceIP:port/media

Where sourceIP is the IP address of the RTP session and the port

number is the same one that is used on the transmitting side.

OR

Open RTP session and specify sourcIP and port

How to run this sample

1. Run AVTransmit2 with the required 3 command line parameters

For example, we can use any of the following:

- java AVTransmit2 file:clips/clip01mpg.mpg 224.112.112.112 22222

2. To receive the transmission on the client side use JMStudio:

- use open RTP session and specify group: 224.112.112.112 port: 22222

AND use FILE - New Window and open RTP sesssion with port 22224.

OR

- use open URL and specify: rtp://224.112.112.112:22222/video

AND use FILE - New Window and open URL with 22224/audio

Notes:

You should run 1. then 2., otherwise AVTransmit2 will find the port number used.

You can also use the program to send only audio or video as follows:

- java AVTransmit2 javasound://0 224.112.112.112 22222 (audio only)

- java AVTransmit2 vfw://0 224.112.112.112 22222 (video only)

In such case create only one instance of JMStudio.

Use Unicast:

- java AVTransmit2 file:clip01.mpg 128.82.4.7 22222

Where 128.82.4.7 is the receicver address.

If the sender address is 128.82.4.9 it will use port 22222 as well

to send out data. In this case the receiver (e.g., JMStudio)

should specify the sender as: 128.82.4.9 22222.

Therefore to use unicast you should have two machines since

you can not use the same port for both sender and receiver.

Receiving Audio and Video using RTP

AVReceive2 uses the RTPManager API to receive RTP transmissions.

AVReceive2 performs the following tasks:

Open one RTP session per session address given.

Listen for the NewReceiveStreamEvent from the ReceiveStreamListener.

Create a JMF Player for each stream received for playback.

This sample program can be used in conjunction with JMStudio,

the AVTransmit2 sample or any other RTP compliant transmitter.

The IP address should be the address of the computer which transmits the data; or the multicast address if multicast is being used for the transmission.

The ports should be the same as what's being used by the transmitter.

How to run this sample

1. Run AVTransmit2 with the required 3 command line parameters

For example:

- java AVTransmit2 file:clips/clip01mpg.mpg 224.112.112.112 1234

2. Run AVReceive2 and specify the RTP session addresses to receive from.

For example:

- java AVReceive2 224.112.112.112/1234 224.112.112.112/1236

to simultaneously receive 2 different RTP sessions (video and audio).

Note: because of port reuse, it must run in this order, 1 then 2.

C/S架构,服务器为LINUX,用到的协议sip,RTST,RTP,开发语言为JAVA,C#,C++,哪款性能测试工具比较适合?

RTST:是RTSP吧,RTSP(Real Time Streaming Protocol)是用来控制声音或影像的多媒体串流协议

java 如何发送 RTP/RTSP协议 具体怎么实现的

首先搜索有没有RTP/RTSP协议现成的包可用,没有那么你就要去读协议白皮书了。

然后按照协议白皮书的格式,编写通信协议。

最后写出的东西好不好用就看你的水平了。

怎么用java实现一个简单的播放器?

用java实现播放器 主要用到java里的媒体框架,即JMF, JMF实际上是Java的一个类包。JMF 2.1.1技术提供了先进的媒体处理能力,从而扩展了Java平台的功能。这些功能包括:媒体捕获、压缩、流转、回放,以及对各种主要媒体形式和编码的支 持,如M-JPEG、H.263、MP3、RTP/RTSP (实时传送协议和实时流转协议)、Macromedias Flash、IBM的HotMedia和Beatniks的Rich Media Format (RMF)等。JMF 2.1.1还支持广受欢迎的媒体类型,如Quicktime、Microsofts AVI和MPEG-1等。此外,JMF 2.1.1软件中包括了一个开放的媒体架构,可使开发人员灵活采用各种媒体回放、捕获组件,或采用他们自己的定制的内插组件。 我当初也做过类似的东西(本科实习时),给你个具体教程链接吧:

关于rtpjava和的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。

The End

发布于:2022-12-27,除非注明,否则均为首码项目网原创文章,转载请注明出处。