<div dir="ltr"><div>Hi Paul,</div>
<div>Thank you, it is exactly what we need.</div>
<div>Andrey.<br><br></div>
<div class="gmail_quote">On Tue, Aug 13, 2013 at 3:40 PM, Paul B Mahol <span dir="ltr"><<a href="mailto:onemda@gmail.com" target="_blank">onemda@gmail.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">On 8/13/13, Andrey Mochenov <<a href="mailto:andrey2067@gmail.com">andrey2067@gmail.com</a>> wrote:<br>> Hi gentlemen,<br>
><br>> We are using FFmpeg libraries git-ee94362 libavformat v55.2.100.<br>> We are trying to write a simple HLS code example based on muxing.c standard<br>> one.<br>> Let be two input streams, video and audio (they can be synthetic, doesn't<br>
> matter).<br>> Our purpose is to mux them into M3U8 playlist using HLS.<br>> Suppose, duration of every TS segment file be 3 sec, and the desirable<br>> maximum number of entries in M3U8 output file be 100.<br>
> From the FFmpeg application sources, one can see that the Apple HTTP Live<br>> Streaming segmenter implemented in hlsenc.c file.<br>> And the relevant options there are, as well: "hls_list_size", "hls_time",<br>
> etc.<br>> The problem is that we have not succeeded to set/get/find these options in<br>> a conventional way, as shown in the following code:<br>><br>> // Here is a part of main() program<br>> int64_t i1 = 0;<br>
> void *target_obj;<br>> AVFormatContext *ofmt_ctx = NULL;<br>> AVOutputFormat *ofmt = NULL;<br>><br>> avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, "Example_Out.m3u8");<br>> ofmt = ofmt_ctx->oformat;<br>
><br>> // The relevant options ("hls_list_size", "hls_time") are located under<br>> ofmt->priv_class->option.<br>> // But AVClass *priv_class is not the first member of the AVOutputFormat.<br>
> // So, due to the documentation, av_opt_find...(), av_opt_get...() and<br>> av_opt_set...()<br>> // cannot be used for options within AVOutputFormat.<br>> // In practice, any of the following three lines causes exception.<br>
> const AVOption *o = av_opt_find2(ofmt, "segment_list_size", NULL,<br>> 0, AV_OPT_SEARCH_CHILDREN, &target_obj);<br>> av_opt_get_int(ofmt, "segment_list_size", AV_OPT_SEARCH_CHILDREN, &i1);<br>
> av_opt_set_int(ofmt, "segment_list_size", 10, AV_OPT_SEARCH_CHILDREN);<br>><br>> Our question: If there is a way to overcome the problem, i.e. to<br>> set/get/find options for AVOutputFormat, like for AVCodecContext (for<br>
> example)?<br><br>Why for AVOutputFormat? Isn't what you need AVFormatContext ?<br>><br>> Thank you,<br>> Andrey Mochenov.<br>><br>_______________________________________________<br>Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br><a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br></blockquote></div><br></div>