ffmpeg在Linux下用X11grab进行屏幕录像,在Windows下用DirectShow滤镜

 

首先需要安装一个软件,screen capture recorder

编译好的下载地址是:

http://sourceforge.net/projects/screencapturer/

源码地址是:

https://github.com/rdp/screen-capture-recorder-to-video-windows-free

 

安装完了之后,在命令行执行:

  1. ffmpeg -list_devices true -f dshow -i dummy  

系统输出大致如下:

 
  1. [dshow @ 002db420] DirectShow video devices  
  2. [dshow @ 002db420]  "screen-capture-recorder"  
  3. [dshow @ 002db420] DirectShow audio devices  
  4. [dshow @ 002db420]  "virtual-audio-capturer"  

ffmpeg已经可以捕获到DirectShow视频设备,和音频设备了.

"screen-capture-recorder" 这个就是桌面捕获设备,如果电脑上连有摄像头,也会列出来.

"virtual-audio-capturer" 这个是音频捕获设备

 

然后就可以用FFMPEG来进行录像了

Java代码   收藏代码
  1. ffmpeg -f dshow -i video="screen-capture-recorder" -f dshow -i audio="virtual-audio-capturer" -pix_fmt yuv420p -vcodec libx264 -acodec libvo_aacenc -s 1280x720 -r 25 -q 10 -ar 44100 -ac 2 -tune zerolatency -preset ultrafast -f mpegts - | ffmpeg -f mpegts -i - -c copy -bsf:a aac_adtstoasc -f flv temp.flv  

转载于:https://www.cnblogs.com/-yan/p/4759965.html

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:30 天前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐