Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Mon, Sep 19, 2016 at 07:01:49AM +0800, Steven Liu wrote: > 2016-09-19 0:24 GMT+08:00 Moritz Barsnick : > > > On Sun, Sep 18, 2016 at 23:40:34 +0800, Steven Liu wrote: > > > > > +if (byterange_mode) { > > > +version = 4; > > > +sequence = byterange_mode ? 0 : sequence; > > > > What does the ternary if-then-else operation do here? Two lines above, > > byterange_mode was checked for !=0, how can it be anything else here? > > > > > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename > > template '%s', you can try use -use_localtime 1 with it\n", c->basename); > > > > "try to use" > > > > > +if ((outer_st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) > > && > > > +outer_st->codecpar->bit_rate > hls->max_seg_size) { > > > > Inconsistent use of brackets: The "==" comparison has extra brackets, > > the ">" comparison doesn't. (Or am I missing something with operator > > precedence?) > > > > > +av_log(s, AV_LOG_WARNING, "Your video bitrate is bigger > > than hls_segment_size, " > > > + "%"PRId64 " > %" PRId64" ( video birate > > > hls_segment_size ),the result maybe not you want.", > > > > Apart from the peculiar placement of brackets in the message, I think > > the brackets and their content is not needed, duplicate. > > > > And the sentence should end "the result may not be what you want". > > > > > +if (hls->start_pos >= hls->max_seg_size ) { > > > > Wrong bracket style (whitespace). > > > > > +{"hls_segment_size", "set maximum size per segment file, (in > > bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, > > 0, INT_MAX, E}, > > > > You can actually drop the word "set ", as well as the comma before the > > brackets. > > > > Moritz > > ___ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > hlsenc.c | 49 ++--- > 1 file changed, 46 insertions(+), 3 deletions(-) > 32c8c1dad25c71a089d1ef4c912de46e8b05f17a > 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch > From 3a8731792d681caec8ff49e01b1b175c00b9e1ee Mon Sep 17 00:00:00 2001 > From: Steven Liu > Date: Mon, 19 Sep 2016 07:00:42 +0800 > Subject: [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you drop bombs on a foreign country and kill a hundred thousand innocent people, expect your government to call the consequence "unprovoked inhuman terrorist attacks" and use it to justify dropping more bombs and killing more people. The technology changed, the idea is old. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
ping 2016-09-19 7:01 GMT+08:00 Steven Liu : > > > 2016-09-19 0:24 GMT+08:00 Moritz Barsnick : > >> On Sun, Sep 18, 2016 at 23:40:34 +0800, Steven Liu wrote: >> >> > +if (byterange_mode) { >> > +version = 4; >> > +sequence = byterange_mode ? 0 : sequence; >> >> What does the ternary if-then-else operation do here? Two lines above, >> byterange_mode was checked for !=0, how can it be anything else here? >> >> > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename >> template '%s', you can try use -use_localtime 1 with it\n", c->basename); >> >> "try to use" >> >> > +if ((outer_st->codecpar->codec_type == >> AVMEDIA_TYPE_VIDEO) && >> > +outer_st->codecpar->bit_rate > hls->max_seg_size) { >> >> Inconsistent use of brackets: The "==" comparison has extra brackets, >> the ">" comparison doesn't. (Or am I missing something with operator >> precedence?) >> >> > +av_log(s, AV_LOG_WARNING, "Your video bitrate is >> bigger than hls_segment_size, " >> > + "%"PRId64 " > %" PRId64" ( video birate > >> hls_segment_size ),the result maybe not you want.", >> >> Apart from the peculiar placement of brackets in the message, I think >> the brackets and their content is not needed, duplicate. >> >> And the sentence should end "the result may not be what you want". >> >> > +if (hls->start_pos >= hls->max_seg_size ) { >> >> Wrong bracket style (whitespace). >> >> > +{"hls_segment_size", "set maximum size per segment file, (in >> bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, >> 0, INT_MAX, E}, >> >> You can actually drop the word "set ", as well as the comma before the >> brackets. >> >> Moritz >> ___ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-19 0:24 GMT+08:00 Moritz Barsnick : > On Sun, Sep 18, 2016 at 23:40:34 +0800, Steven Liu wrote: > > > +if (byterange_mode) { > > +version = 4; > > +sequence = byterange_mode ? 0 : sequence; > > What does the ternary if-then-else operation do here? Two lines above, > byterange_mode was checked for !=0, how can it be anything else here? > > > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename > template '%s', you can try use -use_localtime 1 with it\n", c->basename); > > "try to use" > > > +if ((outer_st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) > && > > +outer_st->codecpar->bit_rate > hls->max_seg_size) { > > Inconsistent use of brackets: The "==" comparison has extra brackets, > the ">" comparison doesn't. (Or am I missing something with operator > precedence?) > > > +av_log(s, AV_LOG_WARNING, "Your video bitrate is bigger > than hls_segment_size, " > > + "%"PRId64 " > %" PRId64" ( video birate > > hls_segment_size ),the result maybe not you want.", > > Apart from the peculiar placement of brackets in the message, I think > the brackets and their content is not needed, duplicate. > > And the sentence should end "the result may not be what you want". > > > +if (hls->start_pos >= hls->max_seg_size ) { > > Wrong bracket style (whitespace). > > > +{"hls_segment_size", "set maximum size per segment file, (in > bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, > 0, INT_MAX, E}, > > You can actually drop the word "set ", as well as the comma before the > brackets. > > Moritz > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Sun, Sep 18, 2016 at 23:40:34 +0800, Steven Liu wrote: > +if (byterange_mode) { > +version = 4; > +sequence = byterange_mode ? 0 : sequence; What does the ternary if-then-else operation do here? Two lines above, byterange_mode was checked for !=0, how can it be anything else here? > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename template > '%s', you can try use -use_localtime 1 with it\n", c->basename); "try to use" > +if ((outer_st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && > +outer_st->codecpar->bit_rate > hls->max_seg_size) { Inconsistent use of brackets: The "==" comparison has extra brackets, the ">" comparison doesn't. (Or am I missing something with operator precedence?) > +av_log(s, AV_LOG_WARNING, "Your video bitrate is bigger than > hls_segment_size, " > + "%"PRId64 " > %" PRId64" ( video birate > > hls_segment_size ),the result maybe not you want.", Apart from the peculiar placement of brackets in the message, I think the brackets and their content is not needed, duplicate. And the sentence should end "the result may not be what you want". > +if (hls->start_pos >= hls->max_seg_size ) { Wrong bracket style (whitespace). > +{"hls_segment_size", "set maximum size per segment file, (in bytes)", > OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, > INT_MAX, E}, You can actually drop the word "set ", as well as the comma before the brackets. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-18 7:28 GMT+08:00 Steven Liu : > > > 2016-09-18 1:07 GMT+08:00 Michael Niedermayer : > >> On Sat, Sep 17, 2016 at 01:09:02PM +0800, Steven Liu wrote: >> [...] >> > @@ -867,6 +886,16 @@ static int hls_write_header(AVFormatContext *s) >> > for (i = 0; i < s->nb_streams; i++) { >> > AVStream *inner_st; >> > AVStream *outer_st = s->streams[i]; >> > + >> > +if (hls->max_seg_size > 0) { >> > +if ((outer_st->codecpar->codec_type == >> AVMEDIA_TYPE_VIDEO) && >> > +outer_st->codecpar->bit_rate > hls->max_seg_size) { >> > +av_log(s, AV_LOG_WARNING, "Your video bitrate is >> bigger than hls_segment_size, " >> > + "%lld > %lld ( video birate > hls_segment_size >> ),the result maybe not you want.", >> > + outer_st->codecpar->bit_rate, >> hls->max_seg_size); >> >> %lld is the wrong type for *int64_t >> >> The compiler should produce a warning for this, though probably not >> every copiler does >> please make sure your changes add no warnings >> > > > Hi Michael, > > > Bellow is my compile history before i send the last patch mail, maybe i > need cross complie cross any platform: > > > localhost:xxx StevenLiu$ make > CC libavformat/hlsenc.o > src/libavformat/hlsenc.c:326:14: error: use of undeclared identifier 'st' > if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && > ^ > src/libavformat/hlsenc.c:327:13: error: use of undeclared identifier 'st' > st->codecpar->bit_rate > hls->max_seg_size) { > ^ > src/libavformat/hlsenc.c:330:20: error: use of undeclared identifier 'st' >st->codecpar->bit_rate, hls->max_seg_size); >^ > src/libavformat/hlsenc.c:573:27: warning: absolute value function 'abs' > given an argument of type 'long' but has parameter of type 'int' which may > cause truncation of value [-Wabsolute-value] > tz_min = (abs(wrongsecs - tt) + 30) / 60; > ^ > src/libavformat/hlsenc.c:573:27: note: use function 'labs' instead > tz_min = (abs(wrongsecs - tt) + 30) / 60; > ^~~ > labs > 1 warning and 3 errors generated. > make: *** [libavformat/hlsenc.o] Error 1 > localhost:xxx StevenLiu$ make > CC libavformat/hlsenc.o > src/libavformat/hlsenc.c:564:27: warning: absolute value function 'abs' > given an argument of type 'long' but has parameter of type 'int' which may > cause truncation of value [-Wabsolute-value] > tz_min = (abs(wrongsecs - tt) + 30) / 60; > ^ > src/libavformat/hlsenc.c:564:27: note: use function 'labs' instead > tz_min = (abs(wrongsecs - tt) + 30) / 60; > ^~~ > labs > src/libavformat/hlsenc.c:890:18: error: use of undeclared identifier 'st' > if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && > ^ > src/libavformat/hlsenc.c:891:17: error: use of undeclared identifier 'st' > st->codecpar->bit_rate > hls->max_seg_size) { > ^ > src/libavformat/hlsenc.c:894:24: error: use of undeclared identifier 'st' >st->codecpar->bit_rate, hls->max_seg_size); >^ > 1 warning and 3 errors generated. > make: *** [libavformat/hlsenc.o] Error 1 > localhost:xxx StevenLiu$ > localhost:xxx StevenLiu$ > localhost:xxx StevenLiu$ make > CC libavformat/hlsenc.o > src/libavformat/hlsenc.c:564:27: warning: absolute value function 'abs' > given an argument of type 'long' but has parameter of type 'int' which may > cause truncation of value [-Wabsolute-value] > tz_min = (abs(wrongsecs - tt) + 30) / 60; > ^ > src/libavformat/hlsenc.c:564:27: note: use function 'labs' instead > tz_min = (abs(wrongsecs - tt) + 30) / 60; > ^~~ > labs > 1 warning generated. > AR libavformat/libavformat.a > LD ffmpeg_g > CP ffmpeg > STRIP ffmpeg > LD ffplay_g > CP ffplay > STRIP ffplay > LD ffprobe_g > CP ffprobe > STRIP ffprobe > LD ffserver_g > CP ffserver > STRIP ffserver > localhost:xxx StevenLiu$ > > > patch update, fix warning for complie, from lld to PRId64 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-18 1:07 GMT+08:00 Michael Niedermayer : > On Sat, Sep 17, 2016 at 01:09:02PM +0800, Steven Liu wrote: > [...] > > @@ -867,6 +886,16 @@ static int hls_write_header(AVFormatContext *s) > > for (i = 0; i < s->nb_streams; i++) { > > AVStream *inner_st; > > AVStream *outer_st = s->streams[i]; > > + > > +if (hls->max_seg_size > 0) { > > +if ((outer_st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) > && > > +outer_st->codecpar->bit_rate > hls->max_seg_size) { > > +av_log(s, AV_LOG_WARNING, "Your video bitrate is bigger > than hls_segment_size, " > > + "%lld > %lld ( video birate > hls_segment_size > ),the result maybe not you want.", > > + outer_st->codecpar->bit_rate, hls->max_seg_size); > > %lld is the wrong type for *int64_t > > The compiler should produce a warning for this, though probably not > every copiler does > please make sure your changes add no warnings > Hi Michael, Bellow is my compile history before i send the last patch mail, maybe i need cross complie cross any platform: localhost:xxx StevenLiu$ make CC libavformat/hlsenc.o src/libavformat/hlsenc.c:326:14: error: use of undeclared identifier 'st' if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && ^ src/libavformat/hlsenc.c:327:13: error: use of undeclared identifier 'st' st->codecpar->bit_rate > hls->max_seg_size) { ^ src/libavformat/hlsenc.c:330:20: error: use of undeclared identifier 'st' st->codecpar->bit_rate, hls->max_seg_size); ^ src/libavformat/hlsenc.c:573:27: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] tz_min = (abs(wrongsecs - tt) + 30) / 60; ^ src/libavformat/hlsenc.c:573:27: note: use function 'labs' instead tz_min = (abs(wrongsecs - tt) + 30) / 60; ^~~ labs 1 warning and 3 errors generated. make: *** [libavformat/hlsenc.o] Error 1 localhost:xxx StevenLiu$ make CC libavformat/hlsenc.o src/libavformat/hlsenc.c:564:27: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] tz_min = (abs(wrongsecs - tt) + 30) / 60; ^ src/libavformat/hlsenc.c:564:27: note: use function 'labs' instead tz_min = (abs(wrongsecs - tt) + 30) / 60; ^~~ labs src/libavformat/hlsenc.c:890:18: error: use of undeclared identifier 'st' if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && ^ src/libavformat/hlsenc.c:891:17: error: use of undeclared identifier 'st' st->codecpar->bit_rate > hls->max_seg_size) { ^ src/libavformat/hlsenc.c:894:24: error: use of undeclared identifier 'st' st->codecpar->bit_rate, hls->max_seg_size); ^ 1 warning and 3 errors generated. make: *** [libavformat/hlsenc.o] Error 1 localhost:xxx StevenLiu$ localhost:xxx StevenLiu$ localhost:xxx StevenLiu$ make CC libavformat/hlsenc.o src/libavformat/hlsenc.c:564:27: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] tz_min = (abs(wrongsecs - tt) + 30) / 60; ^ src/libavformat/hlsenc.c:564:27: note: use function 'labs' instead tz_min = (abs(wrongsecs - tt) + 30) / 60; ^~~ labs 1 warning generated. AR libavformat/libavformat.a LD ffmpeg_g CP ffmpeg STRIP ffmpeg LD ffplay_g CP ffplay STRIP ffplay LD ffprobe_g CP ffprobe STRIP ffprobe LD ffserver_g CP ffserver STRIP ffserver localhost:xxx StevenLiu$ ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Sat, Sep 17, 2016 at 01:09:02PM +0800, Steven Liu wrote: [...] > @@ -867,6 +886,16 @@ static int hls_write_header(AVFormatContext *s) > for (i = 0; i < s->nb_streams; i++) { > AVStream *inner_st; > AVStream *outer_st = s->streams[i]; > + > +if (hls->max_seg_size > 0) { > +if ((outer_st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && > +outer_st->codecpar->bit_rate > hls->max_seg_size) { > +av_log(s, AV_LOG_WARNING, "Your video bitrate is bigger than > hls_segment_size, " > + "%lld > %lld ( video birate > hls_segment_size ),the > result maybe not you want.", > + outer_st->codecpar->bit_rate, hls->max_seg_size); %lld is the wrong type for *int64_t The compiler should produce a warning for this, though probably not every copiler does please make sure your changes add no warnings [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-15 20:31 GMT+08:00 Steven Liu : > > > 2016-09-14 6:51 GMT+08:00 Steven Liu : > >> >> >> 2016-09-14 2:53 GMT+08:00 Moritz Barsnick : >> >>> On Tue, Sep 13, 2016 at 11:25:39 +0800, Steven Liu wrote: >>> > +int byterange_mode = hls->flags & (HLS_SINGLE_FILE) || >>> hls->max_seg_size > 0; >>> ^ ^ >>> Why the bracket? >>> >>> > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename >>> template '%s' you can try use -use_localtime 1 with it\n", c->basename); >>> Rather: >>>av_log(oc, AV_LOG_ERROR, "Invalid segment filename >>> template '%s', you can try to use -use_localtime 1 with it\n", c->basename); >>> >>> > +{"hls_segment_size", "set maximum size per segment file, >>> (Byte)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, >>> INT_MAX, E}, >>>{"hls_segment_size", "set maximum size per segment file (in >>> bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, >>> INT_MAX, E}, >>> >>> This isn't a flag, right? Perhaps you shouldn't be putting the option >>> between the flags' lines (but probably still as the final option). >>> >> I shall update patch :-) >> >>> >>> The value of 0 seems to have a special meaning. Is this documented >>> >> I cannot understand "The value of 0 seems to have a special meaning" , >> it will not set value when unuse hls_segment_size, so give it value of 0. >> is that a problem? >> >>> anywhere? In other words: You should also update doc/muxers.texi. (I >>> can help with the grammar of the wording.) >>> >> patch will come soon :-D >> >>> >>> > patch update > > patch update, give a warning message when video bitrate large than hls_segment_size. 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-14 6:51 GMT+08:00 Steven Liu : > > > 2016-09-14 2:53 GMT+08:00 Moritz Barsnick : > >> On Tue, Sep 13, 2016 at 11:25:39 +0800, Steven Liu wrote: >> > +int byterange_mode = hls->flags & (HLS_SINGLE_FILE) || >> hls->max_seg_size > 0; >> ^ ^ >> Why the bracket? >> >> > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename >> template '%s' you can try use -use_localtime 1 with it\n", c->basename); >> Rather: >>av_log(oc, AV_LOG_ERROR, "Invalid segment filename >> template '%s', you can try to use -use_localtime 1 with it\n", c->basename); >> >> > +{"hls_segment_size", "set maximum size per segment file, (Byte)", >> OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E}, >>{"hls_segment_size", "set maximum size per segment file (in >> bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, >> INT_MAX, E}, >> >> This isn't a flag, right? Perhaps you shouldn't be putting the option >> between the flags' lines (but probably still as the final option). >> > I shall update patch :-) > >> >> The value of 0 seems to have a special meaning. Is this documented >> > I cannot understand "The value of 0 seems to have a special meaning" , > it will not set value when unuse hls_segment_size, so give it value of 0. > is that a problem? > >> anywhere? In other words: You should also update doc/muxers.texi. (I >> can help with the grammar of the wording.) >> > patch will come soon :-D > >> >> patch update 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-14 2:53 GMT+08:00 Moritz Barsnick : > On Tue, Sep 13, 2016 at 11:25:39 +0800, Steven Liu wrote: > > +int byterange_mode = hls->flags & (HLS_SINGLE_FILE) || > hls->max_seg_size > 0; > ^ ^ > Why the bracket? > > > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename > template '%s' you can try use -use_localtime 1 with it\n", c->basename); > Rather: >av_log(oc, AV_LOG_ERROR, "Invalid segment filename > template '%s', you can try to use -use_localtime 1 with it\n", c->basename); > > > +{"hls_segment_size", "set maximum size per segment file, (Byte)", > OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E}, >{"hls_segment_size", "set maximum size per segment file (in > bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, > INT_MAX, E}, > > This isn't a flag, right? Perhaps you shouldn't be putting the option > between the flags' lines (but probably still as the final option). > I shall update patch :-) > > The value of 0 seems to have a special meaning. Is this documented > I cannot understand "The value of 0 seems to have a special meaning" , it will not set value when unuse hls_segment_size, so give it value of 0. is that a problem? > anywhere? In other words: You should also update doc/muxers.texi. (I > can help with the grammar of the wording.) > patch will come soon :-D > > Moritz > ___ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Tue, Sep 13, 2016 at 11:25:39 +0800, Steven Liu wrote: > +int byterange_mode = hls->flags & (HLS_SINGLE_FILE) || hls->max_seg_size > > 0; ^ ^ Why the bracket? > +av_log(oc, AV_LOG_ERROR, "Invalid segment filename template > '%s' you can try use -use_localtime 1 with it\n", c->basename); Rather: av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s', you can try to use -use_localtime 1 with it\n", c->basename); > +{"hls_segment_size", "set maximum size per segment file, (Byte)", > OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E}, {"hls_segment_size", "set maximum size per segment file (in bytes)", OFFSET(max_seg_size),AV_OPT_TYPE_INT,{.i64 = 0}, 0, INT_MAX, E}, This isn't a flag, right? Perhaps you shouldn't be putting the option between the flags' lines (but probably still as the final option). The value of 0 seems to have a special meaning. Is this documented anywhere? In other words: You should also update doc/muxers.texi. (I can help with the grammar of the wording.) Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-13 8:20 GMT+08:00 Michael Niedermayer : > On Tue, Sep 13, 2016 at 06:49:41AM +0800, Steven Liu wrote: > > 2016-09-13 6:19 GMT+08:00 Michael Niedermayer : > > > > > On Mon, Sep 12, 2016 at 07:04:54PM +0800, Steven Liu wrote: > > > > 2016-09-12 18:52 GMT+08:00 Michael Niedermayer > : > > > > > > > > > On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote: > > > > > > 2016-09-12 17:35 GMT+08:00 Steven Liu : > > > > > > > > > > > > > > > > > > > > > > > > > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer > > > > > > > >: > > > > > > > > > > > > > >> 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 250 -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@0 > > > > > > >> > output-test0.ts > > > > > > >> > #EXTINF:3.00, > > > > > > >> > #EXT-X-BYTERANGE:721356@1334988 > > > > > > >> > output-test0.ts > > > > > > >> > #EXTINF:3.00, > > > > > > >> > #EXT-X-BYTERANGE:735832@2056344 > > > > > > >> > output-test0.ts > > > > > > >> > #EXTINF:6.00, > > > > > > >> > #EXT-X-BYTERANGE:1645940@0 > > > > > > >> > output-test3.ts > > > > > > >> > #EXTINF:3.00, > > > > > > >> > #EXT-X-BYTERANGE:715152@1645940 > > > > > > >> > output-test3.ts > > > > > > >> > #EXTINF:3.00, > > > > > > >> > #EXT-X-BYTERANGE:751436@2361092 > > > > > > >> > output-test3.ts > > > > > > >> > #EXTINF:9.00, > > > > > > >> > #EXT-X-BYTERANGE:3377420@0 > > > > > > >> > output-test6.ts > > > > > > >> > #EXTINF:3.96, > > > > > > >> > #EXT-X-BYTERANGE:1228016@0 > > > > > > >> > output-test7.ts > > > > > > >> > #EXT-X-ENDLIST > > > > > > >> > localhost:ffmpeg liuqi$ > > > > > > >> > > > > > > > >> > ticket-id: #5839 > > > > > > >> > > > > > > > >> > Signed-off-by: Steven Liu > > > > > > >> > --- > > > > > > >> > 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 > > > > > > > > > > patch update, > > > > > > > > split long commit message to 2 lines > > > > > > > hlsenc.c | 34 +++--- > > > > 1 file changed, 31 insertions(+), 3 deletions(-) > > > > 3cb76b9c371cd40f41a51a84a142f849
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Tue, Sep 13, 2016 at 06:49:41AM +0800, Steven Liu wrote: > 2016-09-13 6:19 GMT+08:00 Michael Niedermayer : > > > On Mon, Sep 12, 2016 at 07:04:54PM +0800, Steven Liu wrote: > > > 2016-09-12 18:52 GMT+08:00 Michael Niedermayer : > > > > > > > On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote: > > > > > 2016-09-12 17:35 GMT+08:00 Steven Liu : > > > > > > > > > > > > > > > > > > > > > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer > > > > > >: > > > > > > > > > > > >> 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 250 -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@0 > > > > > >> > output-test0.ts > > > > > >> > #EXTINF:3.00, > > > > > >> > #EXT-X-BYTERANGE:721356@1334988 > > > > > >> > output-test0.ts > > > > > >> > #EXTINF:3.00, > > > > > >> > #EXT-X-BYTERANGE:735832@2056344 > > > > > >> > output-test0.ts > > > > > >> > #EXTINF:6.00, > > > > > >> > #EXT-X-BYTERANGE:1645940@0 > > > > > >> > output-test3.ts > > > > > >> > #EXTINF:3.00, > > > > > >> > #EXT-X-BYTERANGE:715152@1645940 > > > > > >> > output-test3.ts > > > > > >> > #EXTINF:3.00, > > > > > >> > #EXT-X-BYTERANGE:751436@2361092 > > > > > >> > output-test3.ts > > > > > >> > #EXTINF:9.00, > > > > > >> > #EXT-X-BYTERANGE:3377420@0 > > > > > >> > output-test6.ts > > > > > >> > #EXTINF:3.96, > > > > > >> > #EXT-X-BYTERANGE:1228016@0 > > > > > >> > output-test7.ts > > > > > >> > #EXT-X-ENDLIST > > > > > >> > localhost:ffmpeg liuqi$ > > > > > >> > > > > > > >> > ticket-id: #5839 > > > > > >> > > > > > > >> > Signed-off-by: Steven Liu > > > > > >> > --- > > > > > >> > 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 > > > > > > > > patch update, > > > > > > split long commit message to 2 lines > > > > > hlsenc.c | 34 +++--- > > > 1 file changed, 31 insertions(+), 3 deletions(-) > > > 3cb76b9c371cd40f41a51a84a142f849727eed44 0001-avformat-hlsenc-refine- > > EXT-X-BYTERANGE-support-for-s.patch > > > From 4c357e9e213cbc3b10667f3e69b43b6b30581913 Mon Sep 17 00:00:00 2001 > > > From: Steven Liu > > > Date: Mon, 12 Sep 2016 18:59:19 +0800 > > > Subject: [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for > > segments >
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-13 6:19 GMT+08:00 Michael Niedermayer : > On Mon, Sep 12, 2016 at 07:04:54PM +0800, Steven Liu wrote: > > 2016-09-12 18:52 GMT+08:00 Michael Niedermayer : > > > > > On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote: > > > > 2016-09-12 17:35 GMT+08:00 Steven Liu : > > > > > > > > > > > > > > > > > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer > > > >: > > > > > > > > > >> 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 250 -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@0 > > > > >> > output-test0.ts > > > > >> > #EXTINF:3.00, > > > > >> > #EXT-X-BYTERANGE:721356@1334988 > > > > >> > output-test0.ts > > > > >> > #EXTINF:3.00, > > > > >> > #EXT-X-BYTERANGE:735832@2056344 > > > > >> > output-test0.ts > > > > >> > #EXTINF:6.00, > > > > >> > #EXT-X-BYTERANGE:1645940@0 > > > > >> > output-test3.ts > > > > >> > #EXTINF:3.00, > > > > >> > #EXT-X-BYTERANGE:715152@1645940 > > > > >> > output-test3.ts > > > > >> > #EXTINF:3.00, > > > > >> > #EXT-X-BYTERANGE:751436@2361092 > > > > >> > output-test3.ts > > > > >> > #EXTINF:9.00, > > > > >> > #EXT-X-BYTERANGE:3377420@0 > > > > >> > output-test6.ts > > > > >> > #EXTINF:3.96, > > > > >> > #EXT-X-BYTERANGE:1228016@0 > > > > >> > output-test7.ts > > > > >> > #EXT-X-ENDLIST > > > > >> > localhost:ffmpeg liuqi$ > > > > >> > > > > > >> > ticket-id: #5839 > > > > >> > > > > > >> > Signed-off-by: Steven Liu > > > > >> > --- > > > > >> > 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 > > > > > > patch update, > > > > split long commit message to 2 lines > > > hlsenc.c | 34 +++--- > > 1 file changed, 31 insertions(+), 3 deletions(-) > > 3cb76b9c371cd40f41a51a84a142f849727eed44 0001-avformat-hlsenc-refine- > EXT-X-BYTERANGE-support-for-s.patch > > From 4c357e9e213cbc3b10667f3e69b43b6b30581913 Mon Sep 17 00:00:00 2001 > > From: Steven Liu > > Date: Mon, 12 Sep 2016 18:59:19 +0800 > > Subject: [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for > segments > > > > 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 > >
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Mon, Sep 12, 2016 at 07:04:54PM +0800, Steven Liu wrote: > 2016-09-12 18:52 GMT+08:00 Michael Niedermayer : > > > On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote: > > > 2016-09-12 17:35 GMT+08:00 Steven Liu : > > > > > > > > > > > > > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer > >: > > > > > > > >> 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 250 -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@0 > > > >> > output-test0.ts > > > >> > #EXTINF:3.00, > > > >> > #EXT-X-BYTERANGE:721356@1334988 > > > >> > output-test0.ts > > > >> > #EXTINF:3.00, > > > >> > #EXT-X-BYTERANGE:735832@2056344 > > > >> > output-test0.ts > > > >> > #EXTINF:6.00, > > > >> > #EXT-X-BYTERANGE:1645940@0 > > > >> > output-test3.ts > > > >> > #EXTINF:3.00, > > > >> > #EXT-X-BYTERANGE:715152@1645940 > > > >> > output-test3.ts > > > >> > #EXTINF:3.00, > > > >> > #EXT-X-BYTERANGE:751436@2361092 > > > >> > output-test3.ts > > > >> > #EXTINF:9.00, > > > >> > #EXT-X-BYTERANGE:3377420@0 > > > >> > output-test6.ts > > > >> > #EXTINF:3.96, > > > >> > #EXT-X-BYTERANGE:1228016@0 > > > >> > output-test7.ts > > > >> > #EXT-X-ENDLIST > > > >> > localhost:ffmpeg liuqi$ > > > >> > > > > >> > ticket-id: #5839 > > > >> > > > > >> > Signed-off-by: Steven Liu > > > >> > --- > > > >> > 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 > > > > patch update, > > split long commit message to 2 lines > hlsenc.c | 34 +++--- > 1 file changed, 31 insertions(+), 3 deletions(-) > 3cb76b9c371cd40f41a51a84a142f849727eed44 > 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch > From 4c357e9e213cbc3b10667f3e69b43b6b30581913 Mon Sep 17 00:00:00 2001 > From: Steven Liu > Date: Mon, 12 Sep 2016 18:59:19 +0800 > Subject: [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments > > 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 250 -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 liuq
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-12 18:52 GMT+08:00 Michael Niedermayer : > On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote: > > 2016-09-12 17:35 GMT+08:00 Steven Liu : > > > > > > > > > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer >: > > > > > >> 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 250 -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@0 > > >> > output-test0.ts > > >> > #EXTINF:3.00, > > >> > #EXT-X-BYTERANGE:721356@1334988 > > >> > output-test0.ts > > >> > #EXTINF:3.00, > > >> > #EXT-X-BYTERANGE:735832@2056344 > > >> > output-test0.ts > > >> > #EXTINF:6.00, > > >> > #EXT-X-BYTERANGE:1645940@0 > > >> > output-test3.ts > > >> > #EXTINF:3.00, > > >> > #EXT-X-BYTERANGE:715152@1645940 > > >> > output-test3.ts > > >> > #EXTINF:3.00, > > >> > #EXT-X-BYTERANGE:751436@2361092 > > >> > output-test3.ts > > >> > #EXTINF:9.00, > > >> > #EXT-X-BYTERANGE:3377420@0 > > >> > output-test6.ts > > >> > #EXTINF:3.96, > > >> > #EXT-X-BYTERANGE:1228016@0 > > >> > output-test7.ts > > >> > #EXT-X-ENDLIST > > >> > localhost:ffmpeg liuqi$ > > >> > > > >> > ticket-id: #5839 > > >> > > > >> > Signed-off-by: Steven Liu > > >> > --- > > >> > 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 > > patch update, split long commit message to 2 lines 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
On Mon, Sep 12, 2016 at 05:39:31PM +0800, Steven Liu wrote: > 2016-09-12 17:35 GMT+08:00 Steven Liu : > > > > > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer : > > > >> 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 250 -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@0 > >> > output-test0.ts > >> > #EXTINF:3.00, > >> > #EXT-X-BYTERANGE:721356@1334988 > >> > output-test0.ts > >> > #EXTINF:3.00, > >> > #EXT-X-BYTERANGE:735832@2056344 > >> > output-test0.ts > >> > #EXTINF:6.00, > >> > #EXT-X-BYTERANGE:1645940@0 > >> > output-test3.ts > >> > #EXTINF:3.00, > >> > #EXT-X-BYTERANGE:715152@1645940 > >> > output-test3.ts > >> > #EXTINF:3.00, > >> > #EXT-X-BYTERANGE:751436@2361092 > >> > output-test3.ts > >> > #EXTINF:9.00, > >> > #EXT-X-BYTERANGE:3377420@0 > >> > output-test6.ts > >> > #EXTINF:3.96, > >> > #EXT-X-BYTERANGE:1228016@0 > >> > output-test7.ts > >> > #EXT-X-ENDLIST > >> > localhost:ffmpeg liuqi$ > >> > > >> > ticket-id: #5839 > >> > > >> > Signed-off-by: Steven Liu > >> > --- > >> > 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 signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-12 17:35 GMT+08:00 Steven Liu : > > > 2016-09-12 17:28 GMT+08:00 Michael Niedermayer : > >> 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 250 -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@0 >> > output-test0.ts >> > #EXTINF:3.00, >> > #EXT-X-BYTERANGE:721356@1334988 >> > output-test0.ts >> > #EXTINF:3.00, >> > #EXT-X-BYTERANGE:735832@2056344 >> > output-test0.ts >> > #EXTINF:6.00, >> > #EXT-X-BYTERANGE:1645940@0 >> > output-test3.ts >> > #EXTINF:3.00, >> > #EXT-X-BYTERANGE:715152@1645940 >> > output-test3.ts >> > #EXTINF:3.00, >> > #EXT-X-BYTERANGE:751436@2361092 >> > output-test3.ts >> > #EXTINF:9.00, >> > #EXT-X-BYTERANGE:3377420@0 >> > output-test6.ts >> > #EXTINF:3.96, >> > #EXT-X-BYTERANGE:1228016@0 >> > output-test7.ts >> > #EXT-X-ENDLIST >> > localhost:ffmpeg liuqi$ >> > >> > ticket-id: #5839 >> > >> > Signed-off-by: Steven Liu >> > --- >> > 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 '-' 0001-avformat-hlsenc-refine-EXT-X-BYTERANGE-support-for-s.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
2016-09-12 17:28 GMT+08:00 Michael Niedermayer : > 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 250 -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@0 > > output-test0.ts > > #EXTINF:3.00, > > #EXT-X-BYTERANGE:721356@1334988 > > output-test0.ts > > #EXTINF:3.00, > > #EXT-X-BYTERANGE:735832@2056344 > > output-test0.ts > > #EXTINF:6.00, > > #EXT-X-BYTERANGE:1645940@0 > > output-test3.ts > > #EXTINF:3.00, > > #EXT-X-BYTERANGE:715152@1645940 > > output-test3.ts > > #EXTINF:3.00, > > #EXT-X-BYTERANGE:751436@2361092 > > output-test3.ts > > #EXTINF:9.00, > > #EXT-X-BYTERANGE:3377420@0 > > output-test6.ts > > #EXTINF:3.96, > > #EXT-X-BYTERANGE:1228016@0 > > output-test7.ts > > #EXT-X-ENDLIST > > localhost:ffmpeg liuqi$ > > > > ticket-id: #5839 > > > > Signed-off-by: Steven Liu > > --- > > 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 ?? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
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 250 -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@0 > output-test0.ts > #EXTINF:3.00, > #EXT-X-BYTERANGE:721356@1334988 > output-test0.ts > #EXTINF:3.00, > #EXT-X-BYTERANGE:735832@2056344 > output-test0.ts > #EXTINF:6.00, > #EXT-X-BYTERANGE:1645940@0 > output-test3.ts > #EXTINF:3.00, > #EXT-X-BYTERANGE:715152@1645940 > output-test3.ts > #EXTINF:3.00, > #EXT-X-BYTERANGE:751436@2361092 > output-test3.ts > #EXTINF:9.00, > #EXT-X-BYTERANGE:3377420@0 > output-test6.ts > #EXTINF:3.96, > #EXT-X-BYTERANGE:1228016@0 > output-test7.ts > #EXT-X-ENDLIST > localhost:ffmpeg liuqi$ > > ticket-id: #5839 > > Signed-off-by: Steven Liu > --- > 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 [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB You can kill me, but you cannot change the truth. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/hlsenc: refine EXT-X-BYTERANGE support for segments
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 250 -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@0 output-test0.ts #EXTINF:3.00, #EXT-X-BYTERANGE:721356@1334988 output-test0.ts #EXTINF:3.00, #EXT-X-BYTERANGE:735832@2056344 output-test0.ts #EXTINF:6.00, #EXT-X-BYTERANGE:1645940@0 output-test3.ts #EXTINF:3.00, #EXT-X-BYTERANGE:715152@1645940 output-test3.ts #EXTINF:3.00, #EXT-X-BYTERANGE:751436@2361092 output-test3.ts #EXTINF:9.00, #EXT-X-BYTERANGE:3377420@0 output-test6.ts #EXTINF:3.96, #EXT-X-BYTERANGE:1228016@0 output-test7.ts #EXT-X-ENDLIST localhost:ffmpeg liuqi$ ticket-id: #5839 Signed-off-by: Steven Liu --- 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; @@ -476,7 +477,7 @@ static int hls_window(AVFormatContext *s, int last) AVIOContext *sub_out = NULL; char temp_filename[1024]; int64_t sequence = FFMAX(hls->start_sequence, hls->sequence - hls->nb_entries); -int version = hls->flags & HLS_SINGLE_FILE ? 4 : 3; +int version = 0; const char *proto = avio_find_protocol_name(s->filename); int use_rename = proto && !strcmp(proto, "file"); static unsigned warned_non_file; @@ -485,6 +486,12 @@ static int hls_window(AVFormatContext *s, int last) AVDictionary *options = NULL; double prog_date_time = hls->initial_prog_date_time; +if (hls->flags & (HLS_SINGLE_FILE) || hls->max_seg_size > 0) { +version = 4; +} else { +version = 3; +} + if (!use_rename && !warned_non_file++) av_log(s, AV_LOG_ERROR, "Cannot use rename on non file protocol, this may lead to races and temporarly partial files\n"); @@ -533,7 +540,8 @@ static int hls_window(AVFormatContext *s, int last) avio_printf(out, "#EXTINF:%ld,\n", lrint(en->duration)); else avio_printf(out, "#EXTINF:%f,\n", en->duration); -if (hls->flags & HLS_SINGLE_FILE) +if (hls->flags & HLS_SINGLE_FILE || +hls->max_seg_size > 0) avio_printf(out, "#EXT-X-BYTERANGE:%"PRIi64"@%"PRIi64"\n", en->size, en->pos); if (hls->flags & HLS_PROGRAM_DATE_TIME) { @@ -573,7 +581,8 @@ static int hls_window(AVFormatContext *s, int last) for (en = hls->segments; en; en = en->next) { avio_printf(sub_out, "#EXTINF:%f,\n", en->duration); -if (hls->flags & HLS_SINGLE_FILE) +if (hls->flags & HLS_SINGLE_FILE || +hls->max_seg_size > 0) avio_printf(sub_out, "#EXT-X-BYTERANGE:%"PRIi64"@%"PRIi64"\n", en->size, en->pos); if (hls->baseurl) @@ -610,7 +619,14 @@ static int hls_start(AVFormatContext *s) if (c->vtt_basename) av_strlcpy(vtt_oc->filename, c->vtt_basename, sizeof(vtt_oc->filename)); -} else { +} else if (c->max_seg_size > 0) { +if (av_get_frame_filename2(oc->filename, sizeof(oc->filename), +c->basename, c->wrap ? c->sequence % c->wrap : c->sequence, +AV_FRAME_FILENAME_FLAGS_MULTIPLE) < 0) { +av_log(oc, AV_LOG_ERROR, "Invalid segment filename template '%s' you can try use -use_localtime 1 with it\n", c->basename); +return AVERROR(EINVAL); +} +} else { if (c->use_localtime) { time_t now0; struct tm *tm, tmpbuf; @@ -943,7 +959,18 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) if (hls->avf->oformat->priv_class && hls->avf->priv_data) av_opt_set(hls->avf->priv_data, "mpegts_flags", "resend_headers", 0); hls->numbe