简体   繁体   English

Java:使用vlcj的rtsp流到文件

[英]java: rtsp stream to file using vlcj

I am trying to store a rtsp stream to file using vlcj. 我正在尝试使用vlcj将rtsp流存储到文件中。

I've done a couple of tutorials, looked at some of their test projects but haven't been able to do this. 我已经完成了一些教程,研究了他们的一些测试项目,但还没有做到这一点。

Any ideas? 有任何想法吗? Thanks in advance! 提前致谢!


EDIT 编辑

Found an An example of transcoding and saving video from a capture device. 找到了一个从捕获设备进行代码转换和保存视频的示例。 Trying to get it to work. 试图使其工作。 Looking for some documentation on the "options" part in mediaPlayer.playMedia(mrl, options); mediaPlayer.playMedia(mrl, options);有关“选项”部分的一些文档mediaPlayer.playMedia(mrl, options); .

Someone answered me on the video lan forums, check it out . 有人在视频局域网论坛上回答了我, 请查看

My relevant code is below, where the most important part is the additional option for the vlc media player ":file{dst=C:/Users/the man/yahoo.mp4}" . 我的相关代码如下,其中最重要的部分是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);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM