How to display camera stream while encoding it to disk file?
Posted: 30 Mar 2012 17:41
i streams a camera to local file with code below:
it works all right. but the camera video will not display on the window anymore. i tried changing the duplicate part like this:
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?
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());
Code: Select all
:duplicate{dst=display,dst=std{access=file,mux=ts,dst=c:\\out.ts}}
how can i display the camera raw image while encoding it? how to write the option string?