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 696247 - Provide a dbus api for screen recording
Provide a dbus api for screen recording
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks: 700098
 
 
Reported: 2013-03-21 03:59 UTC by Matthias Clasen
Modified: 2013-05-13 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell-recorder: Optionally return the filename of the recording (3.45 KB, patch)
2013-05-10 17:37 UTC, Florian Müllner
committed Details | Review
shell-recorder: Support specifying the recorded area (7.05 KB, patch)
2013-05-10 17:37 UTC, Florian Müllner
committed Details | Review
shell-recorder: Make drawing the cursor optional (5.56 KB, patch)
2013-05-10 17:37 UTC, Florian Müllner
committed Details | Review
sessionMode: Add 'allowScreencast' property (1.33 KB, patch)
2013-05-10 17:37 UTC, Florian Müllner
committed Details | Review
Expose screencast functionality via DBus (12.10 KB, patch)
2013-05-10 17:38 UTC, Florian Müllner
committed Details | Review

Description Matthias Clasen 2013-03-21 03:59:13 UTC
I've had a request from support people to have some programmatic way to capture a screen recording.
Comment 1 Florian Müllner 2013-03-21 07:37:55 UTC
Do we need an "official" API or is something like

gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Shell --method org.gnome.Shell.Eval 'Main.componentManager._allComponents.recorder._toggleRecorder();'

enough?
Comment 2 drago01 2013-03-21 09:27:50 UTC
I'd say we should have an "official" API so one can write a screen casting app that uses the compositor for recording without having to rely on Eval.
Comment 3 Matthias Clasen 2013-04-10 23:14:21 UTC
Here is what I have been asked to support:

- start / stop
- specify the output file
- specify the recorded area/window
- control the quality (optional)
Comment 4 Dave Malcolm 2013-05-04 14:28:08 UTC
This sounds useful, but strikes me as having some security implications: 
  * which programs get to trigger a recording?
  * can other programs see the file that gets recorded?
  * does the user get visual feedback that a recording is in progress?
Comment 5 drago01 2013-05-04 17:04:39 UTC
(In reply to comment #4)
> This sounds useful, but strikes me as having some security implications: 
>   * which programs get to trigger a recording?

Anyone that can access the session bus

>   * can other programs see the file that gets recorded?

Yes (apps are currently not sandboxed and can pretty much read all the files in your home directory).

>   * does the user get visual feedback that a recording is in progress?

Yes this is currently the case and I don't see a reason why we should remove the recording indicator for dbus triggered recordings.
Comment 6 Matthias Clasen 2013-05-05 16:19:20 UTC
Yes, as long as the user session is a single security domain without any sandboxing, this makes no difference one way or the other.

Apps can already take screenshots and read all of your home directory.

We have plans to improve this situation, and this D-Bus api will be updated to fit into them when the time comes.
Comment 7 Florian Müllner 2013-05-05 16:28:41 UTC
(In reply to comment #6)
> Apps can already take screenshots and read all of your home directory.

... or take a screencast (either by synthesizing the existing keyboard shortcut, or grabbing pixels from the framebuffer themselves). Offering a DBus API for screencasting just adds convenience, it doesn't actually change what applications can do (see recordMyDesktop which works just fine without collaboration from the window manager).
Comment 8 Matthias Clasen 2013-05-06 10:41:47 UTC
Florian, any update ?
Comment 9 Florian Müllner 2013-05-10 17:37:41 UTC
Created attachment 243809 [details] [review]
shell-recorder: Optionally return the filename of the recording

It is currently not always possible to predict the actual output filename
of a recording - the file-template does not necessarily use an absolute
path and may contain %d and %t escape sequences.
This is OK for fire-and-forget uses like the existing keyboard shortcut,
but we will soon expose the functionality on DBus and consumers of that
API might very well need to access the file after the recording. So do
the same as our screenshot API and add an optional (out) parameter to
record().
Comment 10 Florian Müllner 2013-05-10 17:37:47 UTC
Created attachment 243810 [details] [review]
shell-recorder: Support specifying the recorded area

Currently we will always record the entire screen. It has been requested
to support recording a specified area analogous to the screenshot API as
well, so add a set_area() method which allows this.
Comment 11 Florian Müllner 2013-05-10 17:37:53 UTC
Created attachment 243811 [details] [review]
shell-recorder: Make drawing the cursor optional

As with screenshots, showing the cursor in a recording may not be
desirable, so add a property to control whether the cursor is drawn
or not.
Comment 12 Florian Müllner 2013-05-10 17:37:59 UTC
Created attachment 243812 [details] [review]
sessionMode: Add 'allowScreencast' property

Our built-in screen recorder is implemented as a component, so it will
just be disabled when the session mode doesn't allow screencasting.
However we will expose screencasting functionality on DBus as well, and
while it makes sense to restrict its availablity to the same modes as
the existing recorder, exporting/unexporting the service depending on
the session mode is not very consumer friendly.
For that reason, add an additional 'allowScreencast' property that for now
mirrors the availability of the 'recorder' component.
Comment 13 Florian Müllner 2013-05-10 17:38:05 UTC
Created attachment 243813 [details] [review]
Expose screencast functionality via DBus

Like screenshots, the screen recorder can be a useful tool in other cases
than being triggered by a keyboard shortcut. To account for that, export
a Screencast DBus API similar to the existing Screenshot interface.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-05-10 17:44:13 UTC
Review of attachment 243810 [details] [review]:

OK.
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-05-10 17:44:57 UTC
Review of attachment 243811 [details] [review]:

OK.
Comment 16 Jasper St. Pierre (not reading bugmail) 2013-05-10 17:45:07 UTC
Review of attachment 243809 [details] [review]:

OK.
Comment 17 Jasper St. Pierre (not reading bugmail) 2013-05-10 17:45:44 UTC
Review of attachment 243812 [details] [review]:

OK.
Comment 18 Jasper St. Pierre (not reading bugmail) 2013-05-10 17:46:11 UTC
Review of attachment 243813 [details] [review]:

OK.
Comment 19 Florian Müllner 2013-05-10 17:50:45 UTC
Attachment 243809 [details] pushed as 3b95560 - shell-recorder: Optionally return the filename of the recording
Attachment 243810 [details] pushed as c61573a - shell-recorder: Support specifying the recorded area
Attachment 243811 [details] pushed as dc3082e - shell-recorder: Make drawing the cursor optional
Attachment 243812 [details] pushed as d44d00f - sessionMode: Add 'allowScreencast' property
Attachment 243813 [details] pushed as 24c5306 - Expose screencast functionality via DBus
Comment 20 Jiří Moskovčák 2013-05-13 12:51:15 UTC
Thank you for implementing this, would it be possible to get it to Fedora 19?
Comment 21 Florian Müllner 2013-05-13 13:27:14 UTC
(In reply to comment #20)
> Thank you for implementing this, would it be possible to get it to Fedora 19?

It's on the gnome-3-8 branch, and there'll be a 3.8.2 release later today or early tomorrow (we still have some unlanded stuff on the wishlist). So yes :-)