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

 

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

编译好的下载地址是:

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

源码地址是:

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

 

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

  • 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代码  ffmpeg 录屏 screen capture recorder
    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  

    相关文章:

    • 2021-12-27
    • 2021-08-29
    • 2022-01-03
    • 2021-06-04
    • 2021-07-22
    • 2021-06-20
    • 2022-12-23
    • 2021-07-16
    猜你喜欢
    • 2021-12-22
    • 2021-05-01
    • 2021-12-04
    • 2022-01-02
    • 2021-08-25
    • 2021-12-15
    相关资源
    相似解决方案