C++ 屏幕记录
当程序在linux下运行时,我需要保存我的屏幕。我试过了C++ 屏幕记录,c++,linux,libvlc,C++,Linux,Libvlc,当程序在linux下运行时,我需要保存我的屏幕。我试过了 string out = filepath; stringstream cmd; cmd << "cvlc -v screen:// '--sout=#transcode{vcodec=h264}:file{dst=" << out <<"} ' &" system(cmd.str().c_str()); string out=filepath; stringstreamcmd; 我解决了那
string out = filepath;
stringstream cmd;
cmd << "cvlc -v screen:// '--sout=#transcode{vcodec=h264}:file{dst=" << out <<"} ' &"
system(cmd.str().c_str());
string out=filepath;
stringstreamcmd;
我解决了那个问题/
以下是工作代码:
cvlc -I 'dummy' screen:// --screen-left=0 --screen-top=0 --screen-width=1280 --screen-height=960 --screen-fps=30 \
--sout '#transcode{vcodec=mp2v, vb=800, scale=1, acodec=none}:file{mux=ts, dst=your_video_path_to_be_saved}'