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

2016-09-12 Thread Steven Liu
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

Re: [FFmpeg-devel] [PATCH] fate/als: add floating point decoding test

2016-09-12 Thread Umair Khan
On Thu, Sep 8, 2016 at 10:24 PM, Michael Niedermayer
 wrote:
> On Sun, Jul 17, 2016 at 07:25:31PM +0530, Umair Khan wrote:
>> On Sun, Jul 17, 2016 at 1:50 PM, Thilo Borgmann  
>> wrote:
>> > Hi,
>> >
>> >> From e172e333807b4b3b2558a1ffa735ade79a3f3e36 Mon Sep 17 00:00:00 2001
>> >> From: Umair Khan 
>> >> Date: Sun, 17 Jul 2016 13:05:49 +0530
>> >> Subject: [PATCH 1/1] fate/als: add floating point decoding test
>> >>
>> >> Signed-off-by: Umair Khan 
>> >> ---
>> >>  tests/fate/als.mak | 3 +++
>> >>  1 file changed, 3 insertions(+)
>> >>
>> >> diff --git a/tests/fate/als.mak b/tests/fate/als.mak
>> >> index ff2badf..2847a8d 100644
>> >> --- a/tests/fate/als.mak
>> >> +++ b/tests/fate/als.mak
>> >> @@ -7,5 +7,8 @@ endef
>> >>
>> >>  $(foreach N,$(ALS_SUITE),$(eval $(call FATE_ALS_SUITE,$(N
>> >>
>> >> ++FATE_ALS += fate-mpeg4-als-conformance-07
>> >
>> > Just add "07" to the ALS_SUITE.
>> >
>> > You also need to add a new "tests/ref/fate/mpeg4-als-conformance-07"
>> > file containing the correct CRC for that conformance file.
>> >
>> > Please setup a local FATE suite and test your patch before resubmitting.
>>
>> Tested.
>> Updated patch attached.
>>
>> -Umair
>
>>  fate/als.mak  |3 +++
>>  ref/fate/mpeg4-als-conformance-07 |1 +
>>  2 files changed, 4 insertions(+)
>> 1a677b6670ab1214c568ea495efd182a285dc6e3  
>> 0001-fate-als-add-floating-point-decoding-test.patch
>> From 4295fc1a5f56d81e9b498bece4aed36197328763 Mon Sep 17 00:00:00 2001
>> From: Umair Khan 
>> Date: Sun, 17 Jul 2016 13:05:49 +0530
>> Subject: [PATCH 1/1] fate/als: add floating point decoding test
>>
>> Signed-off-by: Umair Khan 
>> ---
>>  tests/fate/als.mak  | 3 +++
>>  tests/ref/fate/mpeg4-als-conformance-07 | 1 +
>>  2 files changed, 4 insertions(+)
>>  create mode 100644 tests/ref/fate/mpeg4-als-conformance-07
>>
>> diff --git a/tests/fate/als.mak b/tests/fate/als.mak
>> index ff2badf..a67302c 100644
>> --- a/tests/fate/als.mak
>> +++ b/tests/fate/als.mak
>> @@ -7,5 +7,8 @@ endef
>>
>>  $(foreach N,$(ALS_SUITE),$(eval $(call FATE_ALS_SUITE,$(N
>>
>> +FATE_ALS += fate-mpeg4-als-conformance-07
>> +fate-mpeg4-als-conformance-07: CMD = crc -i 
>> $(TARGET_SAMPLES)/lossless-audio/als_07_2ch192k32bF.mp4
>
> fails on arm

How do I see what's the actual error?
My code was definitely supposed to be platform independent. :o

> --- tests/ref/fate/mpeg4-als-conformance-07 2016-09-08 18:36:16.095167935 
> +0200
> +++ tests/data/fate/mpeg4-als-conformance-072016-09-08 18:49:32.219184707 
> +0200
> @@ -1 +1 @@
> -CRC=0x01503df3
> +CRC=0x81b53f05
> Test mpeg4-als-conformance-07 failed. Look at 
> tests/data/fate/mpeg4-als-conformance-07.err for details.
> make: *** [fate-mpeg4-als-conformance-07] Error 1
>
> interrestingly it does not fail on mips

I'm not sure how to go ahead to fix this. Any tips?

- Umair
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v5] lavfi/scale_vaapi: add denoise/sharpness support

2016-09-12 Thread Jun Zhao
v5 : - fix the commit message as review(Mark Thompson and Moritz Barsnick)
 - change the magic filter numbers 8 with VAProcFilterCount
 - check multiple filters because multiple filters aren't supported in
   the driver now
v4 : - fix sharpless typo(sharpless -> sharpness)
 - when don't support denoise/sharpness, report the error and return
 - fix denoise/sharpness params buffer leak in error handle
v3 : fix sharpless mapping issue
v2 : fix filter support flag check logic issue
From 21471c5e222873dd03bc3f9878598314710d7784 Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Tue, 30 Aug 2016 14:36:00 +0800
Subject: [PATCH v5] lavfi/scale_vaapi: add denoise/sharpness support.

add denoise/sharpness support, used scope [-1, 100] as the input
scope.

Signed-off-by: Jun Zhao 
---
 libavfilter/vf_scale_vaapi.c | 107 +++
 1 file changed, 107 insertions(+)

diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 8dd5acf..736ce56 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -53,6 +53,14 @@ typedef struct ScaleVAAPIContext {
 int output_width;
 int output_height;
 
+VAProcFilterCap denoise_caps;
+int denoise; // enable denoise algo. level is the optional
+ // value from the interval [-1, 100], -1 means 
disabled
+
+VAProcFilterCap sharpness_caps;
+int sharpness;   // enable sharpness. level is the optional value
+ // from the interval [-1, 100], -1 means disabled
+
 } ScaleVAAPIContext;
 
 
@@ -117,6 +125,8 @@ static int scale_vaapi_config_output(AVFilterLink *outlink)
 AVVAAPIFramesContext *va_frames;
 VAStatus vas;
 int err, i;
+unsigned int num_denoise_caps = 1;
+unsigned int num_sharpness_caps = 1;
 
 scale_vaapi_pipeline_uninit(ctx);
 
@@ -225,6 +235,40 @@ static int scale_vaapi_config_output(AVFilterLink *outlink)
 goto fail;
 }
 
+// multiple filters aren't supported in the driver:
+// sharpness can't work with noise reduction(de-noise), deinterlacing
+// color balance, skin tone enhancement...
+if (ctx->denoise != -1 && ctx->sharpness != -1) {
+av_log(ctx, AV_LOG_ERROR, "Do not support multiply filters (sharpness "
+   "can't work with the other filters).\n");
+err = AVERROR(EINVAL);
+goto fail;
+}
+
+if (ctx->denoise != -1) {
+vas = vaQueryVideoProcFilterCaps(ctx->hwctx->display, ctx->va_context,
+ VAProcFilterNoiseReduction,
+ &ctx->denoise_caps, 
&num_denoise_caps);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(ctx, AV_LOG_ERROR, "Failed to query denoise caps "
+   "context: %d (%s).\n", vas, vaErrorStr(vas));
+err = AVERROR(EIO);
+goto fail;
+}
+}
+
+if (ctx->sharpness != -1) {
+vas = vaQueryVideoProcFilterCaps(ctx->hwctx->display, ctx->va_context,
+ VAProcFilterSharpening,
+ &ctx->sharpness_caps, 
&num_sharpness_caps);
+if (vas != VA_STATUS_SUCCESS) {
+av_log(ctx, AV_LOG_ERROR, "Failed to query sharpness caps "
+   "context: %d (%s).\n", vas, vaErrorStr(vas));
+err = AVERROR(EIO);
+goto fail;
+}
+}
+
 av_freep(&hwconfig);
 av_hwframe_constraints_free(&constraints);
 return 0;
@@ -250,6 +294,14 @@ static int vaapi_proc_colour_standard(enum AVColorSpace 
av_cs)
 }
 }
 
+static float map_to_range(
+int input, int in_min, int in_max,
+float out_min, float out_max)
+{
+return (input - in_min) * (out_max - out_min) / (in_max - in_min) + 
out_min;
+}
+
+
 static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
 {
 AVFilterContext *avctx = inlink->dst;
@@ -259,6 +311,10 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, 
AVFrame *input_frame)
 VASurfaceID input_surface, output_surface;
 VAProcPipelineParameterBuffer params;
 VABufferID params_id;
+VABufferID denoise_id;
+VABufferID sharpness_id;
+VABufferID filter_bufs[VAProcFilterCount];
+int num_filter_bufs = 0;
 VAStatus vas;
 int err;
 
@@ -290,6 +346,43 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, 
AVFrame *input_frame)
 av_log(ctx, AV_LOG_DEBUG, "Using surface %#x for scale output.\n",
output_surface);
 
+if (ctx->denoise != -1) {
+VAProcFilterParameterBuffer denoise;
+denoise.type  = VAProcFilterNoiseReduction;
+denoise.value =  map_to_range(ctx->denoise, 0, 100,
+  ctx->denoise_caps.range.min_value,
+  ctx->denoise_caps.range.max_value);
+vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
+  

Re: [FFmpeg-devel] [PATCH] lavc/ffjni: do not error out if the last non-mandatory field/method cannot be found

2016-09-12 Thread Matthieu Bouron
On Sun, Sep 11, 2016 at 11:47:29PM +0200, Michael Niedermayer wrote:
> On Fri, Sep 09, 2016 at 04:40:00PM +0200, Matthieu Bouron wrote:
> > From: Matthieu Bouron 
> > 
> > ---
> >  libavcodec/ffjni.c | 2 ++
> >  1 file changed, 2 insertions(+)
> 
> LGTM

Pushed. Thanks.

Matthieu
[...]
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffprobe: add -show_headers_first option

2016-09-12 Thread Stefano Sabatini
On date Sunday 2016-09-11 19:42:45 +0200, Stefano Sabatini encoded:
> On date Saturday 2016-09-10 13:51:34 +0200, Nicolas George encoded:
[...]
> > The enabling or disabling of individual fields can also be an option to
> > tasks. That allow to support the same features as -show_entries in a more
> > logical way.
> 
> In other words you're suggesting to move to an option systems and
> drop/deprecate the current system based on marking what needs to be
> shown (which is easy as long as you have a fixed order). But even
> assuming an option-based syntax specifying the operations you still
> have problems with the order of operations.

I assumed the case we have several options, in case we have a single
option taking the operations specification this is no more an issue.
-- 
FFmpeg = Frenzy & Faithless Muttering Philosophical Enhanced Guru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate/als: add floating point decoding test

2016-09-12 Thread Thilo Borgmann
Am 12.09.16 um 09:30 schrieb Umair Khan:
> On Thu, Sep 8, 2016 at 10:24 PM, Michael Niedermayer
>  wrote:
>> On Sun, Jul 17, 2016 at 07:25:31PM +0530, Umair Khan wrote:
>>> On Sun, Jul 17, 2016 at 1:50 PM, Thilo Borgmann  
>>> wrote:
 Hi,

> From e172e333807b4b3b2558a1ffa735ade79a3f3e36 Mon Sep 17 00:00:00 2001
> From: Umair Khan 
> Date: Sun, 17 Jul 2016 13:05:49 +0530
> Subject: [PATCH 1/1] fate/als: add floating point decoding test
>
> Signed-off-by: Umair Khan 
> ---
>  tests/fate/als.mak | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/tests/fate/als.mak b/tests/fate/als.mak
> index ff2badf..2847a8d 100644
> --- a/tests/fate/als.mak
> +++ b/tests/fate/als.mak
> @@ -7,5 +7,8 @@ endef
>
>  $(foreach N,$(ALS_SUITE),$(eval $(call FATE_ALS_SUITE,$(N
>
> ++FATE_ALS += fate-mpeg4-als-conformance-07

 Just add "07" to the ALS_SUITE.

 You also need to add a new "tests/ref/fate/mpeg4-als-conformance-07"
 file containing the correct CRC for that conformance file.

 Please setup a local FATE suite and test your patch before resubmitting.
>>>
>>> Tested.
>>> Updated patch attached.
>>>
>>> -Umair
>>
>>>  fate/als.mak  |3 +++
>>>  ref/fate/mpeg4-als-conformance-07 |1 +
>>>  2 files changed, 4 insertions(+)
>>> 1a677b6670ab1214c568ea495efd182a285dc6e3  
>>> 0001-fate-als-add-floating-point-decoding-test.patch
>>> From 4295fc1a5f56d81e9b498bece4aed36197328763 Mon Sep 17 00:00:00 2001
>>> From: Umair Khan 
>>> Date: Sun, 17 Jul 2016 13:05:49 +0530
>>> Subject: [PATCH 1/1] fate/als: add floating point decoding test
>>>
>>> Signed-off-by: Umair Khan 
>>> ---
>>>  tests/fate/als.mak  | 3 +++
>>>  tests/ref/fate/mpeg4-als-conformance-07 | 1 +
>>>  2 files changed, 4 insertions(+)
>>>  create mode 100644 tests/ref/fate/mpeg4-als-conformance-07
>>>
>>> diff --git a/tests/fate/als.mak b/tests/fate/als.mak
>>> index ff2badf..a67302c 100644
>>> --- a/tests/fate/als.mak
>>> +++ b/tests/fate/als.mak
>>> @@ -7,5 +7,8 @@ endef
>>>
>>>  $(foreach N,$(ALS_SUITE),$(eval $(call FATE_ALS_SUITE,$(N
>>>
>>> +FATE_ALS += fate-mpeg4-als-conformance-07
>>> +fate-mpeg4-als-conformance-07: CMD = crc -i 
>>> $(TARGET_SAMPLES)/lossless-audio/als_07_2ch192k32bF.mp4
>>
>> fails on arm
> 
> How do I see what's the actual error?

Go to fate.ffmpeg.org and you can find the log somewhere (I think).
I'm not sure but you might check out an emulator for AARCH64, for example qemu,
to test with.


-Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] questions about multi-thread issues for ffmpeg

2016-09-12 Thread qw
hi Ronald,


>does ffmpeg support multi-thread in this case? If not, which ffmpeg
>> functions should be synchronized by application developer?
>
>
>Yes, ffmpeg supports multi-threading (internally), it is tested
>continuously and is considered very safe.
>
>Can you show some code? I'm wondering if your use is unusual.



In my side, ffmpeg 2.8.6 is used to make the simple transcoding program, while 
x264 as video encoder with 2 pass rate control algorithm.


Because of using 2-pass rate control, AVFormatContext is created with setting 
AVFMT_NOFILE for 1st pass, which just encodes video stream. After encoding the 
total video stream, video and audio streams are encoded for 2nd pass. If two 
transocding tasks are started simultaneously, and each corresponds to one 
thread, AVFormatContext::oformat->flags is changed to unset AVFMT_NOFILE at the 
end of 1st pass encoding, i.e. flushing bufferred video from x264 encoder.


If AVFMT_NOFILE is unset in AVFormatContext::oformat->flags for 1st pass, there 
is no crash issue any more.


Thanks!


Regards


Andrew



At 2016-09-08 17:56:07, "Ronald S. Bultje"  wrote:
>Hi Andrew,
>
>On Thu, Sep 8, 2016 at 3:59 AM, qw  wrote:
>
>> I have made one simple transcoding program by using ffmpeg lib, where
>> several av transcoding tasks are done in one process and each task
>> corresponds to one thread.
>>
>> But some ffmpeg function will report error, and sometimes the multi-thread
>> version of transcoding program will crash abnormally.
>>
>> For example, av_guess_format("mp4", NULL, NULL) returns error accidentally
>> with several concurrent tasks. And transcoding program will crash, when
>> calling av_interleaved_write_frame ().
>>
>
>Have you tried running this under valgrind? It is typically very helpful to
>see what causes the crash.
>
>does ffmpeg support multi-thread in this case? If not, which ffmpeg
>> functions should be synchronized by application developer?
>
>
>Yes, ffmpeg supports multi-threading (internally), it is tested
>continuously and is considered very safe.
>
>Can you show some code? I'm wondering if your use is unusual.
>
>Ronald
>___
>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-12 Thread 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

[...]
-- 
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


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

2016-09-12 Thread 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/_
> 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

2016-09-12 Thread Steven Liu
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


[FFmpeg-devel] [VDD2016] Technical Discussion Results

2016-09-12 Thread Thilo Borgmann
Hi,

these are the resulting notes we've taken during the FFmpeg technical discussion
during VDD 2016. We've ended up with two slides on the board and compn took
pictures of them. You can find them here:

https://drive.google.com/drive/folders/0B53tgCAS2uUnVUpZN0U1WDE0MzQ?usp=sharing

Additional info:

- There were two more job offers compn forgotto write down. One from Alex at
Comcast to implement a perceptional video filter in lavfi for 4K, along with
mcdeint and denoise filters. Contact compn to get more information about this.
Also Kodi is looking for python plugin developers. Compn also thinks that they
are looking for Android devs, too.

- The group working on ffv1 specification said they've also opportunities for
work. However you've to contact the commission members at archivist conferences.
I think we haven't got a list of these conferences, though.

All the rest is on the slides, more or less in shape. In case anyone has
interest in going for one of these tasks and/or want to start a discussion, feel
free to do so by posting to the mailing list.

-Thilo
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [VDD2016] Technical Discussion Results

2016-09-12 Thread Paul B Mahol
On 9/12/16, Thilo Borgmann  wrote:
> Hi,
>
> these are the resulting notes we've taken during the FFmpeg technical
> discussion
> during VDD 2016. We've ended up with two slides on the board and compn took
> pictures of them. You can find them here:
>
> https://drive.google.com/drive/folders/0B53tgCAS2uUnVUpZN0U1WDE0MzQ?usp=sharing
>
> Additional info:
>
> - There were two more job offers compn forgotto write down. One from Alex at
> Comcast to implement a perceptional video filter in lavfi for 4K, along with
> mcdeint and denoise filters. Contact compn to get more information about
> this.
> Also Kodi is looking for python plugin developers. Compn also thinks that
> they
> are looking for Android devs, too.
>
> - The group working on ffv1 specification said they've also opportunities
> for
> work. However you've to contact the commission members at archivist
> conferences.
> I think we haven't got a list of these conferences, though.
>
> All the rest is on the slides, more or less in shape. In case anyone has
> interest in going for one of these tasks and/or want to start a discussion,
> feel
> free to do so by posting to the mailing list.

What means 'Real World Metric filters', 'RGB levels' and 'waveforms'?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH]lavf/riff: Do not use a rogue twocc for adpcm_swf

2016-09-12 Thread Carl Eugen Hoyos
Hi!

Attached patch "fixes" ticket #5829, I am happy if a better 
solution can be found.

Please comment, Carl Eugen
From 69d62cac34908fb2a37e37ef1b03b565f2b4ae78 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Mon, 12 Sep 2016 12:42:33 +0200
Subject: [PATCH] lavf/riff: Do not use a rogue twocc for adpcm_swf.

Fixes ticket #5829.
---
 libavformat/riff.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 72ad5d9..06f2996 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -510,7 +510,6 @@ const AVCodecTag ff_codec_wav_tags[] = {
 { AV_CODEC_ID_AAC, 0xA106 },
 { AV_CODEC_ID_SPEEX,   0xA109 },
 { AV_CODEC_ID_FLAC,0xF1AC },
-{ AV_CODEC_ID_ADPCM_SWF,   ('S' << 8) + 'F' },
 /* HACK/FIXME: Does Vorbis in WAV/AVI have an (in)official ID? */
 { AV_CODEC_ID_VORBIS,  ('V' << 8) + 'o' },
 { AV_CODEC_ID_NONE,  0 },
-- 
1.7.10.4

___
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 Thread 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

[...]

-- 
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] [VDD2016] Technical Discussion Results

2016-09-12 Thread Thilo Borgmann
Am 12.09.16 um 12:01 schrieb Paul B Mahol:
> On 9/12/16, Thilo Borgmann  wrote:
>> Hi,
>>
>> these are the resulting notes we've taken during the FFmpeg technical
>> discussion
>> during VDD 2016. We've ended up with two slides on the board and compn took
>> pictures of them. You can find them here:
>>
>> https://drive.google.com/drive/folders/0B53tgCAS2uUnVUpZN0U1WDE0MzQ?usp=sharing
>>
>> Additional info:
>>
>> - There were two more job offers compn forgotto write down. One from Alex at
>> Comcast to implement a perceptional video filter in lavfi for 4K, along with
>> mcdeint and denoise filters. Contact compn to get more information about
>> this.
>> Also Kodi is looking for python plugin developers. Compn also thinks that
>> they
>> are looking for Android devs, too.
>>
>> - The group working on ffv1 specification said they've also opportunities
>> for
>> work. However you've to contact the commission members at archivist
>> conferences.
>> I think we haven't got a list of these conferences, though.
>>
>> All the rest is on the slides, more or less in shape. In case anyone has
>> interest in going for one of these tasks and/or want to start a discussion,
>> feel
>> free to do so by posting to the mailing list.
> 
> What means 'Real World Metric filters', 'RGB levels' and 'waveforms'?

I think these metrices refer to SSIM, VMAF etc... however I think we already
have some of these. Not sure about the others, maybe compn can comment.

-Thilo

___
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 Thread Steven Liu
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] questions about multi-thread issues for ffmpeg

2016-09-12 Thread Ronald S. Bultje
Hi,

On Mon, Sep 12, 2016 at 4:30 AM, qw  wrote:

> hi Ronald,
>
>
> >does ffmpeg support multi-thread in this case? If not, which ffmpeg
> >> functions should be synchronized by application developer?
> >
> >
> >Yes, ffmpeg supports multi-threading (internally), it is tested
> >continuously and is considered very safe.
> >
> >Can you show some code? I'm wondering if your use is unusual.
>
>
>
> In my side, ffmpeg 2.8.6 is used to make the simple transcoding program,
> while x264 as video encoder with 2 pass rate control algorithm.
>
>
> Because of using 2-pass rate control, AVFormatContext is created with
> setting AVFMT_NOFILE for 1st pass, which just encodes video stream. After
> encoding the total video stream, video and audio streams are encoded for
> 2nd pass. If two transocding tasks are started simultaneously, and each
> corresponds to one thread, AVFormatContext::oformat->flags is changed to
> unset AVFMT_NOFILE at the end of 1st pass encoding, i.e. flushing bufferred
> video from x264 encoder.
>
>
> If AVFMT_NOFILE is unset in AVFormatContext::oformat->flags for 1st pass,
> there is no crash issue any more.


Are these two transcoding tasks (re)using the same AVFormatContext?

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] adding RGBA and BGRA to nvenc.c

2016-09-12 Thread Andy Furniss

Andy Furniss wrote:


I do know that I have really grabbed and encoded 1080p60 with my AMD
h/w and including nv12 conversion gives a sane looking result -

gst-launch-1.0 -f ximagesrc use-damage=0 startx=0 starty=0 endx=1919
 endy=1079 num-buffers=1000 ! queue ! videoconvert !
video/x-raw,framerate=100/1,format=NV12  ! fakesink Setting pipeline
to PAUSED ... Pipeline is live and does not need PREROLL ... Setting
pipeline to PLAYING ... New clock: GstSystemClock Got EOS from
element "pipeline0". Execution ended after 0:00:14.419928745 Setting
pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline
to NULL ... Freeing pipeline ...

1000/14.419928745 = 69.3


Over the weekend I looked at the CSC aspect of this without using
x11grab = benching bgr0 on tmpfs to nv12 and managed with a bit of luck
to get ffmpeg to beat gstreamer.

Starting point gstreamer bgr0 to nv12 = 70fps, to I420 68fps.

ffmpeg benched using -f null as -f rawvideo to ram or /dev/null is
slower and I suspect/hope for my intended usage = vaapi upload -f null
will be more representative, but of course I don't know that.

ffmpeg -f rawvideo -s 1920x1080 -pix_fmt bgr0  -i /mnt/ramdisk/out.bgr0 
-pix_fmt nv12 -f null -


=41 fps, yuv420p = 66fps

So yuv420p is close to gstreamer but nv12 is poor.

By chance I wondered how much worse it would be if I used -sws_flags as
I have done in the past. Result it was faster, it turns out that
+full_chroma_inp takes yuv420p from 66 to 84fps and nv12 to 47fps.

The reason being that with no flags time is spent in bgr32toUV_half_c
with flag above I don't use that and see various sse in use like
ff_rgbatoUV_sse2.

nv12 is still too slow though. Looking with sysprof I see that time
is spent in yuv2nv12cX_c.

Seemed slow when remembering yuv420p -> nv12 conversions from the past
so I benched 1080p yuv420p -> nv12 and got > 500fps. Doing this didn't
use yuv2nv12cX_c at all so I got to make a new command line -

ffmpeg -f rawvideo -s 1920x1080 -pix_fmt bgr0  -i /mnt/ramdisk/out.bgr0 
-vf scale=flags=+full_chroma_inp,format=yuv420p,format=nv12 -f null -


= 78fps, nice.

So at least I can beat gstreamer on CSC now. Testing the new commandline
with x11grab gets me close to gst using the legacy x11grab = 65 fps.

libxcb x11grab is 52 fps though, so it would be good if that can be 
fixed up.





___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [VDD2016] Technical Discussion Results

2016-09-12 Thread Dave Rice
Hi,

> On Sep 12, 2016, at 5:58 AM, Thilo Borgmann  wrote:
> 
> Hi,
> 
> these are the resulting notes we've taken during the FFmpeg technical 
> discussion
> during VDD 2016. We've ended up with two slides on the board and compn took
> pictures of them. You can find them here:
> 
> https://drive.google.com/drive/folders/0B53tgCAS2uUnVUpZN0U1WDE0MzQ?usp=sharing
> 
> Additional info:
> 
> - There were two more job offers compn forgotto write down. One from Alex at
> Comcast to implement a perceptional video filter in lavfi for 4K, along with
> mcdeint and denoise filters. Contact compn to get more information about this.
> Also Kodi is looking for python plugin developers. Compn also thinks that they
> are looking for Android devs, too.
> 
> - The group working on ffv1 specification said they've also opportunities for
> work. However you've to contact the commission members at archivist 
> conferences.
> I think we haven't got a list of these conferences, though.

I'm in the CELLAR working group (working on Matorka, FFV1, FLAC) and am also an 
archivist and can speak to this. The MediaConch project via PREFORMA has some 
funds to sponsor FFV1 and Matroska development during this year.

- Option to add CRCs to Top Level Elements in Matroska when muxing. 
http://trac.ffmpeg.org/ticket/4347
- Support for selecting an Ordered Edition in mkv: 
http://trac.ffmpeg.org/ticket/5698
- Bayer pixel format support in FFV1
- Support for additional color information in FFV1 to better handle lossless 
DPX->FFV1->DPX transfer while preserving characteristics such as if the 
sampling is logarithmic or linear.

Probably others. Feel welcome to suggest a bounty or send questions to myself 
or Jerome Martinez .

[...]

Best Regards,
Dave Rice
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vf_colorspace: Add BT-names for gamma22/28 transfer option

2016-09-12 Thread Vittorio Giovara
Allows to use values returned from API and from ffprobe directly.

Signed-off-by: Vittorio Giovara 
---
 libavfilter/vf_colorspace.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
index 45fd917..b9ecb5f 100644
--- a/libavfilter/vf_colorspace.c
+++ b/libavfilter/vf_colorspace.c
@@ -1055,7 +1055,9 @@ static const AVOption colorspace_options[] = {
   OFFSET(user_trc),   AV_OPT_TYPE_INT, { .i64 = AVCOL_TRC_UNSPECIFIED },
   AVCOL_TRC_RESERVED0, AVCOL_TRC_NB - 1, FLAGS, "trc" },
 ENUM("bt709",AVCOL_TRC_BT709,"trc"),
+ENUM("bt470m",   AVCOL_TRC_GAMMA22,  "trc"),
 ENUM("gamma22",  AVCOL_TRC_GAMMA22,  "trc"),
+ENUM("bt470bg",  AVCOL_TRC_GAMMA28,  "trc"),
 ENUM("gamma28",  AVCOL_TRC_GAMMA28,  "trc"),
 ENUM("smpte170m",AVCOL_TRC_SMPTE170M,"trc"),
 ENUM("smpte240m",AVCOL_TRC_SMPTE240M,"trc"),
-- 
2.9.3

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] calculation of probe score

2016-09-12 Thread Monique Lassere
Hi, all,

Trying to dig as deeply as possible into ffprobe's probe score and how it
is calculated. AVProbeData
 contains a lot
of specific information about the tags and signatures ffprobe uses to
identify various formats. However, I have noticed some issues that
AVProbeData does not seem to address (in my novice ability to read C):

1. Even if ffprobe does not find a codec ID for a given stream, it can
still attempt to identify the stream. What type of information does ffprobe
use to guess the stream?

2. Secondly, does the probe score relate to the container format only? From
my look at AVProbeData and the test results I've gotten, that's what it
looks like: an example is a report from a Matroska file with an identified
H.264 encoding (lacking an identifiable tag) achieving a score of 100, and
many others. Therefore, it seems like ffprobe only returns a lower probe
score if data is missing from the container format.

Thanks for any thoughts or input.

Best,

Monique Lassere

M.S. Candidate in Library & Information Science, UIUC
Graduate Assistant at Research & Information Services
Graduate Hourly at the Rare Book & Manuscript Library
Format Registry Manager at Digital Bedrock
LinkedIn  || 847-361-0047
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vf_colorspace: Add BT-names for gamma22/28 transfer option

2016-09-12 Thread Ronald S. Bultje
Hi,

On Mon, Sep 12, 2016 at 1:44 PM, Vittorio Giovara <
vittorio.giov...@gmail.com> wrote:

> Allows to use values returned from API and from ffprobe directly.
>
> Signed-off-by: Vittorio Giovara 
> ---
>  libavfilter/vf_colorspace.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
> index 45fd917..b9ecb5f 100644
> --- a/libavfilter/vf_colorspace.c
> +++ b/libavfilter/vf_colorspace.c
> @@ -1055,7 +1055,9 @@ static const AVOption colorspace_options[] = {
>OFFSET(user_trc),   AV_OPT_TYPE_INT, { .i64 = AVCOL_TRC_UNSPECIFIED
> },
>AVCOL_TRC_RESERVED0, AVCOL_TRC_NB - 1, FLAGS, "trc" },
>  ENUM("bt709",AVCOL_TRC_BT709,"trc"),
> +ENUM("bt470m",   AVCOL_TRC_GAMMA22,  "trc"),
>  ENUM("gamma22",  AVCOL_TRC_GAMMA22,  "trc"),
> +ENUM("bt470bg",  AVCOL_TRC_GAMMA28,  "trc"),
>  ENUM("gamma28",  AVCOL_TRC_GAMMA28,  "trc"),
>  ENUM("smpte170m",AVCOL_TRC_SMPTE170M,"trc"),
>  ENUM("smpte240m",AVCOL_TRC_SMPTE240M,"trc"),
> --
> 2.9.3


OK.

(Can you push yourself or do you need one of us to do it for you?)

Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffplay: convert ffplay to use SDL2

2016-09-12 Thread Josh de Kock
From: Marton Balint 

Depends on the other SDL patches.

Signed-off-by: Josh de Kock 
---
 configure |   6 +-
 ffplay.c  | 594 ++
 2 files changed, 249 insertions(+), 351 deletions(-)

diff --git a/configure b/configure
index 6ef2410..c24784d 100755
--- a/configure
+++ b/configure
@@ -3138,8 +3138,8 @@ ffmpeg_deps="avcodec avfilter avformat swresample"
 ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
null_filter
setpts_filter trim_filter"
-ffplay_deps="avcodec avformat swscale swresample sdl"
-ffplay_libs='$sdl_libs'
+ffplay_deps="avcodec avformat swscale swresample sdl2"
+ffplay_libs='$sdl2_libs'
 ffplay_select="rdft crop_filter transpose_filter hflip_filter vflip_filter 
rotate_filter"
 ffprobe_deps="avcodec avformat"
 ffserver_deps="avformat fork sarestart"
@@ -6665,7 +6665,7 @@ HOSTLD_O=$HOSTLD_O
 TARGET_EXEC=$target_exec $target_exec_args
 TARGET_PATH=$target_path
 TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
-CFLAGS-ffplay=$sdl_cflags
+CFLAGS-ffplay=$sdl2_cflags
 ZLIB=$($ldflags_filter -lz)
 LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
 EXTRALIBS=$extralibs
diff --git a/ffplay.c b/ffplay.c
index adbe9cb..e64909a 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -105,6 +105,8 @@ const int program_birth_year = 2003;
 
 #define CURSOR_HIDE_DELAY 100
 
+#define USE_ONEPASS_SUBTITLE_RENDER 1
+
 static unsigned sws_flags = SWS_BICUBIC;
 
 typedef struct MyAVPacketList {
@@ -152,17 +154,17 @@ typedef struct Clock {
 typedef struct Frame {
 AVFrame *frame;
 AVSubtitle sub;
-AVSubtitleRect **subrects;  /* rescaled subtitle rectangles in yuva */
 int serial;
 double pts;   /* presentation timestamp for the frame */
 double duration;  /* estimated duration of the frame */
 int64_t pos;  /* byte position of the frame in the input file */
-SDL_Overlay *bmp;
+SDL_Texture *bmp;
 int allocated;
-int reallocate;
 int width;
 int height;
+int format;
 AVRational sar;
+int uploaded;
 } Frame;
 
 typedef struct FrameQueue {
@@ -272,6 +274,8 @@ typedef struct VideoState {
 FFTSample *rdft_data;
 int xpos;
 double last_vis_time;
+SDL_Texture *vis_texture;
+SDL_Texture *sub_texture;
 
 int subtitle_stream;
 AVStream *subtitle_st;
@@ -284,11 +288,8 @@ typedef struct VideoState {
 AVStream *video_st;
 PacketQueue videoq;
 double max_frame_duration;  // maximum duration of a frame - above 
this, we consider the jump a timestamp discontinuity
-#if !CONFIG_AVFILTER
 struct SwsContext *img_convert_ctx;
-#endif
 struct SwsContext *sub_convert_ctx;
-SDL_Rect last_display_rect;
 int eof;
 
 char *filename;
@@ -313,8 +314,6 @@ typedef struct VideoState {
 static AVInputFormat *file_iformat;
 static const char *input_filename;
 static const char *window_title;
-static int fs_screen_width;
-static int fs_screen_height;
 static int default_width  = 640;
 static int default_height = 480;
 static int screen_width  = 0;
@@ -362,7 +361,8 @@ static AVPacket flush_pkt;
 #define FF_ALLOC_EVENT   (SDL_USEREVENT)
 #define FF_QUIT_EVENT(SDL_USEREVENT + 2)
 
-static SDL_Surface *screen;
+static SDL_Window *window;
+static SDL_Renderer *renderer;
 
 #if CONFIG_AVFILTER
 static int opt_add_vfilter(void *optctx, const char *opt, const char *arg)
@@ -650,12 +650,6 @@ static void decoder_destroy(Decoder *d) {
 
 static void frame_queue_unref_item(Frame *vp)
 {
-int i;
-for (i = 0; i < vp->sub.num_rects; i++) {
-av_freep(&vp->subrects[i]->data[0]);
-av_freep(&vp->subrects[i]);
-}
-av_freep(&vp->subrects);
 av_frame_unref(vp->frame);
 avsubtitle_free(&vp->sub);
 }
@@ -798,113 +792,47 @@ static void decoder_abort(Decoder *d, FrameQueue *fq)
 packet_queue_flush(d->queue);
 }
 
-static inline void fill_rectangle(SDL_Surface *screen,
-  int x, int y, int w, int h, int color, int 
update)
+static inline void fill_rectangle(int x, int y, int w, int h)
 {
 SDL_Rect rect;
 rect.x = x;
 rect.y = y;
 rect.w = w;
 rect.h = h;
-SDL_FillRect(screen, &rect, color);
-if (update && w > 0 && h > 0)
-SDL_UpdateRect(screen, x, y, w, h);
-}
-
-/* draw only the border of a rectangle */
-static void fill_border(int xleft, int ytop, int width, int height, int x, int 
y, int w, int h, int color, int update)
-{
-int w1, w2, h1, h2;
-
-/* fill the background */
-w1 = x;
-if (w1 < 0)
-w1 = 0;
-w2 = width - (x + w);
-if (w2 < 0)
-w2 = 0;
-h1 = y;
-if (h1 < 0)
-h1 = 0;
-h2 = height - (y + h);
-if (h2 < 0)
-h2 = 0;
-fill_rectangle(screen,
-   xleft, ytop,
-   w1, height,
-   color, update);
-fill_rectangle(screen,
-   xleft + width - w2, ytop,
-   w2, height,

Re: [FFmpeg-devel] Strategy to optimally playback audio & video

2016-09-12 Thread Lou Logan
On Sun, 11 Sep 2016 21:37:16 +0200, Matthieu Beghin wrote:

> I hope I’m on the right mailing list.

Unfortunately, this is not the correct mailing list: ffmpeg-devel is
only for patch submissions and discussions related to the development
of FFmpeg.

If you need help using the FFmpeg libraries refer to libav-user.
If you need help using the FFmpeg cli tools refer to ffmpeg-user.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Strategy to optimally playback audio & video

2016-09-12 Thread Sven C. Dack

On 11/09/16 20:37, Matthieu Beghin wrote:

I see various solutions:

  1- I could put in cache more than one second of audio and video and I should 
be ok, but with 4k movies, keeping 30 frames could imply using a huge amount of 
memory and I would like to avoid that.
  2- I could open the file twice, one for video and one for audio, but I would 
use even more RAM and it would decrease performances because parsing the file 
twice
  3- I could avoid decoding video frames if I’m missing audio data but that 
would imply seeking back after to get a clean video frame (so decoding again 
from previous keyframe), so I think that’s not a option at all.
  4- Any better option ?



Keep audio and video in separate files. YouTube seems to be doing this for their 
4K videos.


If you cannot cache the video for long then cache the audio so it can cause less 
of a problem.


Divide and conquer...

___
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 Thread 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
> 
> 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

[FFmpeg-devel] mpeg12dec fix up DVD caption handling

2016-09-12 Thread Jonathan Campbell
These patches fix up the DVD caption handling in mpeg12dec.c to better handle 
odd cases.
It's based on code I've written elsewhere to handle captions.
While it's common for these packets to contain 15 frames worth and start on the 
odd field there are also DVDs that start on even field or even encode extra 
fields and switch starting fields.
Part of the patch is to document comprehensively the format of the DVD caption 
packet.

Jonathan Campbell
>From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
From: Jonathan Campbell 
Date: Mon, 12 Sep 2016 12:34:48 -0700
Subject: [PATCH 1/2] add comments documenting the format of the DVD CC
 user-data packet. this is to aid development and maintenance of that code.

---
 libavcodec/mpeg12dec.c | 27 ++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 204a578..522621a 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
 return 1;
 } else if (buf_size >= 11 &&
p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
-/* extract DVD CC data */
+/* extract DVD CC data
+ * for more information see: 
[https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
+ *
+ * uint32_t   user_data_start_code0x01B2(big endian)
+ * uint16_t   user_identifier 0x4343 "CC"
+ * uint8_tuser_data_type_code 0x01
+ * uint8_tcaption_block_size  0xF8
+ * uint8_t
+ *   bit 7caption_odd_field_first 1=odd field (CC1/CC2) first  
0=even field (CC3/CC4) first
+ *   bit 6caption_filler  0
+ *   bit 5:1  caption_block_count number of caption blocks 
(pairs of caption words = frames). Most DVDs use 15 per start of GOP.
+ *   bit 0caption_extra_field_added   1=one additional caption word
+ *
+ * struct caption_field_block {
+ *   uint8_t
+ * bit 7:1 caption_filler 0x7F (all 1s)
+ * bit 0   caption_field_odd  1=odd field (this is 
CC1/CC2)  0=even field (this is CC3/CC4)
+ *   uint8_t   caption_first_byte
+ *   uint8_t   caption_second_byte
+ * } caption_block[(caption_block_count * 2) + 
caption_extra_field_added];
+ *
+ * Some DVDs encode caption data for both fields with 
caption_field_odd=1. The only way to decode the fields
+ * correctly is to start on the field indicated by 
caption_odd_field_first and count between odd/even fields.
+ * Don't assume that the first caption word is the odd field. There do 
exist MPEG files in the wild that start
+ * on the even field. There also exist DVDs in the wild that encode an 
odd field count and the
+ * caption_extra_field_added/caption_odd_field_first bits change per 
packet to allow that. */
 int cc_count = 0;
 int i;
 // There is a caption count field in the data, but it is often
-- 
2.2.2

>From b95df051ae0b544c43c685a73b24c8b5123d593b Mon Sep 17 00:00:00 2001
From: Jonathan Campbell 
Date: Mon, 12 Sep 2016 14:45:10 -0700
Subject: [PATCH 2/2] read caption words field-wise, count properly and limit
 to cc_count. transfer each CC word taking into consideration immediate CC
 field bit or for DVDs that don't use it, keep track according to first field
 specified at start of DVD caption packet.

---
 libavcodec/mpeg12dec.c | 45 -
 1 file changed, 32 insertions(+), 13 deletions(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 522621a..8f88e82 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2266,6 +2266,7 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
  * for more information see: 
[https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
  *
  * uint32_t   user_data_start_code0x01B2(big endian)
+ *  p[0] starts here -
  * uint16_t   user_identifier 0x4343 "CC"
  * uint8_tuser_data_type_code 0x01
  * uint8_tcaption_block_size  0xF8
@@ -2274,7 +2275,7 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
  *   bit 6caption_filler  0
  *   bit 5:1  caption_block_count number of caption blocks 
(pairs of caption words = frames). Most DVDs use 15 per start of GOP.
  *   bit 0caption_extra_field_added   1=one additional caption word
- *
+ *  p[5] starts here -
  * struct caption_field_block {
  *   uint8_t
  * bit 7:1 caption_filler 0x7F (all 1s)
@@ -2288,30 +2289,48 @@ static int mpe

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

2016-09-12 Thread Steven Liu
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] mpeg12dec fix up DVD caption handling

2016-09-12 Thread Michael Niedermayer
On Mon, Sep 12, 2016 at 03:28:24PM -0700, Jonathan Campbell wrote:
> These patches fix up the DVD caption handling in mpeg12dec.c to better handle 
> odd cases.
> It's based on code I've written elsewhere to handle captions.
> While it's common for these packets to contain 15 frames worth and start on 
> the odd field there are also DVDs that start on even field or even encode 
> extra fields and switch starting fields.
> Part of the patch is to document comprehensively the format of the DVD 
> caption packet.
> 
> Jonathan Campbell

>  mpeg12dec.c |   27 ++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> a839a0d0e9000ab140f6aef9dee9577f242462bf  
> 0001-add-comments-documenting-the-format-of-the-DVD-CC-us.patch
> From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
> From: Jonathan Campbell 
> Date: Mon, 12 Sep 2016 12:34:48 -0700
> Subject: [PATCH 1/2] add comments documenting the format of the DVD CC
>  user-data packet. this is to aid development and maintenance of that code.
> 
> ---
>  libavcodec/mpeg12dec.c | 27 ++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index 204a578..522621a 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
>  return 1;
>  } else if (buf_size >= 11 &&
> p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
> -/* extract DVD CC data */
> +/* extract DVD CC data

> + * for more information see: 
> [https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]

wikipedia is not a good reference, in fact its not even a
constant reference without a revission. wikipedia can massivly change
and may at times, especially with niche areas be just wrong, the link
itself also wont always work possibly

Please use the specifications itself, H.262 is public, its the 4th
link when searching for H.262 with google for example (wikipedia
refers to H.262 IIUC)

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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 Thread 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(-)
> > > 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 2/3] lavf/mov: improve `tref/chap` chapter handling

2016-09-12 Thread Rodger Combs

> On Sep 10, 2016, at 20:41, Michael Niedermayer  wrote:
> 
> On Fri, Sep 09, 2016 at 09:07:31PM -0500, Rodger Combs wrote:
>> 3 parts:
>> - Supports multiple chapter streams
>> - Exports regular text chapter streams as opaque data. This prevents 
>> consumers
>>  from showing chapters as if they were regular subtitle streams.
>> - Exports video chapter streams as thumbnails, and provides the first one as
>>  an attached_pic.
>> ---
>> libavformat/isom.h |  3 ++-
>> libavformat/mov.c  | 52 +---
>> 2 files changed, 47 insertions(+), 8 deletions(-)
>> 
>> diff --git a/libavformat/isom.h b/libavformat/isom.h
>> index 2246fed..9038057 100644
>> --- a/libavformat/isom.h
>> +++ b/libavformat/isom.h
>> @@ -210,7 +210,8 @@ typedef struct MOVContext {
>> unsigned trex_count;
>> int itunes_metadata;  ///< metadata are itunes style
>> int handbrake_version;
>> -int chapter_track;
>> +int *chapter_tracks;
>> +unsigned int nb_chapter_tracks;
>> int use_absolute_path;
>> int ignore_editlist;
>> int ignore_chapters;
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index 6e80b93..22ca809 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -3574,7 +3574,18 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext 
>> *pb, MOVAtom atom)
>> 
>> static int mov_read_chap(MOVContext *c, AVIOContext *pb, MOVAtom atom)
>> {
>> -c->chapter_track = avio_rb32(pb);
>> +unsigned i, num;
>> +av_free(c->chapter_tracks);
>> +
>> +num = atom.size / 4;
>> +if (!(c->chapter_tracks = av_malloc(num * 4)))
> 
> av_malloc_array()

Done

> 
>> +return AVERROR(ENOMEM);
> 
> the error return leaves the size and array in an inconsistent tstate

Fixed

> 
> 
>> +
>> +c->nb_chapter_tracks = num;
>> +
> 
>> +for (i = 0; i < num; i++)
>> +c->chapter_tracks[i] = avio_rb32(pb);
> 
> missing eof check
> reading 16gb without checking is not a good idea, it could waste alot
> of time

Added

> 
> this patch also appears to result in missing codec parameters(pix fmt)
> and ffmpeg failing to transcode it
> should i upload a file that causes this ?

Would appreciate one, yeah

> 
> thx
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Republics decline into democracies and democracies degenerate into
> despotisms. -- Aristotle
> ___
> 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] mpeg12dec fix up DVD caption handling

2016-09-12 Thread Jonathan Campbell


On 09/12/2016 04:56 PM, Michael Niedermayer wrote:
> On Mon, Sep 12, 2016 at 03:28:24PM -0700, Jonathan Campbell wrote:
>> These patches fix up the DVD caption handling in mpeg12dec.c to better 
>> handle odd cases.
>> It's based on code I've written elsewhere to handle captions.
>> While it's common for these packets to contain 15 frames worth and start on 
>> the odd field there are also DVDs that start on even field or even encode 
>> extra fields and switch starting fields.
>> Part of the patch is to document comprehensively the format of the DVD 
>> caption packet.
>>
>> Jonathan Campbell
> 
>>  mpeg12dec.c |   27 ++-
>>  1 file changed, 26 insertions(+), 1 deletion(-)
>> a839a0d0e9000ab140f6aef9dee9577f242462bf  
>> 0001-add-comments-documenting-the-format-of-the-DVD-CC-us.patch
>> From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
>> From: Jonathan Campbell 
>> Date: Mon, 12 Sep 2016 12:34:48 -0700
>> Subject: [PATCH 1/2] add comments documenting the format of the DVD CC
>>  user-data packet. this is to aid development and maintenance of that code.
>>
>> ---
>>  libavcodec/mpeg12dec.c | 27 ++-
>>  1 file changed, 26 insertions(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
>> index 204a578..522621a 100644
>> --- a/libavcodec/mpeg12dec.c
>> +++ b/libavcodec/mpeg12dec.c
>> @@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
>>  return 1;
>>  } else if (buf_size >= 11 &&
>> p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
>> -/* extract DVD CC data */
>> +/* extract DVD CC data
> 
>> + * for more information see: 
>> [https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
> 
> wikipedia is not a good reference, in fact its not even a
> constant reference without a revission. wikipedia can massivly change
> and may at times, especially with niche areas be just wrong, the link
> itself also wont always work possibly
> 
> Please use the specifications itself, H.262 is public, its the 4th
> link when searching for H.262 with google for example (wikipedia
> refers to H.262 IIUC)
> 
> [...]
> 
> 
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
Updated patch set, removes Wikipedia link.

I see that H.262 specs are free on the web, but I can't find the part that 
describes the DVD-style H.262 user data packets that this code handles.

But the structure as described has been reliable when tested against my DVD 
library.

Jonathan Campbell
From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
From: Jonathan Campbell 
Date: Mon, 12 Sep 2016 12:34:48 -0700
Subject: [PATCH 1/7] add comments documenting the format of the DVD CC
 user-data packet. this is to aid development and maintenance of that code.

---
 libavcodec/mpeg12dec.c | 27 ++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 204a578..522621a 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
 return 1;
 } else if (buf_size >= 11 &&
p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 0xf8) {
-/* extract DVD CC data */
+/* extract DVD CC data
+ * for more information see: 
[https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
+ *
+ * uint32_t   user_data_start_code0x01B2(big endian)
+ * uint16_t   user_identifier 0x4343 "CC"
+ * uint8_tuser_data_type_code 0x01
+ * uint8_tcaption_block_size  0xF8
+ * uint8_t
+ *   bit 7caption_odd_field_first 1=odd field (CC1/CC2) first  
0=even field (CC3/CC4) first
+ *   bit 6caption_filler  0
+ *   bit 5:1  caption_block_count number of caption blocks 
(pairs of caption words = frames). Most DVDs use 15 per start of GOP.
+ *   bit 0caption_extra_field_added   1=one additional caption word
+ *
+ * struct caption_field_block {
+ *   uint8_t
+ * bit 7:1 caption_filler 0x7F (all 1s)
+ * bit 0   caption_field_odd  1=odd field (this is 
CC1/CC2)  0=even field (this is CC3/CC4)
+ *   uint8_t   caption_first_byte
+ *   uint8_t   caption_second_byte
+ * } caption_block[(caption_block_count * 2) + 
caption_extra_field_added];
+ *
+ * Some DVDs encode caption data for both fields with 
caption_field_odd=1. The only way to decode the fields
+ * correctly is to start on the field indicated by 
caption_odd_field_first and count between odd/even fields.
+ * Don't assume t

Re: [FFmpeg-devel] [PATCH 2/2] lavf/mov: strip com.apple.quicktime prefix in meta; parse creation date

2016-09-12 Thread Rodger Combs

> On Sep 10, 2016, at 05:55, Michael Niedermayer  wrote:
> 
> On Fri, Sep 09, 2016 at 08:06:40PM -0500, Rodger Combs wrote:
>> ---
>> libavformat/mov.c | 16 
>> 1 file changed, 16 insertions(+)
>> 
>> diff --git a/libavformat/mov.c b/libavformat/mov.c
>> index 54530e3..b75acd2 100644
>> --- a/libavformat/mov.c
>> +++ b/libavformat/mov.c
>> @@ -42,6 +42,7 @@
>> #include "libavutil/aes_ctr.h"
>> #include "libavutil/sha.h"
>> #include "libavutil/timecode.h"
>> +#include "libavutil/parseutils.h"
>> #include "libavcodec/ac3tab.h"
>> #include "libavcodec/mpegaudiodecheader.h"
>> #include "avformat.h"
>> @@ -476,6 +477,21 @@ retry:
>> return ret;
>> }
>> str[str_size] = 0;
>> +if (!strcmp(key, "com.apple.quicktime.creationdate")) {
>> +struct tm *ptm, tmbuf;
>> +int64_t timeval;
>> +if (av_parse_time(&timeval, str, 0) >= 0) {
>> +time_t timet = timeval / 100;
>> +if (ptm = gmtime_r(&timet, &tmbuf)) {
>> +strftime(str, str_size, "%Y-%m-%d %H:%M:%S", ptm);
>> +key = "creation_time";
>> +}
>> +}
>> +} else if (!strcmp(key, 
>> "com.apple.quicktime.location.ISO6709")) {
>> +key = "location";
>> +} else if (!strncmp(key, "com.apple.quicktime.", 20)) {
>> +key += 20;
>> +}
>> }
> 
> this causes language specific entries no longer to be listed together
> with their "parent" entries:

Huh; interesting. Not sure why this happens, but also not sure if it matters?

> is this missing some hadling of langauge specific stuff ?

Nothing I'm aware of, but I could easily be missing something.

> also off topic but we should sort metadata for display so related
> tags appear together

Sounds worthwhile, but yeah out-of-scope here.

> 
> ticket/4012/IMG_4596.MOV
> 
> major_brand : qt
> minor_version   : 0
> -creation_time   : 2014-10-05T10:06:36.00Z
> +make-eng: Apple
> encoder : 8.0.2
> encoder-eng : 8.0.2
> date: 2014-10-05T18:06:36+0800
> date-eng: 2014-10-05T18:06:36+0800
> -location: +06.2271+099.7476+018.026/
> +software: 8.0.2
> location-eng: +06.2271+099.7476+018.026/
> -model   : iPhone 6
> +creation_time   : 2014-10-05T10:06:36.000
> model-eng   : iPhone 6
> +location: +06.2271+099.7476+018.026/
> +model   : iPhone 6
> make: Apple
> -make-eng: Apple
>   rotate  : 180
>   creation_time   : 2014-10-05T10:06:36.00Z
>   handler_name: Core Media Data Handler
> 
> 
> [...]
> 
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
> ___
> 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] FFmpeg in Outreachy Round 13 / 2016-december

2016-09-12 Thread Sarah A Sharp
Hi Michael,

Can you please send me a link to the FFmpeg landing page? The
Outreachy round opened today, and I would love to get your project
listed as a participating org:

https://wiki.gnome.org/Outreachy/2016/DecemberMarch

Thanks,
Sarah Sharp

On Wed, Aug 31, 2016 at 7:23 PM, Sarah A Sharp  wrote:
> On Fri, Aug 26, 2016 at 10:06 AM, Stefano Sabatini  wrote:
>> In data Wednesday 2016-08-24 02:07:17 +0200, Michael Niedermayer ha scritto:
>>> Hi Sarah
>>>
>>> On Tue, Aug 23, 2016 at 10:04:55AM -0700, Sarah A Sharp wrote:
>>> > Hi Michael,
>>> >
>>> > I'm happy to hear FFmpeg will participate again! Do you know who will
>>> > sponsor your intern(s) and how many interns you have funding for?
>>>
>>> please see:
>>> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-July/197081.html
>>> (http://ffmpeg.org/pipermail/ffmpeg-devel/2016-July/196956.html)
>>>
>>
>>> I belive we have funding for 1 FFmpeg outreachy intern
>>> (this assumes that a qualified intern is found)
>>> CCing stefano, please correct me if thats not so
>>
>> Yes, that's correct.
>
> Great! Can you please send me a link to your landing page for this
> round? Directions for creating a landing page can be found here:
>
> https://wiki.gnome.org/Outreachy/Admin/GettingStarted#For_Coordinators
>
> What blurb do you want to use for the Outreachy round wiki page? The
> blurb I have from last round is:
>
> "FFmpeg is the universal multimedia toolkit: a complete,
> cross-platform solution to record, convert, filter and stream audio
> and video. Available projects like FFv1 codecs frame support, scaling
> improvement, and adding selftests involve coding in C. Another project
> involves creating a fuzzing testsuite and a web interface for it in
> Python or node.js."
>
> Also, is there a deadline you need to be invoiced by? Outreachy will
> be invoicing in early December, but we can invoice you sooner if
> necessary. Stefano, are you the right contact to invoice, or is there
> another contact that needs to be invoiced?
>
> Sarah Sharp
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] lavf/mov: fix parsing QuickTime meta after the first track

2016-09-12 Thread Rodger Combs

> On Sep 10, 2016, at 05:10, Michael Niedermayer  wrote:
> 
> On Fri, Sep 09, 2016 at 08:06:39PM -0500, Rodger Combs wrote:
>> I'm not entirely sure why found_hdlr_mdta existed to begin with, so cc-ing
>> Tinglin Liu (who originally wrote the patch) and Derek Buitenhuis (who signed
>> off on it) hoping for some background. If these checks actually do have a
>> purpose, then the `type == MKTAG('m','d','t','a')` check should be moved
>> to before the `c->fc->nb_streams < 1` check instead of inside it.
>> ---
>> libavformat/isom.h |  1 -
>> libavformat/mov.c  | 10 +++---
>> 2 files changed, 3 insertions(+), 8 deletions(-)
> 
> This seems to change
> "handler_name: sound handler" to
> "handler_name: ilst handler"
> 
> for http://samples.ffmpeg.org/MPEG-4/replaygain/sample.mp4
> 
> is that intended ?

Hmm, this looks like a consequence of the `handler_name` key being provided in 
multiple places on the same track, but I'm not sure `handler_name` is ever 
meaningful to the consumer to begin with, so I'm not sure if this matters?

> 
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Modern terrorism, a quick summary: Need oil, start war with country that
> has oil, kill hundread thousand in war. Let country fall into chaos,
> be surprised about raise of fundamantalists. Drop more bombs, kill more
> people, be surprised about them taking revenge and drop even more bombs
> and strip your own citizens of their rights and freedoms. to be continued
> ___
> 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


[FFmpeg-devel] [PATCH] lavf/matroska: expose stream encoding as global side-data

2016-09-12 Thread Rodger Combs
Some demuxers can't handle Matroska compression, so this lets API users
check if a file uses it and determine whether those players will fail.

Currently only exports the first encoding; the format technically supports
multiple, but I can't find an example of this and lavf doesn't support it.
---
 doc/APIchanges|  4 
 libavcodec/avcodec.h  | 43 ++-
 libavcodec/avpacket.c |  1 +
 libavcodec/version.h  |  4 ++--
 libavformat/matroskadec.c | 23 +--
 5 files changed, 66 insertions(+), 9 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 7ac809c..144bfac 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2015-08-28
 
 API changes, most recent first:
 
+2016-09-12 - xxx - lavc 57.56.100 - avcodec.h
+  Add AVMatroskaEncoding and its constituent enums
+  (AVMatroskaEncodingType and AVMatroskaEncodingAlgorithm)
+
 2016-08-29 - 4493390 - lavfi 6.58.100 - avfilter.h
   Add AVFilterContext.nb_threads.
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 01f9b29..4cca01f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1330,6 +1330,42 @@ typedef struct AVCPBProperties {
 uint64_t vbv_delay;
 } AVCPBProperties;
 
+/**
+ * Basic type of encoding in a Matroska stream
+ */
+typedef enum AVMatroskaEncodingType {
+AV_MATROSKA_ENCODING_COMPRESSION = 0,
+AV_MATROSKA_ENCODING_ENCRYPTION = 1,
+} AVMatroskaEncodingType;
+
+/**
+ * Encoding algorithm in a Matroska stream
+ */
+typedef enum AVMatroskaEncodingAlgorithm {
+// Compression
+AV_MATROSKA_ENCODING_ZLIB = 0,
+AV_MATROSKA_ENCODING_BZLIB = 1,
+AV_MATROSKA_ENCODING_LZO1X = 2,
+AV_MATROSKA_ENCODING_HEADERSTRIPPING = 3,
+// Encryption
+AV_MATROSKA_ENCODING_SIGNING = 0,
+AV_MATROSKA_ENCODING_DES = 1,
+AV_MATROSKA_ENCODING_3DES = 2,
+AV_MATROSKA_ENCODING_TWOFISH = 3,
+AV_MATROSKA_ENCODING_BLOWFISH = 4,
+AV_MATROSKA_ENCODING_AES = 5,
+} AVMatroskaEncodingAlgorithm;
+
+/**
+ * This structure describes the Matroska encoding (compression or encryption) 
applied to
+ * a stream. It can be useful when determining whether or not other demuxers 
can handle
+ * a file, since some players don't support header compression.
+ */
+typedef struct AVMatroskaEncoding {
+AVMatroskaEncodingType type;
+AVMatroskaEncodingAlgorithm algorithm;
+} AVMatroskaEncoding;
+
 #if FF_API_QSCALE_TYPE
 #define FF_QSCALE_TYPE_MPEG1 0
 #define FF_QSCALE_TYPE_MPEG2 1
@@ -1525,7 +1561,12 @@ enum AVPacketSideDataType {
  * should be associated with a video stream and containts data in the form
  * of the AVMasteringDisplayMetadata struct.
  */
-AV_PKT_DATA_MASTERING_DISPLAY_METADATA
+AV_PKT_DATA_MASTERING_DISPLAY_METADATA,
+
+/**
+ * Corresponds to the AVMatroskaEncoding struct.
+ */
+AV_PKT_DATA_MATROSKA_ENCODING,
 };
 
 #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index fa2844d..220e305 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -367,6 +367,7 @@ const char *av_packet_side_data_name(enum 
AVPacketSideDataType type)
 case AV_PKT_DATA_METADATA_UPDATE:return "Metadata Update";
 case AV_PKT_DATA_MPEGTS_STREAM_ID:   return "MPEGTS Stream ID";
 case AV_PKT_DATA_MASTERING_DISPLAY_METADATA: return "Mastering display 
metadata";
+case AV_PKT_DATA_MATROSKA_ENCODING:  return "Matroska Encoding";
 }
 return NULL;
 }
diff --git a/libavcodec/version.h b/libavcodec/version.h
index f5dd118..ecd48c5 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,8 +28,8 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  57
-#define LIBAVCODEC_VERSION_MINOR  55
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MINOR  56
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 77b8a5d..9bae9c8 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1919,6 +1919,10 @@ static int matroska_parse_tracks(AVFormatContext *s)
 if (!track->codec_id)
 continue;
 
+st = track->stream = avformat_new_stream(s, NULL);
+if (!st)
+return AVERROR(ENOMEM);
+
 if (track->audio.samplerate < 0 || track->audio.samplerate > INT_MAX ||
 isnan(track->audio.samplerate)) {
 av_log(matroska->ctx, AV_LOG_WARNING,
@@ -1944,7 +1948,16 @@ static int matroska_parse_tracks(AVFormatContext *s)
 av_log(matroska->ctx, AV_LOG_ERROR,
"Multiple combined encodings not supported");
 } else if (encodings_list->nb_elem == 1) {
+AVMatroskaEncoding *side_data =

Re: [FFmpeg-devel] mpeg12dec fix up DVD caption handling

2016-09-12 Thread Michael Niedermayer
On Mon, Sep 12, 2016 at 06:19:43PM -0700, Jonathan Campbell wrote:
> 
> 
> On 09/12/2016 04:56 PM, Michael Niedermayer wrote:
> > On Mon, Sep 12, 2016 at 03:28:24PM -0700, Jonathan Campbell wrote:
> >> These patches fix up the DVD caption handling in mpeg12dec.c to better 
> >> handle odd cases.
> >> It's based on code I've written elsewhere to handle captions.
> >> While it's common for these packets to contain 15 frames worth and start 
> >> on the odd field there are also DVDs that start on even field or even 
> >> encode extra fields and switch starting fields.
> >> Part of the patch is to document comprehensively the format of the DVD 
> >> caption packet.
> >>
> >> Jonathan Campbell
> > 
> >>  mpeg12dec.c |   27 ++-
> >>  1 file changed, 26 insertions(+), 1 deletion(-)
> >> a839a0d0e9000ab140f6aef9dee9577f242462bf  
> >> 0001-add-comments-documenting-the-format-of-the-DVD-CC-us.patch
> >> From 9213012c7d8ceef2af43fe3c218b1b50728e8f80 Mon Sep 17 00:00:00 2001
> >> From: Jonathan Campbell 
> >> Date: Mon, 12 Sep 2016 12:34:48 -0700
> >> Subject: [PATCH 1/2] add comments documenting the format of the DVD CC
> >>  user-data packet. this is to aid development and maintenance of that code.
> >>
> >> ---
> >>  libavcodec/mpeg12dec.c | 27 ++-
> >>  1 file changed, 26 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> >> index 204a578..522621a 100644
> >> --- a/libavcodec/mpeg12dec.c
> >> +++ b/libavcodec/mpeg12dec.c
> >> @@ -2262,7 +2262,32 @@ static int mpeg_decode_a53_cc(AVCodecContext *avctx,
> >>  return 1;
> >>  } else if (buf_size >= 11 &&
> >> p[0] == 'C' && p[1] == 'C' && p[2] == 0x01 && p[3] == 
> >> 0xf8) {
> >> -/* extract DVD CC data */
> >> +/* extract DVD CC data
> > 
> >> + * for more information see: 
> >> [https://en.wikipedia.org/wiki/EIA-608#DVD_GOP_User_Data_Insertion]
> > 
> > wikipedia is not a good reference, in fact its not even a
> > constant reference without a revission. wikipedia can massivly change
> > and may at times, especially with niche areas be just wrong, the link
> > itself also wont always work possibly
> > 
> > Please use the specifications itself, H.262 is public, its the 4th
> > link when searching for H.262 with google for example (wikipedia
> > refers to H.262 IIUC)
> > 
> > [...]
> > 
> > 
> > 
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> Updated patch set, removes Wikipedia link.
> 
> I see that H.262 specs are free on the web, but I can't find the part that 
> describes the DVD-style H.262 user data packets that this code handles.
> 
> But the structure as described has been reliable when tested against my DVD 
> library.

applied the docs and wiki removial stashed

please dont send multiple patches per mail it makes keeping track of
what needs a review hard both with MUAs as well as patchwork

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] FFmpeg in Outreachy Round 13 / 2016-december

2016-09-12 Thread Michael Niedermayer
On Mon, Sep 12, 2016 at 06:35:01PM -0700, Sarah A Sharp wrote:
> Hi Michael,
> 
> Can you please send me a link to the FFmpeg landing page? The
> Outreachy round opened today, and I would love to get your project
> listed as a participating org:
> 
> https://wiki.gnome.org/Outreachy/2016/DecemberMarch

our outreachy page is at
https://trac.ffmpeg.org/wiki/SponsoringPrograms/Outreachy/2016-12
sorry for not replying sooner, i thought someone else was taking care
of that


> 
> Thanks,
> Sarah Sharp
> 
> On Wed, Aug 31, 2016 at 7:23 PM, Sarah A Sharp  wrote:
> > On Fri, Aug 26, 2016 at 10:06 AM, Stefano Sabatini  
> > wrote:
> >> In data Wednesday 2016-08-24 02:07:17 +0200, Michael Niedermayer ha 
> >> scritto:
> >>> Hi Sarah
> >>>
> >>> On Tue, Aug 23, 2016 at 10:04:55AM -0700, Sarah A Sharp wrote:
> >>> > Hi Michael,
> >>> >
> >>> > I'm happy to hear FFmpeg will participate again! Do you know who will
> >>> > sponsor your intern(s) and how many interns you have funding for?
> >>>
> >>> please see:
> >>> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-July/197081.html
> >>> (http://ffmpeg.org/pipermail/ffmpeg-devel/2016-July/196956.html)
> >>>
> >>
> >>> I belive we have funding for 1 FFmpeg outreachy intern
> >>> (this assumes that a qualified intern is found)
> >>> CCing stefano, please correct me if thats not so
> >>
> >> Yes, that's correct.
> >
> > Great! Can you please send me a link to your landing page for this
> > round? Directions for creating a landing page can be found here:
> >
> > https://wiki.gnome.org/Outreachy/Admin/GettingStarted#For_Coordinators
> >
> > What blurb do you want to use for the Outreachy round wiki page? The
> > blurb I have from last round is:
> >
> > "FFmpeg is the universal multimedia toolkit: a complete,
> > cross-platform solution to record, convert, filter and stream audio
> > and video. Available projects like FFv1 codecs frame support, scaling
> > improvement, and adding selftests involve coding in C. Another project
> > involves creating a fuzzing testsuite and a web interface for it in
> > Python or node.js."
> >
> > Also, is there a deadline you need to be invoiced by? Outreachy will
> > be invoicing in early December, but we can invoice you sooner if
> > necessary. Stefano, are you the right contact to invoice, or is there
> > another contact that needs to be invoiced?
> >
> > Sarah Sharp
> 

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


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 Thread Steven Liu
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] FFmpeg in Outreachy Round 13 / 2016-december

2016-09-12 Thread Sarah A Sharp
Thanks Michael! I also need an update project description for the round page:

https://wiki.gnome.org/action/edit/Outreachy/2016/DecemberMarch

I'm currently using:

"FFmpeg is the universal multimedia toolkit: a complete,
cross-platform solution to record, convert, filter and stream audio
and video."

If you want to update it with a short description of the type of
projects you're offering (e.g. programming languages, required skills,
etc), please let me know.

Sarah Sharp

On Mon, Sep 12, 2016 at 8:01 PM, Michael Niedermayer
 wrote:
> On Mon, Sep 12, 2016 at 06:35:01PM -0700, Sarah A Sharp wrote:
>> Hi Michael,
>>
>> Can you please send me a link to the FFmpeg landing page? The
>> Outreachy round opened today, and I would love to get your project
>> listed as a participating org:
>>
>> https://wiki.gnome.org/Outreachy/2016/DecemberMarch
>
> our outreachy page is at
> https://trac.ffmpeg.org/wiki/SponsoringPrograms/Outreachy/2016-12
> sorry for not replying sooner, i thought someone else was taking care
> of that
>
>
>>
>> Thanks,
>> Sarah Sharp
>>
>> On Wed, Aug 31, 2016 at 7:23 PM, Sarah A Sharp  wrote:
>> > On Fri, Aug 26, 2016 at 10:06 AM, Stefano Sabatini  
>> > wrote:
>> >> In data Wednesday 2016-08-24 02:07:17 +0200, Michael Niedermayer ha 
>> >> scritto:
>> >>> Hi Sarah
>> >>>
>> >>> On Tue, Aug 23, 2016 at 10:04:55AM -0700, Sarah A Sharp wrote:
>> >>> > Hi Michael,
>> >>> >
>> >>> > I'm happy to hear FFmpeg will participate again! Do you know who will
>> >>> > sponsor your intern(s) and how many interns you have funding for?
>> >>>
>> >>> please see:
>> >>> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-July/197081.html
>> >>> (http://ffmpeg.org/pipermail/ffmpeg-devel/2016-July/196956.html)
>> >>>
>> >>
>> >>> I belive we have funding for 1 FFmpeg outreachy intern
>> >>> (this assumes that a qualified intern is found)
>> >>> CCing stefano, please correct me if thats not so
>> >>
>> >> Yes, that's correct.
>> >
>> > Great! Can you please send me a link to your landing page for this
>> > round? Directions for creating a landing page can be found here:
>> >
>> > https://wiki.gnome.org/Outreachy/Admin/GettingStarted#For_Coordinators
>> >
>> > What blurb do you want to use for the Outreachy round wiki page? The
>> > blurb I have from last round is:
>> >
>> > "FFmpeg is the universal multimedia toolkit: a complete,
>> > cross-platform solution to record, convert, filter and stream audio
>> > and video. Available projects like FFv1 codecs frame support, scaling
>> > improvement, and adding selftests involve coding in C. Another project
>> > involves creating a fuzzing testsuite and a web interface for it in
>> > Python or node.js."
>> >
>> > Also, is there a deadline you need to be invoiced by? Outreachy will
>> > be invoicing in early December, but we can invoice you sooner if
>> > necessary. Stefano, are you the right contact to invoice, or is there
>> > another contact that needs to be invoiced?
>> >
>> > Sarah Sharp
>>
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Democracy is the form of government in which you can choose your dictator
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel