screencastService: Add gstreamer pipeline for h264 encoding
Add pipelinea for h264 software encoding using openh264. This is the least problematic (from a patent perspective) software encoder for h264, Fedora ships it in a pre-installed repo and it can be enabled very easily. Most people should have it enabled already to allow for decoding of h264 content. Unlike vp8enc, this encoder is optimized for realtime and is really fast, it outperforms the vp8 encoder by an order of magnitude and should allow for smooth recordings even on older hardware. The reason why mp4 was chosen as a container format over mkv is that mp4 can be played inside firefox and chromium, whereas mkv can't be played. It's ensured that the mp4 file is still playable in case the recording got cancelled by using the "first-moov-then-finalise" fragment-mode on mp4mux. Even though h264 is problematic from a patent perspective and often can't be shipped by default, it still the best supported and most popular codec out there. The software encoders and decoders are really fast, it's used everywhere on the web, and it can be hardware decoded on almost any device out there. See also: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2080 https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7335 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3211>
This commit is contained in:
parent
9a0e422a6b
commit
db490dbaf7
@ -31,6 +31,30 @@ const DEFAULT_DRAW_CURSOR = true;
|
||||
const PIPELINE_BLOCKLIST_FILENAME = 'gnome-shell-screencast-pipeline-blocklist';
|
||||
|
||||
const PIPELINES = [
|
||||
{
|
||||
id: 'swenc-dmabuf-h264-openh264',
|
||||
fileExtension: 'mp4',
|
||||
pipelineString:
|
||||
'capsfilter caps=video/x-raw(memory:DMABuf),max-framerate=%F/1 ! \
|
||||
glupload ! glcolorconvert ! gldownload ! \
|
||||
queue ! \
|
||||
openh264enc deblocking=off background-detection=false complexity=low adaptive-quantization=false qp-max=26 qp-min=26 multi-thread=%T slice-mode=auto ! \
|
||||
queue ! \
|
||||
h264parse ! \
|
||||
mp4mux fragment-duration=500 fragment-mode=first-moov-then-finalise',
|
||||
},
|
||||
{
|
||||
id: 'swenc-memfd-h264-openh264',
|
||||
fileExtension: 'mp4',
|
||||
pipelineString:
|
||||
'capsfilter caps=video/x-raw,max-framerate=%F/1 ! \
|
||||
videoconvert chroma-mode=none dither=none matrix-mode=output-only n-threads=%T ! \
|
||||
queue ! \
|
||||
openh264enc deblocking=off background-detection=false complexity=low adaptive-quantization=false qp-max=26 qp-min=26 multi-thread=%T slice-mode=auto ! \
|
||||
queue ! \
|
||||
h264parse ! \
|
||||
mp4mux fragment-duration=500 fragment-mode=first-moov-then-finalise',
|
||||
},
|
||||
{
|
||||
id: 'swenc-dmabuf-vp8-vp8enc',
|
||||
fileExtension: 'webm',
|
||||
|
Loading…
x
Reference in New Issue
Block a user