Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 屏幕记录_C++_Linux_Libvlc - Fatal编程技术网

C++ 屏幕记录

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; 我解决了那

当程序在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;
我解决了那个问题/
以下是工作代码:

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}'