我正在尝试使用 vlcj 将 rtsp 流存储到文件。
我已经完成了几个教程,查看了他们的一些测试项目,但无法做到这一点。
有什么想法吗?提前致谢!
编辑
找到一个 An example of transcoding and saving video from a capture device.试图让它工作。在 mediaPlayer.playMedia(mrl, options);
中寻找有关“选项”部分的一些文档。
最佳答案
有人在视频局域网论坛上回答了我,check it out .
我的相关代码如下,其中最重要的部分是vlc媒体播放器的附加选项 ":file{dst=C:/Users/the man/yahoo.mp4}"
。
mFactory = new MediaPlayerFactory();
mPlayer = mFactory.newHeadlessMediaPlayer();
String mrl = "rtsp://@" + addressStr + ":" + mPhoneRTSPPort;
String options = ":sout=#transcode{vcodec=h264,venc=x264{cfr=16},scale=1,acodec=mp4a,ab=160,channels=2,samplerate=44100}"
+ ":file{dst=C:/Users/the man/yahoo.mp4}";
mPlayer.playMedia(mrl, options);
关于java:使用vlcj将rtsp流传输到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13964770/