[Libav-user] [libav-user] How use "reset_timestamps" and "segment_time" options

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] [libav-user] How use "reset_timestamps" and "segment_time" options

이현동

Hi. 

 

I'm developing some application using libav.

 

For the details, I download HLS source and save it into mp4.

 

In this case, I need the two options "reset_timestamps" and "segment_time".

 

so,, What do i do for using these options..?

 

Please Help me ..! 


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [libav-user] How use "reset_timestamps" and "segment_time" options

Strahinja Radman


In this case, I need the two options "reset_timestamps" and "segment_time".


reset_timestamps is the option that you have to implement by yourself. Simply subtract the value of the first
packet DTS /PTS per each stream and you will effectively reset timestamps to zero. 

segment_time is HLS option, and if you want to set these options on the output file use this code:

avformat_alloc_output_context2(&ofmt_ctx, NULL, "hls", "output.m3u8");
AVDictionary* headerOptions = NULL;

av_dict_set(&headerOptions, "hls_segment_type", "fmp4", 0);
av_dict_set(&headerOptions, "hls_playlist_type", "event", 0);
av_dict_set(&headerOptions, "hls_flags", "append_list", 0);
av_dict_set_int(&headerOptions, "hls_list_size", hls_list_size, 0);
av_dict_set(&headerOptions, "segment_time_delta", to_string(hls_segment_time_delta), 0);
av_dict_set(&headerOptions, "hls_time", to_string(hls_segment_duration), 0);
av_dict_set(&headerOptions, "hls_fmp4_init_filename", init_segment_name, 0);

avformat_write_header(oc->ofmt_ctx, &headerOptions);
-- 

Regards
Strahinja Radman

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".