简体   繁体   中英

How to pause a video in vlcj( Recording the video in vlcj)?

How to pause a video in vlcj?

I am using web camera. So i use the dshow in vlcj on windows. Code is:

String[] options = {
                      ":dshow-adev=none",
                      ":dshow-vdev=",
                      ":dshow-aspect-ratio=4:3",
                      ":sout-mov-faststart",
                      ":dshow-size=640x480",
                      ":sout=#duplicate{dst=display,
dst='tran

scode{vcodec=h264,venc=x264,vb=1000,
    fps=1,scale=1,width=640,height=480}:

standard{access=file,,mux=mov,dst="+fileName+"}'}"
                };

mediaPlayer.prepareMedia("dshow://",options);

If i use default pause, that time the video is paused Ex: mediaPlayer.pause(); . But the video is stored in cache. So I click the play button then the video played with the delayed time. What i need is if i pause the video the video should pause recording and after press the play it should resume the recording. Similar to JMF. Can any one please provide the answer?

You can use two instances of media player; such that the first instance just receives input and forwards it to a special UDP port. The output should be available at a url such as: udp://@127.0.0.1:20001 . Then you can start the main media player using the output of first player as input. After that you can play or stop the first player to start or stop stream. Because UDP is connection-less the second player will work fine.

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