Newbie coder - Subtitles !!!
#1
Hi

Apologies if this has been asked (many) times before, but I'm new to XBMC development.

I am re-working a video plugin, and have hit an issue with subtitles.

The plugin downloads the appropriate subtitles for the stream, formats them in .srt format, and all appears fine; except the subtitles never appear.

Before I call player.play(url) (player is set to the xbmc.Player(....)) I call player.setSubtitles(subtitle_file), and I've confirmed that the file exists, is readable and is formatted in .srt.

I think I'm missing something about timing, but I can't work out what.

Can someone point me in the right direction please ?

Thanks

David
Reply
#2
What does xbmc.log say? You should get a message in there about the subtitle.

Incidentally I add the subs after I start playback in my plugin..
Reply
#3
you have to play the file(or url) to be able to set the subtitles for it
Reply
#4
OK - thanks all.

At the moment, I have the set.Subtitles before the play, and I'm getting an error in xbmc.log:

Quote:10:14:00 T:2834783088 M:1895854080 NOTICE: Subtitles before player
10:14:00 T:2834783088 M:1895854080 NOTICE: /home/dlake/.xbmc/userdata/addon_data/plugin.video.itv/Subtitles/itv.srt
10:14:00 T:2834783088 M:1895854080 ERROR: EndOfDirectory - called with an invalid handle.

I'll move the subtitles to after the play and see what happens...

David
Reply
#5
I had to add a slight delay to get it to work right with hulu. i am on my iphone right now and it won't let me copy and paste for some reason. here is a link. it ia at the end.
http://code.google.com/p/bluecop-xbmc-re...am_hulu.py

sorry i am a little drunk. so forgive the coherence. peace
Reply
#6
Argh ! Well, some sort of success...

So, I now have subtitles playing, but ITV in their wisdom have a ITV Player graphic that pops up for 11 seconds. So the subtitles are 11 seconds too early.

Now, I could go through the srt file and add 11 seconds to every timing (horrible job), but I'm sure that there must be a way of adding an 11 second delay ?

I've tried time.sleep(11), but that just delays the display of the subtitles. I want to delay the start of the subtitles.

Sorry for some many dumb-a**e questions. I'm learning fast.

David
Reply
#7
No matter....

I fixed it. It seems that ITV Player has a variable start which is given by the "rendition offset" value in the video detail.

So, I've taken this, and changed my TTAF parser script to add this to every timing so that the .srt file is offset by the value in the "rendition offset."

Now that's done, I need to fix the video title and the associated thumbnail, and we'll have a new ITV Player.
Reply
#8
Well, the subtitles and programme icons now work !

But, I'm trying to work out if I can make the subtitles look a little nicer.

The TTS delivered by ITV (and BBC iPlayer) has formatting (foreground/background colour, text sizing, etc).

Now, I've worked out how to put the foreground colour into the .srt file, but I don't know (and can't find any API documentation) for adding things like the background colour, etc).

Anyone ?

Thanks

David
Reply

Logout Mark Read Team Forum Stats Members Help
Newbie coder - Subtitles !!!0