Page 1 of 1

How to display camera stream while encoding it to disk file?

Posted: 30 Mar 2012 17:41
by freesunshine
i streams a camera to local file with code below:

Code: Select all

m = libvlc_media_new_location (inst, "dshow://"); CStringA opt_out_str; opt_out_str.Format(":sout=#transcode{width=640,height=480,vcodec=h264,vb=800,scale=1,fps=25.1f,acodec=aac,ab=128,channels=2,samplerate=44100} :duplicate{dst=std{access=file,mux=ts,dst=c:\\out.ts}}", libvlc_media_add_option(m,opt_out_str.GetString());
it works all right. but the camera video will not display on the window anymore. i tried changing the duplicate part like this:

Code: Select all

:duplicate{dst=display,dst=std{access=file,mux=ts,dst=c:\\out.ts}}
but it did not work because this would display the encoded image but not the camera raw image.
how can i display the camera raw image while encoding it? how to write the option string?

Re: How to display camera stream while encoding it to disk f

Posted: 31 Mar 2012 12:02
by RĂ©mi Denis-Courmont
In that case, duplication BEFORE transcode is probably a better idea in terms of performance and latency.

Re: How to display camera stream while encoding it to disk f

Posted: 02 Apr 2012 13:22
by freesunshine
thank you so much!