Make mpv hold on the last picture instead of closing
If I watch a video with mpv, it closes after the video ends. How can I configure it such that it doesn't close, for example just freezes the last image of the movie, so that I can seek back and forth without restarting the video.
mpv
add a comment |
If I watch a video with mpv, it closes after the video ends. How can I configure it such that it doesn't close, for example just freezes the last image of the movie, so that I can seek back and forth without restarting the video.
mpv
add a comment |
If I watch a video with mpv, it closes after the video ends. How can I configure it such that it doesn't close, for example just freezes the last image of the movie, so that I can seek back and forth without restarting the video.
mpv
If I watch a video with mpv, it closes after the video ends. How can I configure it such that it doesn't close, for example just freezes the last image of the movie, so that I can seek back and forth without restarting the video.
mpv
mpv
asked Sep 5 '17 at 22:04
studentstudent
7,1801765127
7,1801765127
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
You'd use mpv --keep-open=yes
, which you can find in the mpv manpage.
It allows three values: no
(close/advance to next at end of video, the default), yes
(advance if there is a next video, otherwise pause), and always
(always pause at end of video, even if there is a next video).
You should also be able to put keep-open=yes
in your ~/.config/mpv/mpv.conf
or ~/.mpv/config
(whichever you're using)
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
1
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
add a comment |
Thanks to derobert for hinting me towards this:
If you do want to use keep-open
but don't want that behavior all the time, I wrote a little script to turn it on just once:
reset_keep_open = false
keep_open_val = nil
function nopause()
print("Not pausing after current")
if keep_open_val ~= nil then
mp.set_property("keep-open", keep_open_val)
end
reset_keep_open = false
end
function pause_after_current()
if reset_keep_open == false then
keep_open_val = mp.get_property("keep-open")
reset_keep_open = true
mp.set_property("keep-open", "always")
print("Pause after current.")
else
nopause()
end
end
function on_pause_change(name, value)
if reset_keep_open then
nopause()
end
end
mp.observe_property("pause", "bool", on_pause_change)
mp.add_key_binding("P", "pause_after_current", pause_after_current)
(Goes into ~/.config/mpv/scripts/pauseaftercurrent.lua
)
However, I could have made my life a lot easier by just putting
P cycle keep-open up
into my input.conf
.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f390574%2fmake-mpv-hold-on-the-last-picture-instead-of-closing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
You'd use mpv --keep-open=yes
, which you can find in the mpv manpage.
It allows three values: no
(close/advance to next at end of video, the default), yes
(advance if there is a next video, otherwise pause), and always
(always pause at end of video, even if there is a next video).
You should also be able to put keep-open=yes
in your ~/.config/mpv/mpv.conf
or ~/.mpv/config
(whichever you're using)
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
1
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
add a comment |
You'd use mpv --keep-open=yes
, which you can find in the mpv manpage.
It allows three values: no
(close/advance to next at end of video, the default), yes
(advance if there is a next video, otherwise pause), and always
(always pause at end of video, even if there is a next video).
You should also be able to put keep-open=yes
in your ~/.config/mpv/mpv.conf
or ~/.mpv/config
(whichever you're using)
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
1
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
add a comment |
You'd use mpv --keep-open=yes
, which you can find in the mpv manpage.
It allows three values: no
(close/advance to next at end of video, the default), yes
(advance if there is a next video, otherwise pause), and always
(always pause at end of video, even if there is a next video).
You should also be able to put keep-open=yes
in your ~/.config/mpv/mpv.conf
or ~/.mpv/config
(whichever you're using)
You'd use mpv --keep-open=yes
, which you can find in the mpv manpage.
It allows three values: no
(close/advance to next at end of video, the default), yes
(advance if there is a next video, otherwise pause), and always
(always pause at end of video, even if there is a next video).
You should also be able to put keep-open=yes
in your ~/.config/mpv/mpv.conf
or ~/.mpv/config
(whichever you're using)
answered Sep 5 '17 at 22:45
derobertderobert
74.4k8161216
74.4k8161216
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
1
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
add a comment |
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
1
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
Neat. Can this be changed while the player is running? (I'm looking for a "stop after current song"-option…)
– Caesar
Feb 14 at 8:47
1
1
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
@Caesar I would guess yes, but haven't tested or checked the manpage. mpv allows a lot of options to be changed at runtime via "properties" which can be set by, e.g., Lua scripting. You can also manipulate the playlist via scripting.
– derobert
Feb 14 at 15:06
add a comment |
Thanks to derobert for hinting me towards this:
If you do want to use keep-open
but don't want that behavior all the time, I wrote a little script to turn it on just once:
reset_keep_open = false
keep_open_val = nil
function nopause()
print("Not pausing after current")
if keep_open_val ~= nil then
mp.set_property("keep-open", keep_open_val)
end
reset_keep_open = false
end
function pause_after_current()
if reset_keep_open == false then
keep_open_val = mp.get_property("keep-open")
reset_keep_open = true
mp.set_property("keep-open", "always")
print("Pause after current.")
else
nopause()
end
end
function on_pause_change(name, value)
if reset_keep_open then
nopause()
end
end
mp.observe_property("pause", "bool", on_pause_change)
mp.add_key_binding("P", "pause_after_current", pause_after_current)
(Goes into ~/.config/mpv/scripts/pauseaftercurrent.lua
)
However, I could have made my life a lot easier by just putting
P cycle keep-open up
into my input.conf
.
add a comment |
Thanks to derobert for hinting me towards this:
If you do want to use keep-open
but don't want that behavior all the time, I wrote a little script to turn it on just once:
reset_keep_open = false
keep_open_val = nil
function nopause()
print("Not pausing after current")
if keep_open_val ~= nil then
mp.set_property("keep-open", keep_open_val)
end
reset_keep_open = false
end
function pause_after_current()
if reset_keep_open == false then
keep_open_val = mp.get_property("keep-open")
reset_keep_open = true
mp.set_property("keep-open", "always")
print("Pause after current.")
else
nopause()
end
end
function on_pause_change(name, value)
if reset_keep_open then
nopause()
end
end
mp.observe_property("pause", "bool", on_pause_change)
mp.add_key_binding("P", "pause_after_current", pause_after_current)
(Goes into ~/.config/mpv/scripts/pauseaftercurrent.lua
)
However, I could have made my life a lot easier by just putting
P cycle keep-open up
into my input.conf
.
add a comment |
Thanks to derobert for hinting me towards this:
If you do want to use keep-open
but don't want that behavior all the time, I wrote a little script to turn it on just once:
reset_keep_open = false
keep_open_val = nil
function nopause()
print("Not pausing after current")
if keep_open_val ~= nil then
mp.set_property("keep-open", keep_open_val)
end
reset_keep_open = false
end
function pause_after_current()
if reset_keep_open == false then
keep_open_val = mp.get_property("keep-open")
reset_keep_open = true
mp.set_property("keep-open", "always")
print("Pause after current.")
else
nopause()
end
end
function on_pause_change(name, value)
if reset_keep_open then
nopause()
end
end
mp.observe_property("pause", "bool", on_pause_change)
mp.add_key_binding("P", "pause_after_current", pause_after_current)
(Goes into ~/.config/mpv/scripts/pauseaftercurrent.lua
)
However, I could have made my life a lot easier by just putting
P cycle keep-open up
into my input.conf
.
Thanks to derobert for hinting me towards this:
If you do want to use keep-open
but don't want that behavior all the time, I wrote a little script to turn it on just once:
reset_keep_open = false
keep_open_val = nil
function nopause()
print("Not pausing after current")
if keep_open_val ~= nil then
mp.set_property("keep-open", keep_open_val)
end
reset_keep_open = false
end
function pause_after_current()
if reset_keep_open == false then
keep_open_val = mp.get_property("keep-open")
reset_keep_open = true
mp.set_property("keep-open", "always")
print("Pause after current.")
else
nopause()
end
end
function on_pause_change(name, value)
if reset_keep_open then
nopause()
end
end
mp.observe_property("pause", "bool", on_pause_change)
mp.add_key_binding("P", "pause_after_current", pause_after_current)
(Goes into ~/.config/mpv/scripts/pauseaftercurrent.lua
)
However, I could have made my life a lot easier by just putting
P cycle keep-open up
into my input.conf
.
answered Feb 15 at 4:28
CaesarCaesar
1011
1011
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f390574%2fmake-mpv-hold-on-the-last-picture-instead-of-closing%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown