【FFmpeg】使用FFmpeg在CentOS上录屏

查看可用设备:

ffmpeg -hide_banner -devices

Devices:
 D. = Demuxing supported
 .E = Muxing supported
 --
 DE alsa            ALSA audio output
 DE fbdev           Linux framebuffer
 D  lavfi           Libavfilter virtual input device
  E opengl          OpenGL output
 DE oss             OSS (Open Sound System) playback
  E sdl,sdl2        SDL2 output device
 DE video4linux2,v4l2 Video4Linux2 output device
 D  x11grab         X11 screen capture, using XCB

ffmpeg在linux下桌面图形的时候,通常是用x11grab设备采集桌面图像:

ffmpeg -h demuxer=x11grab

ffmpeg version N-100131-g0639f5c Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  configuration: --prefix=/usr/local/ffmpeg --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libx264 --enable-libx265 --enable-filter=delogo --enable-debug --disable-optimizations --enable-opengl --enable-libspeex --enable-libopus --enable-libmp3lame --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --host-cflags= --host-ldflags=
  libavutil      56. 61.100 / 56. 61.100
  libavcodec     58.114.100 / 58.114.100
  libavformat    58. 64.100 / 58. 64.100
  libavdevice    58. 11.103 / 58. 11.103
  libavfilter     7. 91.100 /  7. 91.100
  libswscale      5.  8.100 /  5.  8.100
  libswresample   3.  8.100 /  3.  8.100
  libpostproc    55.  8.100 / 55.  8.100
Demuxer x11grab [X11 screen capture, using XCB]:
xcbgrab indev AVOptions:
  -x                 <int>        .D........ Initial x coordinate. (from 0 to INT_MAX) (default 0)
  -y                 <int>        .D........ Initial y coordinate. (from 0 to INT_MAX) (default 0)
  -grab_x            <int>        .D........ Initial x coordinate. (from 0 to INT_MAX) (default 0)
  -grab_y            <int>        .D........ Initial y coordinate. (from 0 to INT_MAX) (default 0)
  -video_size        <image_size> .D........ A string describing frame size, such as 640x480 or hd720.
  -framerate         <string>     .D........  (default "ntsc")
  -draw_mouse        <int>        .D........ Draw the mouse pointer. (from 0 to 1) (default 1)
  -follow_mouse      <int>        .D........ Move the grabbing region when the mouse pointer reaches within specified amount of pixels to the edge of region. (from -1 to INT_MAX) (default 0)
     centered        -1           .D........ Keep the mouse pointer at the center of grabbing region when following.
  -show_region       <int>        .D........ Show the grabbing region. (from 0 to 1) (default 0)
  -region_border     <int>        .D........ Set the region border thickness. (from 1 to 128) (default 3)
  -select_region     <boolean>    .D........ Select the grabbing region graphically using the pointer. (default false)

发现云服务器没有音视频输入输出设备,就此作罢。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值