moving in subtitle stream in case subtitles come early & late randomly
#1
hi ,
i have a video whose subtitles are unsynced . Sometimes they come early & sometimes late in relation to audio . The issue is not difference in frame rate etc. , just the subtitle file is badly formed .
In mplayer , we had yg functionality .
As a character speaks you press y to see next dialogue , in case the dialogue is destined to appear late.
If a string of subtitles come quickly then you can press g to go to previous subtitle .

This will be useful .
Thank You.
Reply
#2
hi people ,
Can anybody guide me on way to accomplish above .
Where do I get started ?
Reply
#3
http://kodi.wiki/view/Subtitles#Settings_details
With subtitle offset you can show the subtitles earlier or later how much you want from 0 to 60 seconds
Reply
#4
yes , i have done that . Also , there is way to advance or delay subtitles while video is running . Say a subtitle file is badly formed then it is slightly more inconvenient to do either .
yg functionality would be great .
I know programming in C & general concepts .
Can you suggest where to begin ?
Reply
#5
Look at all the subtitle related methods here:

https://github.com/xbmc/xbmc/blob/master...VDPlayer.h

You would somehow need to add 2 new methods (something like GetNextSubtitlePts and GetPrevSubtitlePts). Those methods need to somehow access the container which has all the fetched subtitles and return the PTS (presentationtimestamp) of the next and previous subtitles.

With that PTS and with the current subtitle delay you can calculate the new subtitle delay for hitting the next or previous subtitle. This delay can be set with this:

https://github.com/xbmc/xbmc/blob/master...yer.h#L250

Then you need to add an action which triggers the "jump to next or prev subtitle" which bascally calls the glue code you need to develop.

Look how the application messenger is working here:

https://github.com/xbmc/xbmc/blob/master...essenger.h

You basically need to add 2 new messages for jump to next and jump to prev.

The glue code would end up in CApplication for now i think and you could call it like g_application.JumpToNextSubtitle() / g_application.JumpToPrevSubtitle() from the ApplicationMessenger.

Last step would be to add 2 builtin functions here:

https://github.com/xbmc/xbmc/blob/master...iltins.cpp

Which call the applicationmessenger. You can then map those builtins to keys through the keymap.

Well this is a rough explenation of one possible approach. I don't say it will work (cause i don't know), nor do i claim that this approach would be accepted from the maintainer of dvdplayer. Its not my area of code really.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#6
thank you .
I will try to follow it .
Reply

Logout Mark Read Team Forum Stats Members Help
moving in subtitle stream in case subtitles come early & late randomly0