cyfile / Matlab-base-toolbox

本人使用Matlab基础工具箱所编写的各种代码
1 stars 0 forks source link

利用 ffmpeg 抓屏 #21

Open 213cy opened 4 years ago

213cy commented 4 years ago
pause(2)
for a= 1:3
    filename = ['a',num2str(a),'.jpeg'];
    eval(['!ffmpeg -y -f gdigrab -i desktop -frames:v 1 -vf "scale=iw/2:ih/2" ',...
        filename ,' 2>nul'])
    pause(0.01)
    A = imread(filename);
    figure
    imshow(A)
end
!ffmpeg -y -f gdigrab -i desktop -frames:v 1 -vf "scale=iw/2:ih/2" a.jpeg 2>nul
A = imread('a.jpeg');
figure
imshow(A)
213cy commented 4 years ago

https://github.com/cyfile/Matlab-miscellanies/issues/13

213cy commented 4 years ago

system('program arg1 arg2'); % blocking, synchronous system('program arg1 arg2 &'); % non-blocking, asynchronous