After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 665548 - Allow gnome-shell to record audio
Allow gnome-shell to record audio
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 696371 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-12-04 18:21 UTC by Aidan Delaney
Modified: 2021-07-05 14:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Four streams recording in the fourth screencast (73.62 KB, image/png)
2013-02-07 23:12 UTC, Tobias Wolf
Details

Description Aidan Delaney 2011-12-04 18:21:31 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
Comment 1 Ray Strode [halfline] 2011-12-05 22:47:46 UTC
out of curiosity, can you get the same effect by changing the 

org.gnome.shell.recorder pipeline 

gsetting to use your custom PIPELINE ?
Comment 2 Máirín Duffy 2011-12-06 21:44:22 UTC
Hi, I put Aidan's pipeline in the dconf-editor you pointed to Ray, and no dice: no audio.
Comment 3 Owen Taylor 2012-01-30 22:00:49 UTC
(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.)
Comment 4 Tobias Wolf 2012-02-04 15:41:27 UTC
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.
Comment 5 Dan Allen 2012-02-20 16:51:02 UTC
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.
Comment 6 Jasper St. Pierre (not reading bugmail) 2012-04-13 21:03:55 UTC
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).
Comment 7 Tobias Wolf 2012-10-06 12:13:58 UTC
Greg KH ran into this issue here:

https://plus.google.com/u/0/111049168280159033135/posts/8Ra2uhYCgGm
Comment 8 Olav Vitters 2012-10-07 04:43:53 UTC
So can we do this?
Comment 9 Olav Vitters 2013-01-26 12:51:53 UTC
Could we have this for 3.8? Seems nice to be able to record audio as well.
Comment 10 drago01 2013-02-07 22:11:59 UTC
(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.
Comment 11 Serge Gavrilov 2013-02-07 22:42:52 UTC
When this was fixed? In 3.6 I have this problem.
Comment 12 drago01 2013-02-07 22:52:31 UTC
(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
Comment 13 Tobias Wolf 2013-02-07 23:12:21 UTC
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.
Comment 14 Tobias Wolf 2013-02-07 23:13:16 UTC
I’m sorry, I forgot to mention my version:

3.7.5+git20130206.b8a8edc5-0ubuntu1~13.04~ricotz0
Comment 15 Florian Müllner 2013-03-22 10:05:03 UTC
*** Bug 696371 has been marked as a duplicate of this bug. ***
Comment 16 cowboycamilo 2013-06-23 03:19:09 UTC
(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??
Comment 17 Ray Strode [halfline] 2014-04-15 18:01:50 UTC
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.
Comment 18 Tobias Wolf 2014-04-15 19:38:11 UTC
> put this line noise

That’s crazy.
Comment 19 Ryan Lerch 2014-05-06 15:25:06 UTC
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
Comment 20 drago01 2014-06-29 08:16:23 UTC
(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
Comment 21 Robert Orzanna 2018-01-29 16:29:08 UTC
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?
Comment 22 Robert Orzanna 2018-02-01 07:35:12 UTC
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/
Comment 23 GNOME Infrastructure Team 2021-07-05 14:31:22 UTC
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.