简体   繁体   English

如何在vlcj中暂停视频(在vlcj中录制视频)?

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

How to pause a video in vlcj? 如何在vlcj中暂停视频?

I am using web camera. 我正在使用网络摄像头。 So i use the dshow in vlcj on windows. 所以我在Windows的vlcj中使用dshow。 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(); 如果我使用默认暂停,则该视频将暂停, 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. 类似于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. 这样第一个实例仅接收输入并将其转发到特殊的UDP端口。 The output should be available at a url such as: udp://@127.0.0.1:20001 . 输出应可在以下网址获得: 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. 由于UDP无需连接,因此第二个播放器可以正常工作。

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

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