vlcj libvlc 流媒体桌面在一段时间后停止
我正在尝试使用 vlcj 流式传输桌面。但流式传输会在 13
或 15
秒后停止。
public static void main(String[] args) throws IOException, InterruptedException {
NativeLibrary.addSearchPath("libvlc", WindowsRuntimeUtil.getVlcInstallDir());
String media = "screen://";
String [] options ={ ":sout =#transcode{vcodec=h264,vb=56,fps=12,scale=0.5,width=176,height=144,acodec=mp4a,ab=24,channels=1,samplerate=44100} :rtp{sdp=rtsp://:5544/ok.mp4} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep"} ;
System.out.println("Streaming '" + media + "' to '" + options + "'");
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
final HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newMediaPlayer();
mediaPlayer.playMedia(media, options);
}
我正在设置 options
以便在 android 2.2 手机中播放流媒体。
我使用的是 64 位操作系统 Windows 7、32 位 vlc 和 32 位 JVM。 我认为代码是正确的..
任何人都可以给我一个解决方案吗?
这是 libvlc 问题还是 vlcj 问题?
或者 64 位操作系统的 vlc 有问题吗?
如果有任何其他解决方案来流式传输桌面以在 Android 中播放,
请帮助我。
I am trying to stream desktop using vlcj. But the streaming stops after 13
or 15
seconds.
public static void main(String[] args) throws IOException, InterruptedException {
NativeLibrary.addSearchPath("libvlc", WindowsRuntimeUtil.getVlcInstallDir());
String media = "screen://";
String [] options ={ ":sout =#transcode{vcodec=h264,vb=56,fps=12,scale=0.5,width=176,height=144,acodec=mp4a,ab=24,channels=1,samplerate=44100} :rtp{sdp=rtsp://:5544/ok.mp4} :no-sout-rtp-sap :no-sout-standard-sap :ttl=1 :sout-keep"} ;
System.out.println("Streaming '" + media + "' to '" + options + "'");
MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
final HeadlessMediaPlayer mediaPlayer = mediaPlayerFactory.newMediaPlayer();
mediaPlayer.playMedia(media, options);
}
I was setting the options
inorder to play the streaming in android 2.2 phones.
I am using 64bit OS Windows 7, 32bit vlc and 32 bit JVM.
I think the code is correct..
Can anybody give me a solution for this?
Is this a libvlc issue or vlcj issue??
Or problem for vlc with 64bit OS??
If there is any other solution to stream desktop for playing in android,help is appreciated
Please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我找到了这个问题的解决方案。
当我
删除
这一行时,问题就不再存在了,我不明白删除这一行后这是如何正确的。
I found the solution for this problem.
The problem is no more when i
removed
this lineI didn't understand how this got correct after removing this line.
尝试将“mediaPlayerFactory”初始化为静态变量
以下是一个示例:http://pastie.org/8094631
Try initializing "mediaPlayerFactory " as a static variable
Here is an example: http://pastie.org/8094631