[FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments

Steven Liu lingjiujianke at gmail.com
Mon Sep 12 12:35:49 EEST 2016


2016-09-12 17:28 GMT+08:00 Michael Niedermayer <michael at niedermayer.cc>:

> On Mon, Sep 12, 2016 at 03:01:24PM +0800, Steven Liu wrote:
> > refine EXT-X-BYTERANGE tag,
> > the spec link:
> > https://tools.ietf.org/html/draft-pantos-http-live-
> streaming-19#section-4.3.2.2
> >
> > the apple doc:
> > https://developer.apple.com/library/ios/technotes/tn2288/_
> index.html#//apple_ref/doc/uid/DTS40012238-CH1-BYTE_
> RANGE_SUPPORT_FOR_SEGMENTS
> >
> > command line:
> > ./ffmpeg -i ~/Movies/objectC/a.mp4 -c copy -f hls -hls_time 7
> > -hls_list_size 100 -hls_segment_size 2500000 -t 40 output-test.m3u8
> >
> > output:
> >
> > localhost:ffmpeg liuqi$ ll *.ts ;cat output-test.m3u8
> > -rw-r--r--  1 liuqi  staff  2792176  9 12 14:44 output-test0.ts
> > -rw-r--r--  1 liuqi  staff  3112528  9 12 14:44 output-test3.ts
> > -rw-r--r--  1 liuqi  staff  3377420  9 12 14:44 output-test6.ts
> > -rw-r--r--  1 liuqi  staff  1228016  9 12 14:44 output-test7.ts
> >  #EXTM3U
> >  #EXT-X-VERSION:4
> >  #EXT-X-TARGETDURATION:10
> >  #EXT-X-MEDIA-SEQUENCE:0
> >  #EXTINF:9.021000,
> >  #EXT-X-BYTERANGE:1334988 at 0
> >  output-test0.ts
> >  #EXTINF:3.000000,
> >  #EXT-X-BYTERANGE:721356 at 1334988
> >  output-test0.ts
> >  #EXTINF:3.000000,
> >  #EXT-X-BYTERANGE:735832 at 2056344
> >  output-test0.ts
> >  #EXTINF:6.000000,
> >  #EXT-X-BYTERANGE:1645940 at 0
> >  output-test3.ts
> >  #EXTINF:3.000000,
> >  #EXT-X-BYTERANGE:715152 at 1645940
> >  output-test3.ts
> >  #EXTINF:3.000000,
> >  #EXT-X-BYTERANGE:751436 at 2361092
> >  output-test3.ts
> >  #EXTINF:9.000000,
> >  #EXT-X-BYTERANGE:3377420 at 0
> >  output-test6.ts
> >  #EXTINF:3.960000,
> >  #EXT-X-BYTERANGE:1228016 at 0
> >  output-test7.ts
> >  #EXT-X-ENDLIST
> >  localhost:ffmpeg liuqi$
> >
> >  ticket-id: #5839
> >
> > Signed-off-by: Steven Liu <lingjiujianke at gmail.com>
> > ---
> >  libavformat/hlsenc.c | 38 +++++++++++++++++++++++++++++++++-----
> >  1 file changed, 33 insertions(+), 5 deletions(-)
> >
> > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> > index a376312..08995f6 100644
> > --- a/libavformat/hlsenc.c
> > +++ b/libavformat/hlsenc.c
> > @@ -104,6 +104,7 @@ typedef struct HLSContext {
> >      double duration;      // last segment duration computed so far, in
> > seconds
> >      int64_t start_pos;    // last segment starting position
> >      int64_t size;         // last segment size
> > +     int64_t max_seg_size; // every segment file max size
> >      int nb_entries;
> >      int discontinuity_set;
> >
>
> fatal: corrupt patch at line 11
> maybe the comment :


 > -rw-r--r--  1 liuqi  staff  2792176  9 12 14:44 output-test0.ts
> -rw-r--r--  1 liuqi  staff  3112528  9 12 14:44 output-test3.ts
> -rw-r--r--  1 liuqi  staff  3377420  9 12 14:44 output-test6.ts
> -rw-r--r--  1 liuqi  staff  1228016  9 12 14:44 output-test7.ts

give the error  for patch ??


More information about the ffmpeg-devel mailing list