Posts: 6
Joined: Mar 2005
Reputation:
0
i'd like to know if there's any chance i can start playing an mms:// stream from within the clip? let's say the clip's duration is 10 minutes then i want it to start playing in the middle.
thanks,
td
Posts: 249
Joined: Feb 2005
Reputation:
0
EnderW
Skilled Python Coder
Posts: 249
i was also looking for this a while back. as far as i know it is not possible now, but it would be very nice if it was added. i believe mplayer has support for this, so perhaps it isn't too much work to add it to the xbmc lib?
xbmcscripts.com administrator
Posts: 363
Joined: Jun 2004
Reputation:
0
hi enderw
i was just browsing trough the mplayer lib source (mplayer.cpp) ,
>cmplayer::openfile(const cfileitem& file, __int64 istarttime)
> // seek to the correct starting position
> if (istarttime) seektime(istarttime);
so it is technicaly possible to get this in phyton.
not sure how much work this can be, because i'm a newbie.
had a look in the phyton libs source.
and it seem that phyton adds the file to a phytonplaylist and then plays it off.there is no start time parameter.
enderw how is your c++
:p
Posts: 363
Joined: Jun 2004
Reputation:
0
i just added the seekcommand(seektime, set start pos in millisecounds) to http source and it worked.
but i had some varius results on seeking in a stream.
anyway if we seek the whole buffer we made at the start will go to waste. so it should be better to make a seek before the data is starting to stream.
tried the seek command for mplayer at a quicktime mov stream, and it worked perfect. video jumps instantly to right pos. but when i tried it with a wmv file it freezes and then plays. and if the seek is very long it hangs the xbox.
so if this is going to be added we need to seek before the stream starts buffering.hehe this is not going to be done by me.no pro here :lol:
Posts: 26,215
Joined: Oct 2003
Reputation:
187
all you need to do is find the source within xbmc that python uses to play the stream. there'll be a call to g_application.playfile() with a cfileitem parameter. you need to add the start position to the cfileitem::m_lstartoffset parameter. this is measured in frames (1/75th of a second). you then just have to devise a way to pass the extra parameter in, and you're home free.
good luck!
Posts: 363
Joined: Jun 2004
Reputation:
0
it sound so easy :p
i have touched c++ two times.
so if i have to do it, i need luck and time.
not going to happen, i think.
------------------------------
i now see what you are talking about.
the phyton play ends up in application.cpp
>bool capplication::playfile
but still, it seems to me like alot of work since the phyton play is passed very many times before it arraives at application.cpp