GNOME Bugzilla – Bug 665548
Allow gnome-shell to record audio
Last modified: 2021-07-05 14:31:22 UTC
I have a lecture recording application [1] in which I reuse the shell-recorder stuff from gnome-shell to record a clutter stage. In order to record the audio (which is necessary in a lecture :) ) I redefine the shell-recorder pipeline and then I shell_recorder_set_pipeline (actor->priv->rec, PIPELINE); The pipeline I use is: +#define PIPELINE "videorate ! vp8enc quality=10 speed=2 threads=%T ! queue ! mux.video_0 \ + autoaudiosrc ! audioconvert ! vorbisenc ! queue ! mux.audio_0 \ + webmmux name=mux" Are gnome-shell devs interested in providing audio recording support in shell-recorder? If so, how would you like it supported? [1] http://www.youtube.com/watch?v=u8Q9fuJY6Ig
out of curiosity, can you get the same effect by changing the org.gnome.shell.recorder pipeline gsetting to use your custom PIPELINE ?
Hi, I put Aidan's pipeline in the dconf-editor you pointed to Ray, and no dice: no audio.
(In reply to comment #1) > out of curiosity, can you get the same effect by changing the > > org.gnome.shell.recorder pipeline > > gsetting to use your custom PIPELINE ? The org.gnome.shell.recorder setting is read by the shell user interface, not be shell-recorder.c, so if someone is reusing the code, it doesn't matter. (In terms of whether we wanted to record audio - I think this would have to be an option, so we'd have to figure out some way to present the user with a GUI for screen recording - in many cases, adding audio in post-processing is better for a formal screencast, but live audio could be good for an informal problem report.)
Owen, it’s certainly possible to plug an audio source into the pipeline and just mux it into the target as well. This is an example: org.gnome.shell.recorder pipeline 'ffenc_flashsv ! queue ! muxout. pulsesrc ! audio/x-raw-int,rate=44100,channels=1,width=16 ! lame vbr=0 ! muxout. flvmux name=muxout' The problem is that upon toggling <Ctrl-Alt-Shift R> at the end, it doesn’t stop all sources and the pulsesrc keeps recording. So, upon multiple presses you get multiple audio recording streams attached to gnome-shell. Can you make it so everything is EOS’ed and torn down at the end? Live audio from a pulse monitor source would be good as a default to capture what the desktop is emitting. This can’t be added in post at any rate. Also, if there are no sounds you get digital silence that compresses well.
I also had the idea of customizing the pipeline to add audio support. Here's what I used to add audio to the webm video (same video, added vorbis audio, all free codecs): gsettings set org.gnome.shell.recorder pipeline "queue ! videorate ! vp8enc quality=10 speed=2 ! mux. pulsesrc ! audio/x-raw-int ! queue ! audioconvert ! vorbisenc ! mux. webmmux name=mux" The video output contains the entire screencast with very quality. However, as Tobias points out in comment #4 the video keeps playing with a still of the final frame and the audio repeating again, this time sounding like it's in an echo chamber. +1 to "Can you make it so everything is EOS’ed and torn down at the end?" I think supporting audio in the pipeline is the right way to go. Out of the box I would provide two internal default pipelines, one for the video and one for the audio. By default, it would just record video. The following gsetting would activate sound recording: gsetting set org.gnome.shell.recorder capture-sound true That would only have an effect if the pipeline is empty. If the pipeline is set, then it takes precedence. Offer a pipeline override is the great option as it allows the user to customize the recording quite extensively. Let's just make sure that everything is cleaned up appropriately.
I don't see why we need an option for sound. It just seems best to record it -- if you want to throw away the audio stream in postprocessing, that's one of the fastest and quickest things to do (demux into video/audio, mux just audio).
Greg KH ran into this issue here: https://plus.google.com/u/0/111049168280159033135/posts/8Ra2uhYCgGm
So can we do this?
Could we have this for 3.8? Seems nice to be able to record audio as well.
(In reply to comment #9) > Could we have this for 3.8? Seems nice to be able to record audio as well. You can record audio by changing the pipeline the problem mentioned in comment 4 has been long fixed. Maybe we could add a switch to gnome-tweak-tool that toggles between video only and audio + video pipeline? All it has to do is to change one gsettings key.
When this was fixed? In 3.6 I have this problem.
(In reply to comment #11) > When this was fixed? In 3.6 I have this problem. In bug 688487 - http://git.gnome.org/browse/gnome-shell/commit/?id=e0d127b3e46b35b0525253e3976b19b1db67c89d
Created attachment 235464 [details] Four streams recording in the fourth screencast You might be mixing up the issues. The issue here is seen in the attachment. Also, Gnome-Shell stopped honouring my gsettings key to store the screenshots elsewhere than in my photos folder.
I’m sorry, I forgot to mention my version: 3.7.5+git20130206.b8a8edc5-0ubuntu1~13.04~ricotz0
*** Bug 696371 has been marked as a duplicate of this bug. ***
(In reply to comment #10) > (In reply to comment #9) > > Could we have this for 3.8? Seems nice to be able to record audio as well. > > You can record audio by changing the pipeline the problem mentioned in comment > 4 has been long fixed. > > Maybe we could add a switch to gnome-tweak-tool that toggles between video only > and audio + video pipeline? All it has to do is to change one gsettings key. I'm on 3.8, and the pipeline in comment 4 doesn't work, any ideas??
I've had a couple of people ask me if there's a way to do this in gnome-shell 3.10 and later and I haven't had a good answer. It's complicated by the fact that g-s-d now handles starting things and the org.gnome.shell.recorder schema has gone away. After a few minutes of playing just now I came up with this: 1) go to control-center keyboard panel 2) click on the shortcuts tab 3) click on Custom Shortcuts and create a new one 4) for the command put this line noise: gjs -c "imports.gi.GLib.spawn_command_line_sync('pgrep -c -f Screencast')[1] > 1 && imports.gi.GLib.spawn_command_line_sync('pkill -f Screencast'); imports.gi.Gio.DBus.session.call_sync('org.gnome.Shell', '/org/gnome/Shell/Screencast', 'org.gnome.Shell.Screencast', 'Screencast', imports.gi.GLib.Variant.new('(sa{sv})', ['Screencast from %d %t.webm',{'pipeline': imports.gi.GLib.Variant.new('s', 'queue ! videorate ! vp8enc min_quantizer=13 max_quantizer=13 cpu-used=5 deadline=1000000 threads=%T ! queue ! mux. pulsesrc ! queue ! audioconvert ! vorbisenc ! queue ! mux. webmmux name=mux')}] ), null, 0, -1, null, null) && (new imports.gi.GLib.MainLoop(null, false)).run()" 5) for the name and shortcut pick whatever then you can toggle the recording on and off using your shortcut. I think it works, but I don't have a microphone hooked up to this machine at the moment to know for sure.
> put this line noise That’s crazy.
I tried to record sound using that pipeline in this script[1], and it does work, but it seems that the sound keeps getting recorded and added to the file, even after i stop it. note that in the script, the line with the sound pipeline in it is commented out. [1] - https://gist.github.com/ryanlerch/10919811
(In reply to comment #19) > I tried to record sound using that pipeline in this script[1], and it does > work, but it seems that the sound keeps getting recorded and added to the file, > even after i stop it. > > note that in the script, the line with the sound pipeline in it is commented > out. > > [1] - https://gist.github.com/ryanlerch/10919811 This is fixed in 3.13.3
Hello everyone, This thread is fairly old. I hope I am still right here. I am on Fedora 27 and GNOME Shell 3.26.2. I was also running into the issue of wanting to use Ctrl + Shift + Alt + R to record audio and video. Now that I am thinking, wouldn't it be actually nice to have another keyboard shortcut to record audio and video and leave the R shortcut to just record video? Something like Ctrl + Shift + Alt + A (for audio) to record video and audio. Thoughts?
Hmm interesting. According to a comment on Reddit, some distributions support recording audio, some don't. Can anyone shed some light on what this depends? Quoting here: > I've personally recorded with sound in Gnome on a Debian system. A Google search has also confirmed that it works on Ubuntu and ArchLinux distros as well. Source: https://www.reddit.com/r/Fedora/comments/7tncsq/gnome_screen_record_ctrlshiftaltr_does_not_record/dti9i47/
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.