Req Change Subtitle FPS on the fly
#1
It happens many a times that a video source is 25fps and all available subtitles are 23.976fps. Would it be possible to introduce a feature to change the subtitle fps on the fly?

Having discussed this with Amet who develops the subtitle-addon, I understand that this is something that needs to be natively addressed by the media player / XBMC.

Many thanks!
Reply
#2
well.. In my opinion, the case at hand is absurd itself.. divx movies and the some .srt releases from the net often does not mix. I have discarded this problematic world a long time ago and shifted to pure DVD/Blueray world, with no problems at all, ever.

With SubtitleWorkShop application user is able to tune/fix the fps of the file. This my marking the end/start subtitle to the video playing and then alligning it. Often works, often not.

XBMC has delay/advance feature for Subs. This does not fix the fps differentail ofcource.
Reply
#3
Imo subtitles don't have FPS. They have pts (presentation timestamps) which are unrelated to the fps. If you have problems with subs they just don't fit the movie because of other things (different rip or directors cut vs. something else).
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
#4
(2013-04-12, 12:38)Memphiz Wrote: Imo subtitles don't have FPS. They have pts (presentation timestamps) which are unrelated to the fps. If you have problems with subs they just don't fit the movie because of other things (different rip or directors cut vs. something else).

I might be wrong but here is my finding. Lets take this episode of Smallville as an example
http://www.opensubtitles.org/en/search/s...bid-703007

It can be noted that there are four different versions of subtitles with different FPS listed under the "Uploaded" header.

I can confirm that the 23.976FPS subtitle goes out of sync when played with a 25FPS video, but the subtitle when converted to 25FPS using the "subtitle workshop" software, works fine.

My Educated Guess is that the video player converts the timestamps into a frame reference before displaying the subtitle on screen.

If my understanding is correct, then my feature request is to provide an FPS converter for the subtitles on the fly. Now, since the FPS for a subtitle cannot be automatically detected from the file, the user will require to input the original FPS as well as desired FPS.

Hoping for the best!!
Reply
#5
(2013-04-12, 12:38)Memphiz Wrote: Imo subtitles don't have FPS. They have pts (presentation timestamps) which are unrelated to the fps. If you have problems with subs they just don't fit the movie because of other things (different rip or directors cut vs. something else).

They do indeed. I have a number of srt subtitles that I would love to use, for example, but were made for a specific 25fps scene rip, and will eventually fall out of sync with my own 23.976 rips.

There is no tool I know of that fixes this. It SHOULD logically be as you say, since there's only timestamps for when the subs should fire off in the srts, but they are not. It isn't a problem of director's cut or something else either, even if the length is exactly the same, its the frame rate I suspect that causes things to fall out of sync.
Reply
#6
(2013-04-12, 12:38)Memphiz Wrote: Imo subtitles don't have FPS. They have pts (presentation timestamps) which are unrelated to the fps. If you have problems with subs they just don't fit the movie because of other things (different rip or directors cut vs. something else).

Well, the pts in the subtitles that uses timestamps are wery much depending on the fps, since a line in a 23.976 version of a movie is spoken at a different time in the 25.000 fps version.

(2013-04-12, 21:57)rd1979 Wrote: They do indeed. I have a number of srt subtitles that I would love to use, for example, but were made for a specific 25fps scene rip, and will eventually fall out of sync with my own 23.976 rips.

There is no tool I know of that fixes this.
There is no tool in XBMC, but there is a bunch of tools for changing the fps the subtitle should be used for and adjust other things about the subtitles, I personally prefer Subtitle Workshop (2.51).
Reply
#7
VLC player has this feature, see screenshot below.
This raises my hopes !!

Image
Reply
#8
Two most popular formats (excluding anime scene) are sub (MicroDVD) subtitles = based on video frames and srt (SubRip) = based on timecodes.

There seems to be two problems with "wrong fps subs":

- SUB (MicroDVD) subtitles might be originally made for different fps video file (and no other subs are available)
- Some subtitle tools (and moronic users) converts SUB to SRT blindly assuming wrong fps. This obviously makes timecodes in srt wrong and subtitles starts lagging or coming too soon.

It's not hard to fix those subtitles using some subtitle editing tools and saving them again, but it soon gets really annoying. Big Grin

That's why I have (silently) dreamed that there should be (simple) dialog to do this "fps/timecode" conversion from XBMC gui and save corrected result to (new) subtitle file. Should this be a core function? Probably not. XBMC Subtitles addon or some other addon could perhaps do this?

"Edit existing subtile file -> Change fps -> (some predefined values for source fps and target fps.) -> Save result as a new subtile file"

Yes I know, this sounds so simple when I know that I can't do this myself. Please don't shoot me. Big Grin
Kodi @ Windows Server 2012 R2 | Pulse-Eight USB-CEC Adapter
Reply
#9
I took this up with the add-on wizard and here is what he had to say

http://forum.xbmc.org/showthread.php?tid...pid1394244
Reply
#10
This is a great feature suggestion, imho. I am just wondering how a developer would need to go about it given the way the sub files are constructed (i.e. with times).

Thought:

It most likely has to be done in the XBMC player. XBMC Player allows us to move sound and subtitles forward and back, but not to speed up. If we could speed up/slow down then we could just have some standard presets like 23.976/25 and 25/23.976 for audio and subtitles.

Would any XBMC dev know how difficult it might be to implement an audio and subtitle speed change module in the native player?

Thanks in advance for any ideas! Smile
Reply
#11
Just a suggestion. Consider changing the "subtitles offset" tool after the "sound" button.

It lets you slide forward or backward for max 1 minute to set an offset. This is OK for subtitles at the same speed of the movie.

To grasp it mathematically, this means:

t = timestamp of the subtitle in e.g. the .SRT file
o = offset of the subtitle
t' = t+o or the time the subtitle is actually shown

Actually, if the movie is played at a different rate, there is something like a speed factor. Let's call it "s".

s = speed factor
so a new expression for t' is now:

t' = s*t + o

At a constant speed difference, the subtitles should remain in sync.

However, getting a grip on that speed factor could be tedious, but it is a quite simple problem to solve mathematically, and with the help of an enhanced "subtitle offset" tool. How?

Simply let's calibrate on two places in the movie:
- calibrate for an offset one time and store
- cue the movie for some 15 minutes, calibrate another offset and store

Now it's up to the tool to do some calculations

We have:
t'1 = t1 + o1
t'2 = t2 + o2

offset evolves linearly with play time:

(o - o1) = (t - t1) / (t2 - t1)
o = o1 + (o2 - o1) * (t - t1) / (t2 - t1)

t' = t + o1 + (o2 - o1) * (t - t1) / (t2 - t1)
= (1 + (o2 - o1) / (t2 - t1) )* t +o1 - (o2 - o1) / (t2 - t1) * t1

so the constants "s" and "o" in our equation "t' = s*t + o" are:

s = 1 + (o2 - o1) / (t2 - t1)
o = o1 - (o2 - o1) / (t2 - t1) * t1

Quite a simple solution for a very annoying problem, I thought.
Reply

Logout Mark Read Team Forum Stats Members Help
Change Subtitle FPS on the fly0