mpv icon indicating copy to clipboard operation
mpv copied to clipboard

How to loop a video to a specified duration

Open ZreXoc opened this issue 1 year ago • 1 comments

I'm using mpvpaper and some wallpapers download from wallpaper engine. However, some of them are too short (like 15s) and I want to loop them to at least 30min. I can't simply use --loop-file=N (issue 10562) since the length of each video is uncertain.

Is there some way to loop a video to a specified duration, and what about a picture?

(I write a script and it works for video, but I wonder if there is a better way without script :) )

ZreXoc avatar Jan 27 '24 05:01 ZreXoc

Currently there's no way to do this without a lua script. However, if your script works, I don't see an issue.

Do note that the duration field can be iffy as not every file exposes it. You can work around this if it's not present by seeking to the end of the file (such as seeking to 9999:99:99) and then getting the property playback-time.

Traneptora avatar Feb 01 '24 02:02 Traneptora