<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:10pt;font-family:Gulim,sans-serif"><p><br>In this case, I need the two options "reset_timestamps" and "segment_time".</p></div></blockquote></div><div><br></div><div>reset_timestamps is the option that you have to implement by yourself. Simply subtract the value of the first</div><div>packet DTS /PTS per each stream and you will effectively reset timestamps to zero. </div><div><br></div><div>segment_time is HLS option, and if you want to set these options on the output file use this code:<br><br></div><div>avformat_alloc_output_context2(&ofmt_ctx, NULL, "hls", "output.m3u8");<br></div><div>AVDictionary* headerOptions = NULL;<br></div><div><br></div><div>av_dict_set(&headerOptions, "hls_segment_type", "fmp4", 0);<br></div><div>av_dict_set(&headerOptions, "hls_playlist_type", "event", 0);<br></div><div>av_dict_set(&headerOptions, "hls_flags", "append_list", 0);<br></div><div>av_dict_set_int(&headerOptions, "hls_list_size", hls_list_size, 0);<br>             av_dict_set(&headerOptions, "segment_time_delta", to_string(hls_segment_time_delta), 0);<br>                av_dict_set(&headerOptions, "hls_time", to_string(hls_segment_duration), 0);<br>            av_dict_set(&headerOptions, "hls_fmp4_init_filename", init_segment_name, 0);<br></div><div><br></div><div>avformat_write_header(oc->ofmt_ctx, &headerOptions);<br></div>-- <div><div dir="ltr" class="gmail_signature"><br>Regards<br>Strahinja Radman</div></div></div>