Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to do this?

I want to run VLC in fullscreen mode with an autoloaded playlist. The playlist would be a folder, say /home/user/videos

During the day I want to upload some movies to the computer running VLC with this playlist. I upload a movie to /home/user/videos

Now I need to reload/restart VLC for the changes to take affect in the playlist.

Is there a way to refresh the playlist without restarting VLC? Maybe let it check for new files every X minutes or something?

share|improve this question
    
Have you found a solution for that? –  hupseb Jan 21 at 11:13
    
@hupseb Not yet, but the project has been on a pause, and I am about to start it again in 2 weeks. I will let you know if I find a solution for this - if you do in the meantime, please let me know :) –  Bolli Jan 22 at 2:10
    
Got that one here... youtube.com/watch?v=Kim5QM0nKfQ but it requires to reopen vlc. –  hupseb Jan 22 at 17:12
    
@hupseb I have posted my solution below. Did you find any solution? –  Bolli Mar 20 at 10:05

1 Answer 1

up vote 0 down vote accepted

I first looked into the possibilities of writing a VLC LUA extentionen, and this seams very possible.

I looked at this extension : http://addons.videolan.org/CONTENT/content-files/140699-addsimilar.lua

Which has all the functionality we need. So modifying it heavily would properly work, but it seamed as too much work for this project.

So I googled some more and stumbled upon this site: http://www.cenolan.com/2013/03/looping-video-playlist-omxplayer-raspberry-pi/

It turns out that this bash script can easily be modified to use VLC or cvlc.

So I did and the result looks like this:

#!/bin/sh

# get rid of the cursor so we don't see it when videos are running
setterm -cursor off

#Time 
TIME=$(date +%H)

# set here the path to the directory containing your videos
VIDEOPATH="/home/user/videos" 

# you can normally leave this alone
SERVICE="cvlc"

# now for our infinite loop!
while true; do
        if ps ax | grep -v grep | grep $SERVICE > /dev/null
        then
        sleep 0;
else
        for entry in $VIDEOPATH/* # You could add .mkv to the end of this or any other file extention, to only play specific extentions
        do
             cvlc --play-and-exit --no-video-title -f "$entry" > /dev/null

        done

fi
done

The reason I need this functionality is for a kiosk video screen like project, where videos are uploaded and deleted at all times.

One con about this solution is that VLC still need to open and close after playing each video, which it does using this script. So the PC running the script, need to have a blank desktop (GUI removed) and a black background. This way you will only see about 0.5 - 1 sec black screen in between each video clip.

The script is still work in progress, since I will be adding some more features to it, so if you find it useful and want my final script, leave a comment and I will update the answer.

If you have a better solution or even a LUA solution, please post it - and I will accept the answer - but for now this works for my project.

Cheers

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.