Mpv: play videos from folder, one after another on pressing a key

Created on 19 Sep 2016  ·  7Comments  ·  Source: mpv-player/mpv

mpv git-b1893d2 (C) 2000-2015 mpv/MPlayer/mplayer2 projects
built on Sun Nov 8 16:37:08 UTC 2015
ffmpeg library versions:
libavutil 54.31.100
libavcodec 56.60.100
libavformat 56.40.101
libswscale 3.1.101
libavfilter 5.40.101
libswresample 1.2.101
ffmpeg version: 2.8.7

I have a folder with lot of videos and other files(non video). It is possible i can play the videos one after another sorted as per date/name without need to go to the folder to play next one.

question

Most helpful comment

ls -rt | mpv -playlist - would be a quick and dirty hack that works in any shell

All 7 comments

Put this in a script folder inside mpv's conf folder.

how to sort by data rather than by name

You can't with just mpv and lua.
Try with this version of autoload.lua. Change the SORTBY value at the start to "date".

This looks like a duplicate of #3530 - you can do mpv ./ (assuming a *nix OS) with options in the directory you want to play files in, but if you're on macOS Sierra it doesn't work atm.

The sorting is done by filename, and there might be an option to sort another way.. but something easier might just be to put the dates at the beginning of the filename.

BTW, what about mpv *? (Works in Windows, for example..)

Some shells support glogging with sorting by e.g. date, I think. But don't ask me.

For such advanced uses write a script.

ls -rt | mpv -playlist - would be a quick and dirty hack that works in any shell

Was this page helpful?
0 / 5 - 0 ratings