[FFmpeg-user] Sync subtitles with HLS VOD

Tamir Maoz tamir at yokee.tv
Thu Dec 27 14:57:38 EET 2018


Hi,
i'm trying to sync webVTT subtitles with HLS video.
my process:
1. segment the mp4 to 10sec segments
2. repeat step 1 for multiple renditions
* these steps are done by using the script found here:
https://gist.github.com/mrbar42/ae111731906f958b396f30906004b3fa
3. segment the webVTT file and update the master playlist with the
subtitles info.
* using this command: ffmpeg -i SOURCE -f segment -segment_time 10
-segment_format webvtt -scodec copy -segment_list PLAYLISTNAME-sub.m3u8
-segment_list_type m3u8 SEGMENTNAME-%d.vtt

problem: subtitles are not synced with video/audio
cause:
i noticed that my VOD script changes the video start time and my first
segment of the video gets pkt_pts = 133200 , whereas in the original video
it starts with 0.

i'm not sure if
a.i should force my script to set the initial ts to 0 - was not able to
accomplish that
b. add an offset to my VTT files. - seems really strange that i would have
to ffprobe each segmented video for pkt_pts value and then edit my VTT
files accordingly.

what am i missing? is there an easier way to achieve this?
Thanks.


More information about the ffmpeg-user mailing list