我正在尝试使用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中播放,请务必提供帮助
请帮我。
最佳答案
我找到了解决此问题的方法。
当我removed
这行时,问题不再存在
NativeLibrary.addSearchPath("libvlc", WindowsRuntimeUtil.getVlcInstallDir());
删除此行后,我不知道该如何解决。
关于java - vlcj libvlc流式桌面在一段时间后停止,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8664146/