Ssr: Is there a way to command it in console?

Created on 23 Apr 2014  Â·  28Comments  Â·  Source: MaartenBaert/ssr

It would be useful if it can be configured and controlled in console only, to work as a daemon like thing, is there already a solution?

feature request

Most helpful comment

The main problem is that the record-schedule branch is in a broken state right now because I tried to do too many things at once. And I don't have time to complete the changes that I was trying to make, because something more urgent has popped up (the new GLInject protocol).

If you really need a CLI _now_, then you could probably make one by looking at PageRecord and imitating what it is doing. The GUI and backend are already separate, but PageRecord is currently handling a lot of bookkeeping that should ideally be moved to the backend as well. If you want to make a CLI based on the current master branch, you would have to copy-paste a lot of code from PageRecord (basically everything in the functions StartPage, StopPage, StartOutput, StopOutput, StartInput and StopInput, and probably a few others as well).

In the record-schedule branch, I was working on moving this code to the backend to avoid code duplication when I finally make the CLI. If you make a CLI based on the master branch, I will not be able to merge it, since it would interfere with those changes. But you could do it as a crude temporary solution.

All 28 comments

A system like that does not exist yet, but it is on the to-do list.

I'm looking forward to this feature as well. I'm looking to write a script that'd automate my screen capturing. The lack of console commands makes it impossible to integrate this software in any scripts.

I really want to use ssr in my system but I have little experience in project like ssr, C++ is OK for me but never read/edit such big project.
I need to estimate the workload and I do need suggestion on how to make it, I mean, should I make it like a daemon or some background app what can be controlled by other apps or script or message?I know I should read through the source code, since I know nothing about the GUI, in what order should I read them and what should I pay attention to?
Thanks very much.

Or do you think it would be better for me to use ffmpeg to make it?

I think they replaced ffmpeg with aconv on the new OS. They're the same thing though. So far as my knowledge goes, ffmpeg/aconv would do the job pretty well if you use the right codecs.

The ffmpeg/avconv command line tools are meant for converting files, not for recording/streaming live sources. They have some serious problems with audio/video synchronization and also some performance issues, mainly due to the lack of full multithreading (if your video encoder is slow, your audio will underrun etc.).

There are a few different ways to add 'remote control' support to a graphical application. I think that DBus is the most suitable in this case, it was designed specifically for things like this. There is a Qt DBus library that should make this relatively easy. I've never used it though, so I'm not sure how long that would take.

PS: avconv (i.e. libav) is a fork of ffmpeg, it is similar but not identical. Not all distributions have switched to libav, actually most have decided to stick with ffmpeg. SSR supports both since it is hard to install either ffmpeg or libav on a distribution that already uses the other one.

I tried ffmpeg and it's really not quite easy to use comparing with ssr but is enough for my prototype.
I may turn back to ssr in future development.
Thanks so much for all your replies and explanations!

@blangero , were you able to get high quality video and audio out of ffmpeg/avconv? If so, can you please tell me what you did, I've been trying in vain to get a high quality video/audio out of them. Thanks.

@rrlamichhane Sorry but my goal is to get low quality video without audio, Mmmm just the opposite.
But while I was searching and learning ffmpeg I found that most of the articles are for high quality video/audio, such as https://trac.ffmpeg.org/wiki/Capturing%20audio%20with%20FFmpeg%20and%20ALSA
Have you ever have I try?

@rrlamichhane if your goal is to capture high quality video and audio why are you asking if you should use ffmpeg when SSR does just what you're asking for.

@ubuntuaddicted I need to automate my capture and change them using scripts. SSR tasks cannot be invoked from the terminal. That is my primary concern. However, SSR does capture high quality video and audio though. I just wish I can run its features from the terminal.

This software is fantastic for grabbing high quality video from my apps. Allowing it to work from system calls in my code would complete it (as simple as a grab and stop grabbing command from the command line). PLEASE make it a priority. Another feature that would greatly improve user interface would be to have separate hot keys for grabbing and stopping. While doing full screen grabs it is hard to be sure what mode you are in with a toggle.

Nice work. This is the best screen recorder on Linux for quality and speed! If I get a chance I'll dig into your code and see how tough it would be...

I'm taking some necessary steps to make this possible. Currently the settings and some of the recording logic is mixed with the GUI code, so I can't record without loading the GUI as well. So now I'm separating that logic from the GUI, which isn't easy. I'm about halfway now, I think.

I'm also working on multiple hotkey support (the old code didn't allow this). For now, if you are worried about what state SSR is in after you press the hotkey, you can enable sound notifications: there is a separate sound for 'start' and 'stop'.

Hi Maarten,

Thanks for working on this. It is allowing me to capture from my screen
with higher quality than when I use an Elgato HDMI H264 to USB capture
device https://www.elgato.com/en/gaming/game-capture-hd to a windows
laptop.

For an example you can see https://vimeo.com/98316791 with the password
"yummy". If you are logged in you can download the original video which
looks much better than the compressed online version. This was recorded
"live" at a video installation.

I was aware of the sound option, but alas I did not have a way to monitor
audio from the computer.

Keep up the good work!

ET

@MaartenBaert, is it possible for you to upload/push your semi-done CLI refactoring progress? I might be able to do some of it myself.

I don't think that will work. That branch is in a very broken state right now, and you really need to understand how the GUI and backend work together to separate it properly. This really needs to be done properly, so I don't want to hurry it.

Very decent piece of software, Maarten. Thanks for working on it.

I have been using ffmpeg and avconv until the option -async was deprecated. It was enough to keep audio and video in sync, even with limited CPU resources.

I am currently automating ssr on Linux with xdotool, while the CLI is not ready.

Those are good tips. Thanks rodrigofarias77.

et

On Fri, Jul 4, 2014 at 12:11 PM, rodrigofarias77 [email protected]
wrote:

Very decent piece of software, Maarten. Thanks for working on it.

I have been using ffmpeg and avconv until the option -async was
deprecated. It was enough to keep audio and video in sync, even with
limited CPU resources.

I am currently automating ssr on Linux with xdotool, while the CLI is not
ready.

—
Reply to this email directly or view it on GitHub
https://github.com/MaartenBaert/ssr/issues/169#issuecomment-48066233.

Ah, 'xdotool' just might be what I was looking for until the CLI is ready. Thanks rodrigofarias77.

Yes, to call ssr from the command line would be terrific. Then it could be used to automate many tasks. It would be sufficient to just leave most of the parameters in a config file, and just pass x, y, h, w parameters to the recorder.

@MaartenBaert This would be awesome to be able to run ssr from the command line ! Thank you for working on this ! :)

Currently no, you can start it from the console but you cannot run it
inside the terminal That is on his to-do list if I remember.

On Sun, Jan 11, 2015 at 3:52 PM, Timothée Jeannin [email protected]
wrote:

@MaartenBaert https://github.com/MaartenBaert This would be awesome to
be able to run ssr from the command line ! Thank you for working on this !
:)

—
Reply to this email directly or view it on GitHub
https://github.com/MaartenBaert/ssr/issues/169#issuecomment-69510916.

Hello, thanks for this decent work.

I happen to need a CLI interface, so I want to give a try.
Anybody already writing something on this?

Or, can I have some hint like what code to look first (there must be a page explaining how GUI and backend cooperate, cannot find it right now).

@jokester,

ssr is a much more robust alternative to ffmpeg recording abilities. However, while the CLI is not ready, I am able to sucessfully record screen with ffmpeg -vsync drop (version 2.5.4), even under heavy load.

Another alternative would be to automate ssr with something like xdotool, but it is a bit tricky...

The main problem is that the record-schedule branch is in a broken state right now because I tried to do too many things at once. And I don't have time to complete the changes that I was trying to make, because something more urgent has popped up (the new GLInject protocol).

If you really need a CLI _now_, then you could probably make one by looking at PageRecord and imitating what it is doing. The GUI and backend are already separate, but PageRecord is currently handling a lot of bookkeeping that should ideally be moved to the backend as well. If you want to make a CLI based on the current master branch, you would have to copy-paste a lot of code from PageRecord (basically everything in the functions StartPage, StopPage, StartOutput, StopOutput, StartInput and StopInput, and probably a few others as well).

In the record-schedule branch, I was working on moving this code to the backend to avoid code duplication when I finally make the CLI. If you make a CLI based on the master branch, I will not be able to merge it, since it would interfere with those changes. But you could do it as a crude temporary solution.

It's been awhile... has anyone taken a stab at this yet?

Any updates on this? @MaartenBaert

Not really, it may not sound like a huge feature but this would require significant changes to the way SSR works, due to the way the recording engine interacts with the GUI. I have other projects that are higher priority right now.

Was this page helpful?
0 / 5 - 0 ratings