对于分发,您可以在 Linux 上使用 ffmpeg 和 GNU libx264 codec。
录制全屏无音频:
ffmpeg -hide_banner -video_size $(xrandr | awk '/\*/{printf$1}') -f x11grab -i $DISPLAY.0 screenRecording.mp4
用音频录制全屏:
ffmpeg -hide_banner -video_size $(xrandr | awk '/\*/{printf$1}') -f x11grab -i $DISPLAY.0 -f pulse -i default screenRecording.mp4
ffmpeg 选择的 H.264 配置文件(当在 MP4 输出文件上给出 -f x11grab 参数时)将为:
[libx264 @ 0x6f47200] profile High 4:4:4 Predictive, level 4.0, 4:4:4, 8-bit
记录选择/选择的窗口没有音频:
ffmpeg -hide_banner -window_id $(xwininfo | awk '/Window id:/{printf$4}') -f x11grab -i $DISPLAY.0 windowRecording.mp4
用音频记录选择/选择的窗口:
ffmpeg -hide_banner -window_id $(xwininfo | awk '/Window id:/{printf$4}') -f x11grab -i $DISPLAY.0 -f pulse -i default windowRecording.mp4
ffmpeg 在这种情况下选择的 H.264 配置文件将是:
[libx264 @ 0x6f47200] profile High 4:4:4 Predictive, level 3.1, 4:4:4, 8-bit
有关使用ffmpeg 进行屏幕录制的更多信息以及适用于 Linux、Windows 或 MacOS 的示例,您可以阅读以下内容:https://trac.ffmpeg.org/wiki/Capture/Desktop
有关x11grab 设备的更多信息:https://www.ffmpeg.org/ffmpeg-devices.html#x11grab(或输入man ffmpeg-devices)
有关libx264 和ffmpeg 的更多信息:https://trac.ffmpeg.org/wiki/Encode/H.264(或输入man x264)
有关ffmpeg的更多信息,您可以阅读:https://trac.ffmpeg.org/wiki