简体   繁体   中英

java: rtsp stream to file using vlcj

I am trying to store a rtsp stream to file using vlcj.

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); .

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}" .

    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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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