VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. 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.
    Quote Quote  
  2. Use SubtitleCreator, Synchronize, convert frame rate.
    Quote Quote  
  3. 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.
    Quote Quote  
  4. Originally Posted by ProWo View Post
    Use SubtitleCreator, Synchronize, convert frame rate.
    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.

    Originally Posted by jagabo View Post
    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
    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...

    Originally Posted by jagabo View Post
    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.
    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
    It needs mkvextract, mkvmerge, ffmpeg, BeSweet, and aften in your path to work.

    I suppose you could use it to go the other way if you change the framerate settings, although I never tried that.
    Quote Quote  
  5. 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.
    Quote Quote  
  6. Originally Posted by jagabo View Post
    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.
    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 ?

    Originally Posted by Sharc View Post
    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.

    Originally Posted by Sharc View Post
    I have a very old system and can't use 64-bit programs.

    Originally Posted by Sharc View Post
    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.
    Quote Quote  
  7. Originally Posted by Rekrul View Post
    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.
    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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!