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

Michael Niedermayer michael at niedermayer.cc
Mon Sep 12 13:52:47 EEST 2016


On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote:
> 2016-09-12 17:35 GMT+08:00 Steven Liu <lingjiujianke at gmail.com>:
> 
> >
> >
> > 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/_in
> >> dex.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 ??
> >
> 

> update patch, remove the commit message with '-'

The problem was not the commit message, the problem was "\n"
added to long lines of diff (word wrap)

a more verbose commit message would be better than 1 line

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160912/1259c6e3/attachment.sig>


More information about the ffmpeg-devel mailing list