Search code examples
ffmpegvideo-streaminglibavcodeclibavlibavformat

How to set start time for video(HLS) segment


I`m using FFmpeg muxing.c example

My generated .ts files have start time: 0.000000 if I run

 av_dump_format(oc, 0, filename, 1);

How to set this value for output conteiner?


Solution

  • As I found out start time is deduced from pts of first frame of the stream

    So in case of muxing.c example

    ost->frame->pts = <your offset> + ost->next_pts++