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

This forum is about all development around libVLC.
freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

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

Postby freesunshine » 30 Mar 2012 17:41

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?

Rémi Denis-Courmont
Developer
Developer
Posts: 15267
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

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

Postby Rémi Denis-Courmont » 31 Mar 2012 12:02

In that case, duplication BEFORE transcode is probably a better idea in terms of performance and latency.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

freesunshine
Blank Cone
Blank Cone
Posts: 32
Joined: 18 Mar 2012 13:37

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

Postby freesunshine » 02 Apr 2012 13:22

thank you so much!


Return to “Development around libVLC”

Who is online

Users browsing this forum: Google [Bot] and 11 guests