FAQ  •  Register  •  Login

Custom Random Playlists

<<

cybersaga

Serviio newbie

Posts: 5

Joined: Wed Jul 06, 2016 3:55 am

Post Wed Jul 06, 2016 4:11 am

Custom Random Playlists

I thought I'd share something I setup. I wanted random video playlists, which isn't supported out of the box in Serviio right now. So I setup something to do it for me. This will work for audio too.

I ended up writing a pretty basic program (Windows-only, .NET 4 required) to read all the files in a folder and put them all in random order into an m3u playlist file. Then I setup a scheduled task in Windows to run that every hour.

For anyone else wanting to set this up, I put the little program on GitHub. The exe can be downloaded here: https://github.com/gabeluci/Random-Play ... ses/latest

In its simplest form, you run this:
  Code:
Random.Playlist.exe [folder with files]


So for example, in my case I run (Yes, this is mainly for the kids):
  Code:
Random.Playlist.exe "K:\Video\Baby Einstein"


That creates the file "K:\Video\Baby Einstein\Random Baby Einstein.m3u" with all the media files inside that folder listed. It will only include audio OR video files, but not both.

There are more options. For example, you can include several folders and search all subfolders. Here are all the options:
  Code:
Random.Playlist.exe [-d folder1 folder2] [-p playlistName] [-r] [-t audio|video]
                    [-m maxLength] [-x types] [-i types] [-h]

  -d    A list of folders to include, separated by spaces.
        If this is not included, the current folder is used.
  -p    The name of the playlist file. If not specified,
        the playlist will be named after the first folder being searched,
        preceded by the word Random. e.g. Random Music.m3u
  -r    Recurse subfolders.
  -t    Specify whether to look for audio or video files. If not specified,
        the first file found will determine if it looks for audio or video
        files. e.g. If it comes across an audio file first, then only audio
        files will be included.
  -m    Limit the playlist to this many files.
  -x    A list of file extensions to exclude, separated by semicolons.
        e.g. -x m4a;wav
  -i    A list of file extensions to include, separated by semicolons.
        All other files will be ignored. e.g. -i mp3;m4a
  -h    Show this help screen


Set that up as a scheduled task in Windows to run, say, every hour, and Serviio will pick up the changes when they happen.

If you want to create multiple playlists, it's simpler to create a batch file and list each one:
  Code:
Random.Playlist.exe "K:\Video\Baby Einstein"
Random.Playlist.exe "K:\Video\Signing TIme"
Random.Playlist.exe "K:\Video\Octonauts"


Then set up the scheduled task to run that batch file.

I hope this helps someone! I tried a *ton* of different DLNA server software, and Serviio fit my needs the best. This was the only feature I wanted that Serviio didn't have.
Last edited by cybersaga on Mon Jul 25, 2016 1:25 pm, edited 3 times in total.
<<

jhb50

DLNA master

Posts: 2854

Joined: Thu Jun 30, 2011 9:32 pm

Post Wed Jul 06, 2016 1:46 pm

Re: Random Video Playlists

Great Idea. You should repost this in the 3rd Party Tools Integration section as a [TOOL], or send zip a note and ask him to move it, so it does not get lost in this support section. I'm thinking this could also be used for music and image playlists and would be very popular for random songs and random slideshows.
<<

cybersaga

Serviio newbie

Posts: 5

Joined: Wed Jul 06, 2016 3:55 am

Post Wed Jul 06, 2016 2:25 pm

Re: Random Video Playlists

Thanks, I sent him a note. I didn't notice that forum when I posted. Maybe I just didn't scroll down far enough :)

I'm thinking of developing this further into a general purpose command line playlist generator. I had done some searching, and I couldn't find any out there. There were several playlist generators with GUI's but nothing command line that I could setup as a scheduled task.

Right now it just dumps the file names into the m3u file, but later I might add the extended information (the "EXTM3U" and "EXTINF" lines). Serviio doesn't seem to care, but other programs might.
<<

cybersaga

Serviio newbie

Posts: 5

Joined: Wed Jul 06, 2016 3:55 am

Post Fri Jul 08, 2016 2:25 am

Re: Random Video Playlists

Turns out that it does work great with music files, and it's a good workaround for an existing problem between Serviio and Sony devices. See here: viewtopic.php?f=11&t=22190
<<

Tedward

Serviio newbie

Posts: 3

Joined: Wed Dec 21, 2016 10:54 pm

Location: Los Angeles, CA, USA

Post Wed Dec 21, 2016 10:55 pm

Re: Custom Random Playlists

Thanks! I have been looking for a way to do this, it works perfectly! :D
<<

DenyAll

DLNA master

Posts: 1994

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Fri Dec 23, 2016 3:23 pm

Re: Custom Random Playlists

Agree, nice app that works perfectly. I've come across it just in time to randomise about a gig's worth of Christmas carols/songs ready to drive the family crazy :lol:
DenyAll
Panasonic Viera CS610A | Panasonic Viera V20A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 7 | Serviio 1.8 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

cybersaga

Serviio newbie

Posts: 5

Joined: Wed Jul 06, 2016 3:55 am

Post Fri Dec 23, 2016 3:31 pm

Re: Custom Random Playlists

My condolences to your family. :)

Return to Third-party tools integration

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.