SubtitleEdit / subtitleedit

the subtitle editor :)
http://www.nikse.dk/SubtitleEdit/Help
GNU General Public License v3.0
8.89k stars 915 forks source link

Convert to/from SMTPE timing? #8926

Open darnn opened 1 month ago

darnn commented 1 month ago

I never found myself needing to do this, but now that I have, I can't seem to find a way to actually do it: I have a subtitle file that's in SMTPE timing. I need to convert it to, uh, whatever the normal form of timing is called. That is, right now, when I view the subtitles with "SMTPE timing" checked in the Video menu, they appear at the right times. I want a file where they would appear at the same times but with "SMTPE timing" unchecked. Specifically, I need to produce an ASS file to created burned in subtitles, but outside of Subtitle Edit, everything treats the ASS file as if it is non-SMTPE timing, and so doesn't display the subtitles at the right time. Also, in Generate video with burned-in subtitles, there's no option to use SMTPE timing either, so I can't do it through there.

niksedk commented 1 month ago

Sync - Chang speed in percent has this:

image

darnn commented 1 month ago

This doesn't seem to work the same way as ticking SMPTE timing. For instance, in my ASS file, I have this line: Dialogue: 0,1:22:28.88,1:22:30.38,Default,,0,0,0,,I thought I'd sell them. In SE, this corresponds to video positions 01:22:28:21 and 01:22:30:09 (with SMPTE timing ticked). If I go to 01:22:28:21 and untick SMPTE timing, the video position is now 01:22:33:20. If I go to 01:22:30:09 and untick SMPTE timing, the position is now 01:22:35:08.

If I then use Adjust speed in percent, the same subtitle now looks like: Dialogue: 0,1:22:28.33,1:22:29.83 In SE, with SMPTE timing unticked, it runs between 01:22:28:08 and 01:22:29:20. With SMPTE ticked, it runs between 01:22:28:08 and 01:22:29:20. (Whereas it should be 01:22:33:20-01:22:35:08 with SMPTE unticked.)

darnn commented 1 month ago

After messing around in ChatGPT for a good while, it gave me this, which does perform the conversion correctly, if it helps: sub2.py.txt And this is what it gave me when I asked to convert it to C#, though I haven't tested it: sub2.cs.txt