Make mpv hold on the last picture instead of closing












4















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.










share|improve this question



























    4















    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.










    share|improve this question

























      4












      4








      4


      1






      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 5 '17 at 22:04









      studentstudent

      7,1801765127




      7,1801765127






















          2 Answers
          2






          active

          oldest

          votes


















          5














          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)






          share|improve this answer
























          • 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





















          0














          Thanks to derobert for hinting me towards this:



          If you do want to use keep-openbut 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.






          share|improve this answer























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            5














            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)






            share|improve this answer
























            • 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


















            5














            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)






            share|improve this answer
























            • 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
















            5












            5








            5







            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)






            share|improve this answer













            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)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            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





















            • 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















            0














            Thanks to derobert for hinting me towards this:



            If you do want to use keep-openbut 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.






            share|improve this answer




























              0














              Thanks to derobert for hinting me towards this:



              If you do want to use keep-openbut 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.






              share|improve this answer


























                0












                0








                0







                Thanks to derobert for hinting me towards this:



                If you do want to use keep-openbut 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.






                share|improve this answer













                Thanks to derobert for hinting me towards this:



                If you do want to use keep-openbut 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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Feb 15 at 4:28









                CaesarCaesar

                1011




                1011






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

                    is 'sed' thread safe

                    How to make a Squid Proxy server?