[FFmpeg-user] Subtitle Timing: Clock Timestamps vs. Frame Timestamps

Mark Filipak markfilipak.trash at gmail.com
Fri Apr 4 21:09:58 EEST 2025


On 04/04/2025 10.16, jeremie bergeron wrote:
> Hi,
> 
> This is not strictly an FFmpeg question but rather a general video
> processing question regarding when subtitles should be rendered.
> 
> In this discussion, we are debating whether subtitles should be displayed
> based on *clock timestamps* or *frame timestamps (PTS)*.
> Let's say I have a video with those timestamps:
> 
>     -
> 
>     Frame 0: 0 ms
>     -
> 
>     Frame 1: 42 ms
>     -
> 
>     Frame 2: 83 ms

... continues

>     Frame 9: 375 ms

... continues

>     Frame 20: 834 ms

> Now, let's consider a subtitle that starts at *400 ms* and ends at *860 ms*.

Subtitle Edit (https://www.nikse.dk/subtitleedit) has a tool called "Beautify time codes". The tool 
snaps subtitle times to the elapsed-time equivalents of frame PTSes. So your 0:0.400..0:0.860 
subtitle would snap to 0:0.375..0:0.834.

Hope this helps.


More information about the ffmpeg-user mailing list