LinHES Forums
http://forum.linhes.org/

Play random (music) videos?
http://forum.linhes.org/viewtopic.php?f=17&t=15349
Page 1 of 1

Author:  Tazzytazzy [ Thu May 24, 2007 3:16 pm ]
Post subject:  Play random (music) videos?

I have some music videos. Is there is a way to randomly play them in a folder or a set of folders?

I'm running R5F1. Everything works, just would be neat to have some music video's running for parties and such. Thanks.

Author:  mythedoff [ Thu May 24, 2007 4:26 pm ]
Post subject: 

Although I've only used it to play one avi after one other, you might try in the video manager by selecting a video then the return key. You should see an option to play another file following the current file. Maybe it will work.

Author:  Girkers [ Thu May 24, 2007 10:03 pm ]
Post subject: 

Using that method you have to specify the next file and then you have to specify the next one and the next one and so on.

This would be a nice function though.

Author:  jmckeown2 [ Fri May 25, 2007 7:05 am ]
Post subject: 

I've thought about this in the past, but other projects have kept me from working on it. what's needed is some sort of shuffler to automate mythedoff's suggestion. The "shuffler" can be implemented as anything from a command-line script to a Java GUI to a full-blown myth plugin. I'm a java guy -- YMMV. Here's the outline:

You would need to query the videometadata table for the intid column value for all of your music videos. I would recommend putting all your videos in a particular folder, then your query would be
Code:
select intid from mythconverg.videometadata where filename like '/your/folder/path/%';

copy the int ids into some sort of list or array, and shuffle it. A random shuffle like java's Collections.shuffle, would be fine.
Assuming you have an array called intIds what you need to do looks something like:
Code:
for(int i=0; i<intIds.length; ++i) {
int j = i+1;
if (j == intIds.length) j=0;
update mythconverg.videometadata set childid=intIds[j] where intid=intIds[i];
}

I realize that's not true code. The idea is that each row's childid, gets set to intid of the next video on the shuffled list. After your script/app runs you can start mythvideo and play any of your videos. Mythvideo will then continue to play all your videos in shuffled order until you tell it to stop.

I don't know perl well enough to implement this as a script. And I think a java implementation would be overblown, (and require the MySQL JDBC Connector) Anyone got some mad perl skills?

Author:  Girkers [ Sun May 27, 2007 8:11 pm ]
Post subject: 

Whilst keeping all your music vids in one folder is something that I do, some people might like to keep them listed by artist and that sort of thing. What would probably be more robust would be to query the mythconverg DB for all videos listed as music videos, that way they can be stored where ever the user likes.

Author:  jmckeown2 [ Mon May 28, 2007 11:14 am ]
Post subject: 

I wasn't suggesting dumping all the music videos into a SINGLE folder, although I see how it reads that way. More specifically I was suggesting structuring all music videos under a single parent folder, for example:
/myth/videos/music/artist1/...
/myth/videos/music/artist2/...

With your idea how do music videos get listed as music videos instead of non-music videos? by category? The select for that would still be pretty basic:
Code:
select a.intid
from
    mythconverg.videometadata a,
    mythconverg.videocategory b
where
    a.category=b.intid and
    b.category='Music Video'


I think both implementations would work equally well, wouldn't call either implementation more or less robust than the other. (IMO managing categories in VideoManager is a royal PITA, whereas directories are a bit easier) What I think would add robustness to either implementation is if the videometadata rating or userrating columns were brought in so that you could shuffle at or below a certain rating; For grown-up parties versus family parties for instance.

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/