Solved can xbmc create a playlist of clips of movies
#1
Thumbs Up 
Hi,

I've search the forums and google and am struggling to find if xbmc has the capability to play clips of movies.
A clip being where you can define the start and end of a clip and then create like a playlist of clips.
The idea being that I can have various favourites clips from movies that I can sit back and watch e.g. like a best bits of various movies or another being showing off the best surround sound bits etc.

Is this at all possible?

Thanks,
Reply
#2
You can make bookmarks (wiki), but you can't make a playlist of bookmarks at the moment.
Reply
#3
Hi,

thx for the reply.
The problem with bookmarks you can't define an end point, so it carries on playing from that point to the end of the movie.

What I'd like is to define start and end points, so can play one clip after another.

I'm quite surprised there is no functionality to do this, I would imagine this would be quite a useful feature. You could put together your own favourite scenes from various movies be they action sequences or special effects etc

Is it possible to do this via scripts or plugin? I believe python is the language that can be used to control xbmc. I'm hoping there is a function that can play a clip given a start and end time.
Reply
#4
I'm really struggling with this guys :Huh

Is there no way to play just a portion/section of a movie giving a start time and end time.
I can't seem to find anything on xbmc that allows this to happen which I find hard to believe.

Any help here really appreciated.
Reply
#5
No, you can't currently do this with XBMC as-is.
Reply
#6
Oh yes you can!

Thx Ned for being the only one to take time out and try to help

I can't believe I managed to find this out, after much, much digging around in all 4 corners of the internet, I managed to cobble together bits and bobs.
This for me turned out to be one of those itches that wouldn't be left alone and needed to be scratched. It turns out that other people were querying to do something along the same lines and were struggling.

I almost ditched xbmc as someone had a solution that worked in vlc.
In the end I found some stuff on xbmc python how-to - most of it went over my head, but gave me some pointers.

I will post what I've done here, one noob helping other noobs and helping the xbmc community at large.

I've used keyboard mapping, so when I press 'd' at the home screen it runs a python script which plays scenes/sections from several movies.
(The idea is that anytime somebody wants a demo of surround sound, they just press 'd' and instantly a demo plays of various scenes from various movies!)

(this is for windows)
For the key mapping, create a keyboard.xml file in:
C:\Users\<your user>\AppData\Roaming\XBMC\userdata\keymaps

Add the following key mapping for the home screen which assigns the key 'd' to run the script playdemo.py:
I also have key 'f' to activate the favourites window from the home screen.

Code:
<keymap>
  <Home>
  <keyboard>
      <d>RunScript(C:\Users\<your user>\AppData\Roaming\XBMC\userdata\myscripts\playdemo.py)</d>
      <f>ActivateWindow(Favourites)</f>
    </keyboard>
  </Home>  
</keymap>

In the userdata directory I have created a myscripts folder to keep any python scripts.

Create a playdemo.py file in notepad and enter the following:

Code:
# variables containing movies we want to demo - note the double \\
movie1 = 'D:\\Media\\Movies\\movie1.mkv'
movie2 = 'D:\\Media\\Movies\\movie2.mkv'
movie3 = 'D:\\Media\\Movies\\movie3.mkv'

# tell xbmc to play our file we specified in the above variable
xbmc.Player().play(movie1)
xbmc.Player().seekTime(120)       # time is in seconds, i.e. 2 mins
xbmc.executebuiltin('XBMC.Notification(Information:, Movie 1 demo-scene 1, 3)')   # display notification of scene
xbmc.sleep(10000)  # goto sleep for 10 seconds - this is in milliseconds, or however long you want to play the scene

# play next scene from movie
xbmc.Player().seekTime(1800)       # time is in seconds, i.e. 30 mins
xbmc.executebuiltin('XBMC.Notification(Information:, Movie 1 demo-scene 2, 3)')   # display notification of scene
xbmc.sleep(10000)  # goto sleep for 10 seconds - this is in milliseconds, or however long you want to play the scene, then play next scene


# movie 2
xbmc.Player().play(movie2)
xbmc.Player().seekTime(120)       # time is in seconds, i.e. 2 mins
xbmc.executebuiltin('XBMC.Notification(Information:, Movie 2 demo-scene 1, 3)')   # display notification of scene
xbmc.sleep(10000)  # goto sleep for 10 seconds - this is in milliseconds, or however long you want to play the scene

# play next scene from movie
xbmc.Player().seekTime(1800)       # time is in seconds, i.e. 30 mins
xbmc.executebuiltin('XBMC.Notification(Information:, Movie 2 demo-scene 2, 3)')   # display notification of scene
xbmc.sleep(10000)  # goto sleep for 10 seconds - this is in milliseconds, or however long you want to play the scene, then play next scene

xbmc.executebuiltin('XBMC.Notification(Information:, End Of Demo, )')

xbmc.Player().stop()


Its pretty straightforward, but only when you know what to do!
The python api docs can be quite cryptic for the noob - doesn't really give much info on the arguments to the methods.
Hope this helps others.

If there is a better way of doing the above please let me know as this is my very first attempt and I'm quite new to python.

The only problem is that when it switches between movies (and not between scenes of the same movie), you see the home screen momentarily before the next movie begins, which reduces the experience somewhat. Is there a way to prevent this?
Reply
#7
Ah, nice work around!
Reply
#8
Ned, we could use this in our test suite as well Smile
Reply
#9
Nice work swiftguy !!

I am also very interested in this "bookmark playlist feature" but in my case I will use it to play "songs" from some "shows" that I have in my library.

Just found your topic while researching XBMC ability to do bookmarks and play movies from a specific starting point. Same path as you did… but you got first and figured out the way! Thanks!

Did you manage to go any further? Like transforming it into a full addon/script where you can fill a separete file with the movies and times instead of editing directily the python script?

I’m also a noob in xbmc addon/python/json programming but I can try to help….
Reply
#10
Hi henricos,

I'm glad it helped. Nice to know someone found it useful. Good idea about songs, I was thinking of using it for like glee songs etc.
Haven't thought about turning into a plug-in, I was just grateful I got as far as I did and managed to achieve what I set out to do.
I wasn't working at the time so had time on my hands, but I got a job soon afterwards and haven't really touched xbmc since.
I Just got notified by email as I subscribed to this thread that someone had replied.
But, yes by all means if you'd like to take it further, please go ahead and I've subscribed to the thread or if you start a new thread keep me posted.

I can imagine it would be a very useful feature that many enthusiasts would appreciate.

All the best,
Swiftguy
Reply
#11
I wonder if EDL's could assist with this?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#12
I ran in to this thread while looking for creating a playlist of songs from different DVD's. It would be super helpful if such feature could be added.
Reply
#13
Totally agree -- I just asked a similar question and then happened to stumble across this thread. If anyone else made progress implementing the workaround above, I'd love to hear about it.
Reply

Logout Mark Read Team Forum Stats Members Help
can xbmc create a playlist of clips of movies0