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

Steven Liu lingjiujianke at gmail.com
Fri Aug 26 09:00:33 EEST 2016


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

> In my use case scenario I only need it for the very first couple of
> segments.
> After 5 segments it is not a problem anymore to have 5 second segments
> only.
>
>
>
> On Fri, Aug 26, 2016 at 4:25 AM Steven Liu <lingjiujianke at gmail.com>
> wrote:
>
> > 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 ?
>
>
Dose this patch can fix your request?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-option-hls_init_time-to-set-init-hls-window-segm.patch
Type: application/octet-stream
Size: 3381 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160826/a38a466a/attachment.obj>


More information about the ffmpeg-devel mailing list