[FFmpeg-devel] HLS Segmenter and the "hls_time" option

Steven Liu lingjiujianke at gmail.com
Fri Aug 26 05:24:45 EEST 2016


2016-08-26 10:10 GMT+08:00 Ibrahim Tachijian <barhom at netsat.se>:

> yes that is correct Steven.
>
> On Fri, Aug 26, 2016 at 3:41 AM Steven Liu <lingjiujianke at gmail.com>
> wrote:
>
> > 2016-08-26 8:17 GMT+08:00 Ibrahim Tachijian <barhom at netsat.se>:
> >
> > > Steven, I am not sure you understood me correctly or perhaps I did not
> > > explain myself optimally.
> > >
> > > We still want to split by keyframe in a normal fashion. But, for
> example,
> > > would like the first 5 segments to have an "hls_time" of 1s and the
> rest
> > of
> > > the segments after the first 5 to have an "hls_time" of 5s.
> > >
> > > An made up option would be (hls_time_initial Seconds,Number)
> > >
> > >    - "-hls_time_initial 1,5 -hls_time 5"
> > >
> > > The output playlist would contain segments (split at keyframes) 5
> > segments
> > > of length 1s and then any segment after the initial 5 segment would be
> > 5s.
> > >
> > > Is it clear what I am trying to explain?
> > >
> > > What do you think? Do you know how this can be achieved?
> > >
> > > Thanks,
> > >
> > > On Fri, Aug 26, 2016 at 2:06 AM Steven Liu <lingjiujianke at gmail.com>
> > > wrote:
> > >
> > > > 2016-08-26 7:39 GMT+08:00 Ibrahim Tachijian <barhom at netsat.se>:
> > > >
> > > > > Hello,
> > > > >
> > > > > I've been thinking about an option for "hls_time" that is not
> > currently
> > > > > supported by FFMpeg and I would like feedback to if some of you may
> > > think
> > > > > this is useful or utterly unnecessary.
> > > > >
> > > > > I find scenarios where we sometimes want to create an HLS output
> and
> > > > would
> > > > > like the *first couple of segments* to be shorter than the *rest of
> > the
> > > > > segments.*
> > > > >
> > > > > For example starting off with 1s segments up to N segments then
> > switch
> > > to
> > > > > 5s segments.
> > > > >
> > > > > The reasoning is simply to have the playlist.m3u8 and first segment
> > > > > available *asap.*
> > > > >
> > > > > What do you think? Do you know how this can be achieved?
> > > > >
> > > > > Thanks,
> > > > >
> > > >
> > > > ffmpeg split segment use hlsenc by keyframe, if you want to split
> > segment
> > > > *ASAP*,
> > > > you can try set your streaming *GOP(Group Of Picture)* shorter,
> > > > for example: gop_size = 60,  c->time_base = (AVRational){1,60};
> > > > in command line : -r:v 60 -g 60
> > > >
> > > > if can accept split segment at non-keyframe, you can use hls_time and
> > > > hls_flags split_by_time.
> > > > _______________________________________________
> > >
> > you mean:
> >
> > segment-0.ts,segment-1.ts,segment-2.ts,segment-3.ts,segment-4.ts  these
> 5
> > segments duration is 1s
> > and
> > segment-5.ts,segment-6.ts,segment-7.ts ...... these segment duration is
> 5
> > or set by hls_time
> > Is that right i understand?
>
>
OK , Thanks.
That a good idea, but i have a question:
when ffmpeg update the segment list after 10 segments, there have a new
user to play the hls playlist, the m3u8 segments every ts segments'
duration is the 5s.
So do you want exec a new ffmpeg when every one play the hls playlist ?


More information about the ffmpeg-devel mailing list