Page 1 of 1

How to disable preview window when recording video (VLCJ)

Posted: 02 Jul 2012 14:12
by nhuythuy
Hi all,

I am working with recording video from a webcam based on example in test: uk.co.caprica.vlcj.test.visualisation (downloaded from here http://code.google.com/p/vlcj/source/br ... vn%2Ftrunk). Below is my code for recording (~13% CPU load):

Code: Select all

private void doRecord() { String[] options = { ":dshow-adev=none", ":dshow-vdev=", ":dshow-aspect-ratio=4\\:3", ":live-caching=300", ":sout-mp4-faststart", ":dshow-size=640x480", ":sout=#duplicate{dst=display,dst='transcode{vcodec=x264,venc=x264,vb=1000,fps=1,scale=1,width=640,height=480}:standard{access=file,mux=mp4,dst=C:\\xy.mp4}'}" }; mediaPlayer.prepareMedia("dshow://", options); mediaPlayer.play(); }
If I disable the preview using different sout parameter (":sout=#transcode{vcodec=x264,venc=x264,vb=1000,fps=15,scale=1}:standard{access=file,mux=mp4,dst=c:\\xy.mp4}") then CPU load is double than using previous sout parameter (~ 26% CPU load).

I try to disable preview by commenting out below lines (setting canvas for mediaPlayer in the VisualisationPlayer() constructor) but a "VLC (Direct3D output)" preview window was still available so no CPU load improvement was achieved.

Code: Select all

// videoSurface = factory.newVideoSurface(canvas); // mediaPlayer.setVideoSurface(videoSurface);
Could you please show me the way to disable preview function when recording?

Many thanks,

Thuy