mpv icon indicating copy to clipboard operation
mpv copied to clipboard

mpv closes on the last frame, instead of letting it be seen

Open FernandoMMuniz opened this issue 2 months ago • 4 comments

mpv Information

mpv v0.40.0-dirty Copyright © 2000-2025 mpv/MPlayer/mplayer2 projects
libplacebo version: v7.349.0 (v7.349.0)
FFmpeg version: n8.0
FFmpeg library versions:
   libavcodec      62.11.100
   libavdevice     62.1.100
   libavfilter     11.4.100
   libavformat     62.3.100
   libavutil       60.8.100
   libswresample   6.1.100
   libswscale      9.1.100

Other Information

- Linux version: Arch Linux
- Kernel Version: 6.17.3-arch2-1
- GPU Model: Graphics Processor 1: Intel® Iris® Xe Graphics - Graphics Processor 2: NVIDIA GeForce GTX 1650
- Mesa/GPU Driver Version: mesa-1:25.2.5-3
- Window Manager and Version: KDE Plasma Version: 6.4.5
- Source of mpv: Flatpak
- Latest known working version: 
- Issue started after the following happened:

Reproduction Steps

1- Have a video with a very noticeable last frame. 2- Skip to the ending, then use [>.] key to navigate frame-by-frame to see that frame.

Expected Behavior

Being able to see that frame. Even better if pressing forwards frame-by-frame with the [>.] key to go one a frame beyond the last frame wouldn't close MPV.

Actual Behavior

If you reach the last frame of a video by going frame-by-frame with the [>.] key, MVP will close as if you were watching the video.

It affects other players: https://bugs.kde.org/show_bug.cgi?id=497841#c7

Log File

output.txt

Sample Files

No response

I carefully read all instruction and confirm that I did the following:

  • [x] I tested with the latest mpv version to validate that the issue is not already fixed.
  • [x] I provided all required information including system and mpv version.
  • [x] I produced the log file with the exact same set of files, parameters, and conditions used in "Reproduction Steps", with the addition of --log-file=output.txt.
  • [x] I produced the log file while the behaviors described in "Actual Behavior" were actively observed.
  • [x] I attached the full, untruncated log file.
  • [x] I attached the backtrace in the case of a crash.

FernandoMMuniz avatar Oct 20 '25 20:10 FernandoMMuniz

https://mpv.io/manual/master/#options-keep-open

llyyr avatar Oct 20 '25 20:10 llyyr

could try this script seekend.lua


local msg = require 'mp.msg'


local function seekToEnd()
    local duration = mp.get_property_number("duration")
    if not duration then
        mp.osd_message("Duration not available")
        return
    end

    mp.commandv("playlist-clear")

    local end_time = duration - 0.001
    mp.commandv("seek", end_time, "absolute")
    mp.set_property("pause", "yes")

    mp.osd_message(string.format("Seeked to end: %.3fs", end_time))
end

mp.add_key_binding(nil, "seek-to-end", seekToEnd)

input.conf

HOME  set pause yes ; osd-msg-bar seek 0 absolute-percent+exact  #! Playback > Seek > Skip to Media Start
END  script-binding seek-to-end   #! Playback > Seek > Skip to End (clears playlist)

mrfragger avatar Oct 21 '25 02:10 mrfragger

Did you try https://mpv.io/manual/master/#options-keep-open?

Keith94 avatar Nov 20 '25 14:11 Keith94

"Do not terminate when playing or seeking beyond the end of the file" "When trying to seek beyond end of the file"

That's not what I'm trying to do. I'm trying to go frame-by-frame into the last frame to see it, but the last frame improperly triggers the end of the video.

What comes after the last frame should be the trigger for the end of the video, not the last frame itself.

FernandoMMuniz avatar Nov 20 '25 16:11 FernandoMMuniz