How to Start FFMpeg Screen Recording with Custom Shortcut
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
4
down vote
favorite
What is the easiest way to run a FFMpeg screen recording command with a custom keyboard shortcut? Adding my raw ffmpeg command to a Custom Shortcut in the Keyboard settings doesn't do the trick.
Here's the command I'm using:
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv
The command works fine in terminal. It runs until you terminate it and outputs the file as expected, and running it as a keystroke doesn't appear to do anything, at least visibly. Also, running
gnome-terminal -e "ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv"
does open up a terminal window and run a function for a split second, but then the window closes again immediately. Adding "; bash" to the end of the string doesn't keep the window open. Managed to get a screenshot of the terminal window right before it closes, it seems to be terminating mid-execution of the function without displaying any errors. Here that is:
I'm running Ubuntu 16.04.3 LTS.
command-line shortcut-keys ffmpeg
add a comment |Â
up vote
4
down vote
favorite
What is the easiest way to run a FFMpeg screen recording command with a custom keyboard shortcut? Adding my raw ffmpeg command to a Custom Shortcut in the Keyboard settings doesn't do the trick.
Here's the command I'm using:
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv
The command works fine in terminal. It runs until you terminate it and outputs the file as expected, and running it as a keystroke doesn't appear to do anything, at least visibly. Also, running
gnome-terminal -e "ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv"
does open up a terminal window and run a function for a split second, but then the window closes again immediately. Adding "; bash" to the end of the string doesn't keep the window open. Managed to get a screenshot of the terminal window right before it closes, it seems to be terminating mid-execution of the function without displaying any errors. Here that is:
I'm running Ubuntu 16.04.3 LTS.
command-line shortcut-keys ffmpeg
1
Hi dessert, thanks for the reply. Edited question accordingly.
â BTEVC
Feb 20 at 9:05
1
Updated with release description.
â BTEVC
Feb 20 at 23:07
Don't know anything about the shortcut component of the question, butffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25
should beffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0.0
. More info: x11grab docs.
â LordNeckbeard
Feb 21 at 19:45
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
What is the easiest way to run a FFMpeg screen recording command with a custom keyboard shortcut? Adding my raw ffmpeg command to a Custom Shortcut in the Keyboard settings doesn't do the trick.
Here's the command I'm using:
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv
The command works fine in terminal. It runs until you terminate it and outputs the file as expected, and running it as a keystroke doesn't appear to do anything, at least visibly. Also, running
gnome-terminal -e "ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv"
does open up a terminal window and run a function for a split second, but then the window closes again immediately. Adding "; bash" to the end of the string doesn't keep the window open. Managed to get a screenshot of the terminal window right before it closes, it seems to be terminating mid-execution of the function without displaying any errors. Here that is:
I'm running Ubuntu 16.04.3 LTS.
command-line shortcut-keys ffmpeg
What is the easiest way to run a FFMpeg screen recording command with a custom keyboard shortcut? Adding my raw ffmpeg command to a Custom Shortcut in the Keyboard settings doesn't do the trick.
Here's the command I'm using:
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv
The command works fine in terminal. It runs until you terminate it and outputs the file as expected, and running it as a keystroke doesn't appear to do anything, at least visibly. Also, running
gnome-terminal -e "ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv"
does open up a terminal window and run a function for a split second, but then the window closes again immediately. Adding "; bash" to the end of the string doesn't keep the window open. Managed to get a screenshot of the terminal window right before it closes, it seems to be terminating mid-execution of the function without displaying any errors. Here that is:
I'm running Ubuntu 16.04.3 LTS.
command-line shortcut-keys ffmpeg
command-line shortcut-keys ffmpeg
edited Feb 20 at 23:06
asked Feb 20 at 3:58
![](https://i.stack.imgur.com/11dMo.jpg?s=32&g=1)
![](https://i.stack.imgur.com/11dMo.jpg?s=32&g=1)
BTEVC
214
214
1
Hi dessert, thanks for the reply. Edited question accordingly.
â BTEVC
Feb 20 at 9:05
1
Updated with release description.
â BTEVC
Feb 20 at 23:07
Don't know anything about the shortcut component of the question, butffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25
should beffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0.0
. More info: x11grab docs.
â LordNeckbeard
Feb 21 at 19:45
add a comment |Â
1
Hi dessert, thanks for the reply. Edited question accordingly.
â BTEVC
Feb 20 at 9:05
1
Updated with release description.
â BTEVC
Feb 20 at 23:07
Don't know anything about the shortcut component of the question, butffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25
should beffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0.0
. More info: x11grab docs.
â LordNeckbeard
Feb 21 at 19:45
1
1
Hi dessert, thanks for the reply. Edited question accordingly.
â BTEVC
Feb 20 at 9:05
Hi dessert, thanks for the reply. Edited question accordingly.
â BTEVC
Feb 20 at 9:05
1
1
Updated with release description.
â BTEVC
Feb 20 at 23:07
Updated with release description.
â BTEVC
Feb 20 at 23:07
Don't know anything about the shortcut component of the question, but
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25
should be ffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0.0
. More info: x11grab docs.â LordNeckbeard
Feb 21 at 19:45
Don't know anything about the shortcut component of the question, but
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25
should be ffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0.0
. More info: x11grab docs.â LordNeckbeard
Feb 21 at 19:45
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Found a solution. Running the command with "-x sh -c" as opposed to "-e" executes the function without exiting the window. Syntax borrowed from this superuser discussion.
The full function:
gnome-terminal -x sh -c 'ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv; exec bash'
1
As I mentioned in the comment your-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your-r
value. To prevent that remove-r
and replace it with-framerate
, and move it so it is an input option (before the-i
).
â LordNeckbeard
Feb 22 at 18:47
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Found a solution. Running the command with "-x sh -c" as opposed to "-e" executes the function without exiting the window. Syntax borrowed from this superuser discussion.
The full function:
gnome-terminal -x sh -c 'ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv; exec bash'
1
As I mentioned in the comment your-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your-r
value. To prevent that remove-r
and replace it with-framerate
, and move it so it is an input option (before the-i
).
â LordNeckbeard
Feb 22 at 18:47
add a comment |Â
up vote
0
down vote
accepted
Found a solution. Running the command with "-x sh -c" as opposed to "-e" executes the function without exiting the window. Syntax borrowed from this superuser discussion.
The full function:
gnome-terminal -x sh -c 'ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv; exec bash'
1
As I mentioned in the comment your-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your-r
value. To prevent that remove-r
and replace it with-framerate
, and move it so it is an input option (before the-i
).
â LordNeckbeard
Feb 22 at 18:47
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Found a solution. Running the command with "-x sh -c" as opposed to "-e" executes the function without exiting the window. Syntax borrowed from this superuser discussion.
The full function:
gnome-terminal -x sh -c 'ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv; exec bash'
Found a solution. Running the command with "-x sh -c" as opposed to "-e" executes the function without exiting the window. Syntax borrowed from this superuser discussion.
The full function:
gnome-terminal -x sh -c 'ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25 -vcodec libx264 `date +%Y-%m-%d_%H-%M-%S`_BTEVCpcampFormBook.mkv; exec bash'
answered Feb 22 at 3:13
![](https://i.stack.imgur.com/11dMo.jpg?s=32&g=1)
![](https://i.stack.imgur.com/11dMo.jpg?s=32&g=1)
BTEVC
214
214
1
As I mentioned in the comment your-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your-r
value. To prevent that remove-r
and replace it with-framerate
, and move it so it is an input option (before the-i
).
â LordNeckbeard
Feb 22 at 18:47
add a comment |Â
1
As I mentioned in the comment your-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your-r
value. To prevent that remove-r
and replace it with-framerate
, and move it so it is an input option (before the-i
).
â LordNeckbeard
Feb 22 at 18:47
1
1
As I mentioned in the comment your
-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your -r
value. To prevent that remove -r
and replace it with -framerate
, and move it so it is an input option (before the -i
).â LordNeckbeard
Feb 22 at 18:47
As I mentioned in the comment your
-r
is incorrect. By coincidence it won't make a difference as is since 25 is the default for x11grab, but if you change it to any other value it will have to perform a frame rate conversion from 25 to your -r
value. To prevent that remove -r
and replace it with -framerate
, and move it so it is an input option (before the -i
).â LordNeckbeard
Feb 22 at 18:47
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1007896%2fhow-to-start-ffmpeg-screen-recording-with-custom-shortcut%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Hi dessert, thanks for the reply. Edited question accordingly.
â BTEVC
Feb 20 at 9:05
1
Updated with release description.
â BTEVC
Feb 20 at 23:07
Don't know anything about the shortcut component of the question, but
ffmpeg -f x11grab -s 1366x768 -i :0.0 -r 25
should beffmpeg -f x11grab -video_size 1366x768 -framerate 25 -i :0.0
. More info: x11grab docs.â LordNeckbeard
Feb 21 at 19:45