A while back, I wanted to convert some 25FPS subtitles in IDX/SUB format to 23.976FPS. I was able to do it with VobSub Cutter, but I had to manually load and save each one.
I did find one other program that would let me adjust the FPS timing, and it could be controlled from the command line, but it would only work on a single subtitle stream from the set, stripping out all the others. Turns out that there aren't very many tools for working with IDX/SUB files.
Since the IDX file is actually in plain text format and contains all the timings for the subtitles, it should be possible to write a script to read in each line of the file, modify the timestamps and then write it back out.
Unfortunately, I'm really bad at math and don't have the first clue what the formula would need to be to modify the timestamps on a sliding scale so that the timing comes out right for the target framerate.
Does anyone know of such a formula that can convert timestamps between 25FPS and 23.976FPS?
And if I had the formula to convert the other way and between other common FPS rates, I could make it optionally convert between all of them, Which I imagine others might find useful.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 8 of 8
Thread
-
-
NSTC sub time to PAL sub time, multiply by: (24000 / 1001) / 25000 = 0.95904095904095904095904095904096
PAL sub time to NTSC sub time, multiply by: 25000 / (24000 / 1001) = 1.0427083333333333333333333333333
But you're going to find that it's rarely that simple. Releases in different countries often have other differences like longer/shorter studio/distributor logos at the start, different cuts of the movie (added/deleted shots), other speedups to fit broadcast requirements (make room for ads), etc.Last edited by jagabo; 8th Sep 2022 at 09:49.
-
SubtitleCreator only lets you work on one stream out of the IDX/SUB files. You can't convert the times of all the different streams at once.
So basically just divide the existing framerate by the target framerate. Thank you.
Now I just have to figure out a good way to apply this to timestamps...
Well, the subs were synced to a PAL video. I split the audio and video into separate files, then I altered the framerate flag on the video stream to display at 23.976. Next, I converted the audio to the new length using BeSweet and Aften, and then merged the audio and video back together. I made all of this into a batch script so that I could convert a whole directory of files unattended. I then changed the subs manually one at a time with VobSub Cutter.
Since both the videos and the subs had their framerates changed, they still matched after the changes.
Of course figuring out how to do all of this took me several days, a couple posts here asking for help and a lot of experimentation. I ended up having to convert the audio to AC3 because absolutely nothing will reliably work with AAC audio. It either ends up cut off, or programs report an error when trying to deal with it.
If you're curious, here's my script for converting MKV files from PAL to NTSC;
Code:@echo off if not exist Originals md Originals for %%F in (*.mkv) do ( set Name=%%~nF call :Process ) goto End :Process mkvextract tracks %Name%.mkv 0:video.264 ffmpeg -i %Name%.mkv audio.ac3 BeSweet -core( -input "audio.ac3" -output "audio-new.ac3" ) -azid( ) -ota( -r 25000 23976 ) -bsn( -exe aften.exe ) mkvmerge.exe --default-duration 0:23.976fps --fix-bitstream-timing-information 0 video.264 audio-new.ac3 -o %Name%-Fixed.mkv move %Name%.mkv Originals\ del video.264 audio.ac3 audio-new.ac3 exit /b :End
I suppose you could use it to go the other way if you change the framerate settings, although I never tried that. -
I see. I thought you were trying to get some random PAL subs to match your NTSC videos. Since you're starting with video and subs that are in sycn and changing the timing of both you should have no problems.
-
Did you try
https://www.videohelp.com/software/BDSup2Sub
Newer fork
https://github.com/captainayy/BDSup2SubPlusPlus
or take a look here
https://www.videohelp.com/software/sections/subtitle -
Just out of curiosity, how did you get the "(24000 / 1001)" portion of the formula? I realize that it equates to 23.976, but I don't understand where those two numbers came from.
Also, 24000 / 1001 equals 23.796, so 25000 / 23.076 = 1042.7093760427093760427093760427
Shouldn't it be 25 / (24000 / 1001) = 1.0427093760427093760427093760427 ?
Yes. When you go to save the modified file, it asks you to choose a stream and then only saves that one stream. Meaning that you can't change the timing of all the languages in the file at once.
I have a very old system and can't use 64-bit programs.
Most programs don't work with IDX/SUB filss, and if they do, they can't be controlled from the command line. I wanted something that I could use in a script so that I wouldn't have to manually load and save each one separately. VobSub Cutter can be called from the command line, but there's no parameter to change the framerate. -
It's derived from the definition of color NTSC television. The field rate is defined as 60000 / 1001 fields per second (black and white TV was originally exactly 60 fields per second but for technical reasons it was changed for color TV). It takes two fields to complete a full frame, 30000 / 1001 frames per second. When 24 fps film is telecined for TV it is slowed down to 24000 / 1001 frames per second and "3:2 pulldown" is applied (duplicate fields). 59.94, 29.97, and 23.976 are all approximations, rounded values.
Similar Threads
-
ffmpeg formula to convert any format to x264 video mp3 audio reencoding
By jraju in forum Newbie / General discussionsReplies: 15Last Post: 28th Jan 2021, 00:04 -
the following formula not only removes logo, but also subtitle in logo area
By jraju in forum Newbie / General discussionsReplies: 33Last Post: 21st Jul 2020, 00:43 -
SMPTE colorbar generation formula
By colibri in forum Newbie / General discussionsReplies: 27Last Post: 23rd Dec 2019, 22:18 -
[from 50fps to 25fps] vs [directly 25fps]
By dira in forum Video ConversionReplies: 1Last Post: 6th Dec 2019, 04:48 -
HELP!!! SubtitleEdit, Adobe Encore CS6, possible formula for off-sync fix?
By meatboy in forum SubtitleReplies: 0Last Post: 24th Feb 2018, 10:47