场景:
平台:win7 x64。显卡很差的电脑,使用ffmpeg录屏,鼠标闪烁的几乎看不到。录屏实现方法是使用ffmpeg,源采用的是gdigrab。
解决方法:
- 安装screen capture recorder
- 安装ffmpeg,执行命令ffmpeg.exe -f dshow -i video="screen-capture-recorder" v-out.mp4,进行录屏测试
- 鼠标闪烁问题解决。对应的修改录屏代码:
AVInputFormat *ifmt=av_find_input_format("dshow");AVDictionary *options = NULL; av_dict_set(&options, "framerate", "20", NULL);if(avformat_open_input(&pFormatCtx_Video, "screen-capture-recorder", ifmt, &options)!=0) {printf("Couldn't open input stream.(无法打开视频输入流)\n");return -1; }
参考文章
(12条消息) ffmpeg实现录屏+录音_dancing_night的专栏-CSDN博客_ffmpeg录屏
(12条消息) 使用FFmpeg进行屏幕录像和录音_彼此当年少,莫负好时光-CSDN博客