How can I create an MPlayer playlist with a shell script? [closed]
Asked Answered
B

1

6

I am trying to create a shell script in Linux that when executed searches a directory for all media files then creates a playlist and plays it with MPlayer.

Blackmun answered 8/4, 2012 at 20:51 Comment(4)
When faced with a task like this, typically you will want to break it down into steps. Which part have you done so far? (1) Search a directory for all files. (2) Select the media files from a list of files. (3) Create a playlist file from the list of media files. (4) Start mplayer with the given playlist.Mazer
i Search the directory for the filesBlackmun
not sure how to create the playlist n start mplayerBlackmun
OK I FIGURED IT OUT THANKS ANYWAYSBlackmun
W
15

Use this command :

find /PATH/TO/MUSIC/DIRECTORY/ -type f -iname "*.mp3" > playlist.m3u

Now play with mplayer :

mplayer -playlist playlist.m3u
Wadi answered 9/4, 2012 at 5:32 Comment(1)
add "sort" to the find, otherwise it won't add the playlist in the right order: find /PATH/TO/MUSIC/DIRECTORY/ -type f -iname "*.mp3" | sort > playlist.m3uAngloirish

© 2022 - 2024 — McMap. All rights reserved.