[FFmpeg-devel] [PATCH] configure: add missing optional SDL2 dependency to OpenGL outdev

2018-10-18 Thread James Almer
Signed-off-by: James Almer 
---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 85d5dd5962..c91e37a75d 100755
--- a/configure
+++ b/configure
@@ -3267,6 +3267,7 @@ libcdio_indev_deps="libcdio"
 libdc1394_indev_deps="libdc1394"
 openal_indev_deps="openal"
 opengl_outdev_deps="opengl"
+opengl_outdev_suggest="sdl2"
 oss_indev_deps_any="sys_soundcard_h"
 oss_outdev_deps_any="sys_soundcard_h"
 pulse_indev_deps="libpulse"
@@ -6903,7 +6904,7 @@ enabled zoompan_filter  && prepend avfilter_deps 
"swscale"
 enabled lavfi_indev && prepend avdevice_deps "avfilter"
 
 #FIXME
-enabled sdl2_outdev && add_cflags $(filter_out '-Dmain=SDL_main' 
$sdl2_cflags)
+enabled_any sdl2_outdev opengl_outdev && enabled sdl2 && add_cflags 
$(filter_out '-Dmain=SDL_main' $sdl2_cflags)
 
 enabled opus_decoder&& prepend avcodec_deps "swresample"
 
-- 
2.19.0

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


[FFmpeg-devel] [PATCH] fftools/ffmpeg.c: allow forcing input framerate on streamcopy

2018-10-18 Thread Leo Izen
---
 fftools/ffmpeg.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index da4259a9a8..5d68194676 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2045,12 +2045,14 @@ static void do_streamcopy(InputStream *ist, 
OutputStream *ost, const AVPacket *p
 if (ost->enc_ctx->codec_type == AVMEDIA_TYPE_VIDEO)
 ost->sync_opts++;
 
-if (pkt->pts != AV_NOPTS_VALUE)
+if (ist->framerate.num)
+opkt.pts = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ost->mux_timebase) - 
ost_tb_start_time;
+else if (pkt->pts != AV_NOPTS_VALUE)
 opkt.pts = av_rescale_q(pkt->pts, ist->st->time_base, 
ost->mux_timebase) - ost_tb_start_time;
 else
 opkt.pts = AV_NOPTS_VALUE;
 
-if (pkt->dts == AV_NOPTS_VALUE)
+if (pkt->dts == AV_NOPTS_VALUE || ist->framerate.num)
 opkt.dts = av_rescale_q(ist->dts, AV_TIME_BASE_Q, ost->mux_timebase);
 else
 opkt.dts = av_rescale_q(pkt->dts, ist->st->time_base, 
ost->mux_timebase);
@@ -2602,7 +2604,7 @@ static int process_input_packet(InputStream *ist, const 
AVPacket *pkt, int no_eo
 avpkt = *pkt;
 }
 
-if (pkt && pkt->dts != AV_NOPTS_VALUE) {
+if (pkt && pkt->dts != AV_NOPTS_VALUE && !ist->framerate.num) {
 ist->next_dts = ist->dts = av_rescale_q(pkt->dts, ist->st->time_base, 
AV_TIME_BASE_Q);
 if (ist->dec_ctx->codec_type != AVMEDIA_TYPE_VIDEO || 
!ist->decoding_needed)
 ist->next_pts = ist->pts = ist->dts;
-- 
2.19.1

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


Re: [FFmpeg-devel] [PATCH]lavf/dump: Fix a typo: comentary -> commentary

2018-10-18 Thread Michael Niedermayer
On Thu, Oct 18, 2018 at 12:15:40AM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Is there a reason to keep the wrong spelling?

i dont see a reason but maybe someone else does ...



[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott



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


Re: [FFmpeg-devel] avcodec/prores aw improvment

2018-10-18 Thread Martin Vignali
Pushed.

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


Re: [FFmpeg-devel] swscale : add YA16 LE/BE output

2018-10-18 Thread Martin Vignali
>
> should be ok if you tested each function (that is confirmed
> vissually that both alpha and luma channels look ok for all 3
> functions)
>
>
Yes i tested each func with various input
also checked the result of the scale filter test

Pushed, Thanks.

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


Re: [FFmpeg-devel] [PATCH] avfilter: add sinc source filter

2018-10-18 Thread James Almer
On 10/18/2018 3:09 PM, Paul B Mahol wrote:
> +if (!phase1) {
> +begin = 0;
> +} else if (phase1 == 1) {
> +begin = peak - *len / 2;
> +} else {
> +begin = (.997f - (2 - phase1) * .22f) * *len + .5f;
> +end = (.997f + (0 - phase1) * .22f) * *len + .5f;
> +begin = peak - (begin & ~3);
> +end = peak + 1 + ((end + 3) & ~3);
> +*len = end - begin;
> +*h = av_realloc(*h, *len * sizeof(**h));

Either do

*h = av_realloc_f(*h, *len, sizeof(**h));

Or use a temp variable, then manually free *h on failure. Otherwise
you're leaking the original buffer if it failed to be reallocated.

> +if (!*h) {
> +av_free(pi_wraps);
> +av_free(work);
> +return AVERROR(ENOMEM);
> +}
> +}

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


Re: [FFmpeg-devel] [PATCH] avformat: add H264 and HEVC support in IVF muxer

2018-10-18 Thread Alex Sukhanov
On Mon, Oct 15, 2018 at 9:35 AM Vittorio Giovara 
wrote:

> On Thu, Oct 11, 2018 at 5:28 PM Jan Ekström  wrote:
>
> > On Thu, Oct 11, 2018 at 10:58 PM Alex Sukhanov 
> > wrote:
> > >
> > > Hi Mark,
> > >
> > > at Google we have some old service which is still running and it works
> > only
> > > with the IVF container. It would be great if ffmpeg could generate such
> > > videos so we could give them to the service then. Given that ffmpeg IVF
> > > demuxer already supports reading such files, I think it's reasonable to
> > > make IVF muxer be able to generate them.
> > > Hope it answers the question.
> > >
> > > Thank you
> >
> > Given the amount of code is not large I'm not against having it in,
> > but if it's not something that ever was meant to go into the public
> > I'd probably disable creation of such files unless you enable a less
> > standards-compliant strictness mode.
> >
>
> maybe creation of such files could be allowed only with a strict compliance
> flag?
> --
> Vittorio
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Vittorio,

can you please elaborate your proposal? Is there already a flag in ffmpeg
that we can consider use for that? What would be a benefit of guarding
h264/hevc muxing into the IVF container by the flag?
Thank you
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter: add sinc source filter

2018-10-18 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  43 
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/asrc_sinc.c  | 455 +++
 4 files changed, 500 insertions(+)
 create mode 100644 libavfilter/asrc_sinc.c

diff --git a/doc/filters.texi b/doc/filters.texi
index cadf78c93c..54b85c4bb9 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -5370,6 +5370,49 @@ Set number of samples per each frame.
 Set window function to be used when generating FIR coefficients.
 @end table
 
+@section sinc
+
+Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject 
FIR coefficients.
+
+The resulting stream can be used with @ref{afir} filter for filtering the 
audio signal.
+
+The filter accepts the following options:
+
+@table @option
+@item sample_rate, r
+Set sample rate, default is 44100.
+
+@item nb_samples, n
+Set number of samples per each frame. Default is 1024.
+
+@item hp
+Set high-pass frequency. Default is 0.
+
+@item lp
+Set low-pass frequency. Default is 0.
+If high-pass frequency is lower than low-pass frequency and low-pass frequency
+is higher than 0 then filter will create band-pass filter coefficients,
+otherwise band-reject filter coefficients.
+
+@item phase
+Set filter phase response. Default is 50. Allowed range is from 0 to 100.
+
+@item beta
+Set Kaiser window beta.
+
+@item att
+Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 
dB.
+
+@item round
+Enable rounding, by default is disabled.
+
+@item hptaps
+Set number of taps for high-pass filter.
+
+@item lptaps
+Set number of taps for low-pass filter.
+@end table
+
 @section sine
 
 Generate an audio signal made of a sine wave with amplitude 1/8.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 62cc2f561f..b03b2457eb 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -141,6 +141,7 @@ OBJS-$(CONFIG_ANOISESRC_FILTER)  += 
asrc_anoisesrc.o
 OBJS-$(CONFIG_ANULLSRC_FILTER)   += asrc_anullsrc.o
 OBJS-$(CONFIG_FLITE_FILTER)  += asrc_flite.o
 OBJS-$(CONFIG_HILBERT_FILTER)+= asrc_hilbert.o
+OBJS-$(CONFIG_SINC_FILTER)   += asrc_sinc.o
 OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
 
 OBJS-$(CONFIG_ANULLSINK_FILTER)  += asink_anullsink.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 5e72803b13..725bac94a0 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -134,6 +134,7 @@ extern AVFilter ff_asrc_anoisesrc;
 extern AVFilter ff_asrc_anullsrc;
 extern AVFilter ff_asrc_flite;
 extern AVFilter ff_asrc_hilbert;
+extern AVFilter ff_asrc_sinc;
 extern AVFilter ff_asrc_sine;
 
 extern AVFilter ff_asink_anullsink;
diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c
new file mode 100644
index 00..b0145cfaa1
--- /dev/null
+++ b/libavfilter/asrc_sinc.c
@@ -0,0 +1,455 @@
+/*
+ * Copyright (c) 2008-2009 Rob Sykes 
+ * Copyright (c) 2017 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/opt.h"
+
+#include "libavcodec/avfft.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "internal.h"
+
+typedef struct SincContext {
+const AVClass *class;
+
+int sample_rate, nb_samples;
+float att, beta, phase, Fc0, Fc1, tbw0, tbw1;
+int num_taps[2];
+int round;
+
+int n, rdft_len;
+float *coeffs;
+int64_t pts;
+
+RDFTContext *rdft, *irdft;
+} SincContext;
+
+static int request_frame(AVFilterLink *outlink)
+{
+AVFilterContext *ctx = outlink->src;
+SincContext *s = ctx->priv;
+const float *coeffs = s->coeffs;
+AVFrame *frame = NULL;
+int nb_samples;
+
+nb_samples = FFMIN(s->nb_samples, s->n - s->pts);
+if (nb_samples <= 0)
+return AVERROR_EOF;
+
+if (!(frame = ff_get_audio_buffer(outlink, nb_samples)))
+return AVERROR(ENOMEM);
+
+memcpy(frame->data[0], coeffs + s->pts, nb_samples * sizeof(float));
+
+frame->pts = s->pts;
+s->pts+= nb_samples;
+
+return ff_filter_frame(outlink, frame);
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+SincContext *s = ctx->priv;
+

[FFmpeg-devel] [PATCH] avfilter: add sinc source filter

2018-10-18 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  43 
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/asrc_sinc.c  | 454 +++
 4 files changed, 499 insertions(+)
 create mode 100644 libavfilter/asrc_sinc.c

diff --git a/doc/filters.texi b/doc/filters.texi
index cadf78c93c..54b85c4bb9 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -5370,6 +5370,49 @@ Set number of samples per each frame.
 Set window function to be used when generating FIR coefficients.
 @end table
 
+@section sinc
+
+Generate a sinc kaiser-windowed low-pass, high-pass, band-pass, or band-reject 
FIR coefficients.
+
+The resulting stream can be used with @ref{afir} filter for filtering the 
audio signal.
+
+The filter accepts the following options:
+
+@table @option
+@item sample_rate, r
+Set sample rate, default is 44100.
+
+@item nb_samples, n
+Set number of samples per each frame. Default is 1024.
+
+@item hp
+Set high-pass frequency. Default is 0.
+
+@item lp
+Set low-pass frequency. Default is 0.
+If high-pass frequency is lower than low-pass frequency and low-pass frequency
+is higher than 0 then filter will create band-pass filter coefficients,
+otherwise band-reject filter coefficients.
+
+@item phase
+Set filter phase response. Default is 50. Allowed range is from 0 to 100.
+
+@item beta
+Set Kaiser window beta.
+
+@item att
+Set stop-band attenuation. Default is 120dB, allowed range is from 40 to 180 
dB.
+
+@item round
+Enable rounding, by default is disabled.
+
+@item hptaps
+Set number of taps for high-pass filter.
+
+@item lptaps
+Set number of taps for low-pass filter.
+@end table
+
 @section sine
 
 Generate an audio signal made of a sine wave with amplitude 1/8.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 62cc2f561f..b03b2457eb 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -141,6 +141,7 @@ OBJS-$(CONFIG_ANOISESRC_FILTER)  += 
asrc_anoisesrc.o
 OBJS-$(CONFIG_ANULLSRC_FILTER)   += asrc_anullsrc.o
 OBJS-$(CONFIG_FLITE_FILTER)  += asrc_flite.o
 OBJS-$(CONFIG_HILBERT_FILTER)+= asrc_hilbert.o
+OBJS-$(CONFIG_SINC_FILTER)   += asrc_sinc.o
 OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
 
 OBJS-$(CONFIG_ANULLSINK_FILTER)  += asink_anullsink.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 5e72803b13..725bac94a0 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -134,6 +134,7 @@ extern AVFilter ff_asrc_anoisesrc;
 extern AVFilter ff_asrc_anullsrc;
 extern AVFilter ff_asrc_flite;
 extern AVFilter ff_asrc_hilbert;
+extern AVFilter ff_asrc_sinc;
 extern AVFilter ff_asrc_sine;
 
 extern AVFilter ff_asink_anullsink;
diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c
new file mode 100644
index 00..bbb3ef45a4
--- /dev/null
+++ b/libavfilter/asrc_sinc.c
@@ -0,0 +1,454 @@
+/*
+ * Copyright (c) 2008-2009 Rob Sykes 
+ * Copyright (c) 2017 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/opt.h"
+
+#include "libavcodec/avfft.h"
+
+#include "audio.h"
+#include "avfilter.h"
+#include "internal.h"
+
+typedef struct SincContext {
+const AVClass *class;
+
+int sample_rate, nb_samples;
+float att, beta, phase, Fc0, Fc1, tbw0, tbw1;
+int num_taps[2];
+int round;
+
+int n, rdft_len;
+float *coeffs;
+int64_t pts;
+
+RDFTContext *rdft, *irdft;
+} SincContext;
+
+static int request_frame(AVFilterLink *outlink)
+{
+AVFilterContext *ctx = outlink->src;
+SincContext *s = ctx->priv;
+const float *coeffs = s->coeffs;
+AVFrame *frame = NULL;
+int nb_samples;
+
+nb_samples = FFMIN(s->nb_samples, s->n - s->pts);
+if (nb_samples <= 0)
+return AVERROR_EOF;
+
+if (!(frame = ff_get_audio_buffer(outlink, nb_samples)))
+return AVERROR(ENOMEM);
+
+memcpy(frame->data[0], coeffs + s->pts, nb_samples * sizeof(float));
+
+frame->pts = s->pts;
+s->pts+= nb_samples;
+
+return ff_filter_frame(outlink, frame);
+}
+
+static int query_formats(AVFilterContext *ctx)
+{
+SincContext *s = ctx->priv;
+

Re: [FFmpeg-devel] [PATCH V2] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs

2018-10-18 Thread Guo, Yejun
Hi,

Besides conv layer, this model uses these operations/layers: 
PoolLayer, split, ConcatLayer, BatchNormLayer, DeConv2dLayer, reduce_max, 
maximum, mul, pow, log, exp, relu, add, minimum, reshape, tile, 

see detail in https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Pedro Arthur
> Sent: Thursday, October 18, 2018 2:15 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V2] Add a filter implementing HDR
> image reconstruction from a single exposure using deep CNNs
> 
> Hi,
> 
> How hard is it to support the native backend? which operations are missing
> or any other limitations?
> 
> Em qua, 17 de out de 2018 às 05:47, Guo, Yejun 
> escreveu:
> >
> > see the algorithm's paper and code below.
> >
> > the filter's parameter looks like:
> >
> sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmt=gbrp10l
> e
> >
> > The input of the deep CNN model is RGB24 while the output is float for
> > each color channel. This is the filter's default behavior to output
> > format with gbrpf32le. And gbrp10le is also supported as the output,
> > so we can see the rendering result in a player, as a reference.
> >
> > To generate the model file, we need modify the original script a little.
> > - set name='y' for y_final within script at
> > https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py
> > - add the following code to the script at
> > https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict.
> > py
> >
> > graph = tf.graph_util.convert_variables_to_constants(sess,
> > sess.graph_def, ["y"]) tf.train.write_graph(graph, '.', 'graph.pb',
> > as_text=False)
> >
> > The filter only works when tensorflow C api is supported in the
> > system, native backend is not supported since there are some different
> > types of layers in the deep CNN model, besides CONV and
> DEPTH_TO_SPACE.
> >
> > https://arxiv.org/pdf/1710.07480.pdf:
> >   author   = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy
> and Mantiuk, Rafał and Unger, Jonas",
> >   title= "HDR image reconstruction from a single exposure using deep
> CNNs",
> >   journal  = "ACM Transactions on Graphics (TOG)",
> >   number   = "6",
> >   volume   = "36",
> >   articleno= "178",
> >   year = "2017"
> >
> > https://github.com/gabrieleilertsen/hdrcnn
> >
> > btw, as a whole solution, metadata should also be generated from the
> > sdr video, so to be encoded as a HDR video. Not supported yet.
> > This patch just focuses on this paper.
> >
> > v2: use AV_OPT_TYPE_PIXEL_FMT for filter option
> > remove some unnecessary code
> > Use in->linesize[0] and FFMAX/FFMIN
> > remove flag AVFILTER_FLAG_SLICE_THREADS
> > add av_log message when error
> >
> > Signed-off-by: Guo, Yejun 
> > ---
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/vf_sdr2hdr.c | 266
> > +++
> >  3 files changed, 268 insertions(+)
> >  create mode 100644 libavfilter/vf_sdr2hdr.c
> >
> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index
> > 62cc2f5..88e7da6 100644
> > --- a/libavfilter/Makefile
> > +++ b/libavfilter/Makefile
> > @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER)   +=
> vf_convolution_opencl.o opencl.o
> >  OBJS-$(CONFIG_SPLIT_FILTER)  += split.o
> >  OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o
> >  OBJS-$(CONFIG_SR_FILTER) += vf_sr.o
> > +OBJS-$(CONFIG_SDR2HDR_FILTER)+= vf_sdr2hdr.o
> >  OBJS-$(CONFIG_SSIM_FILTER)   += vf_ssim.o framesync.o
> >  OBJS-$(CONFIG_STEREO3D_FILTER)   += vf_stereo3d.o
> >  OBJS-$(CONFIG_STREAMSELECT_FILTER)   += f_streamselect.o
> framesync.o
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index
> > 5e72803..1645c0f 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -319,6 +319,7 @@ extern AVFilter ff_vf_scale_npp;  extern AVFilter
> > ff_vf_scale_qsv;  extern AVFilter ff_vf_scale_vaapi;  extern AVFilter
> > ff_vf_scale2ref;
> > +extern AVFilter ff_vf_sdr2hdr;
> >  extern AVFilter ff_vf_select;
> >  extern AVFilter ff_vf_selectivecolor;  extern AVFilter ff_vf_sendcmd;
> > diff --git a/libavfilter/vf_sdr2hdr.c b/libavfilter/vf_sdr2hdr.c new
> > file mode 100644 index 000..fa61bfa
> > --- /dev/null
> > +++ b/libavfilter/vf_sdr2hdr.c
> > @@ -0,0 +1,266 @@
> > +/*
> > + * Copyright (c) 2018 Guo Yejun
> > + *
> > + * This file is part of FFmpeg.
> > + *
> > + * FFmpeg is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU Lesser General Public
> > + * License as published by the Free Software Foundation; either
> > + * version 2.1 of the License, or (at your option) any later version.
> > + *
> > + 

[FFmpeg-devel] [PATCH v2 2/3] lavc/libxavs2: fix intra period meaning conflict

2018-10-18 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libxavs2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index 1152c63..f07fc63 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -85,8 +85,8 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
 xavs2_opt_set2("Log",   "%d", cae->log_level);
 xavs2_opt_set2("Preset","%d", cae->preset_level);
 
-/* not the same parameter as the IntraPeriod in xavs2 log */
-xavs2_opt_set2("IntraPeriod",   "%d", avctx->gop_size);
+xavs2_opt_set2("IntraPeriodMax","%d", avctx->gop_size);
+xavs2_opt_set2("IntraPeriodMin","%d", avctx->gop_size);
 
 xavs2_opt_set2("ThreadFrames",  "%d", avctx->thread_count);
 xavs2_opt_set2("ThreadRows","%d", cae->lcu_row_threads);
-- 
2.7.4

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


[FFmpeg-devel] [PATCH v2 3/3] lavc/libxavs2: enable OpenGop

2018-10-18 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libxavs2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index f07fc63..822af3f 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -91,7 +91,7 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
 xavs2_opt_set2("ThreadFrames",  "%d", avctx->thread_count);
 xavs2_opt_set2("ThreadRows","%d", cae->lcu_row_threads);
 
-xavs2_opt_set2("OpenGOP",  "%d", 1);
+xavs2_opt_set2("OpenGOP",  "%d", !(avctx->flags & 
AV_CODEC_FLAG_CLOSED_GOP));
 
 if (cae->xavs2_opts) {
 AVDictionary *dict= NULL;
-- 
2.7.4

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


[FFmpeg-devel] [PATCH v2 1/3] lavc/libxavs2: unified naming style

2018-10-18 Thread hwren
Signed-off-by: hwren 
---
 libavcodec/libxavs2.c | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/libxavs2.c b/libavcodec/libxavs2.c
index 2b47d0c..1152c63 100644
--- a/libavcodec/libxavs2.c
+++ b/libavcodec/libxavs2.c
@@ -78,18 +78,18 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
 return AVERROR(ENOMEM);
 }
 
-xavs2_opt_set2("width", "%d", avctx->width);
-xavs2_opt_set2("height","%d", avctx->height);
-xavs2_opt_set2("bframes",   "%d", avctx->max_b_frames);
-xavs2_opt_set2("bitdepth",  "%d", bit_depth);
-xavs2_opt_set2("log",   "%d", cae->log_level);
-xavs2_opt_set2("preset","%d", cae->preset_level);
+xavs2_opt_set2("Width", "%d", avctx->width);
+xavs2_opt_set2("Height","%d", avctx->height);
+xavs2_opt_set2("BFrames",   "%d", avctx->max_b_frames);
+xavs2_opt_set2("BitDepth",  "%d", bit_depth);
+xavs2_opt_set2("Log",   "%d", cae->log_level);
+xavs2_opt_set2("Preset","%d", cae->preset_level);
 
 /* not the same parameter as the IntraPeriod in xavs2 log */
-xavs2_opt_set2("intraperiod",   "%d", avctx->gop_size);
+xavs2_opt_set2("IntraPeriod",   "%d", avctx->gop_size);
 
-xavs2_opt_set2("thread_frames", "%d", avctx->thread_count);
-xavs2_opt_set2("thread_rows",   "%d", cae->lcu_row_threads);
+xavs2_opt_set2("ThreadFrames",  "%d", avctx->thread_count);
+xavs2_opt_set2("ThreadRows","%d", cae->lcu_row_threads);
 
 xavs2_opt_set2("OpenGOP",  "%d", 1);
 
@@ -109,11 +109,11 @@ static av_cold int xavs2_init(AVCodecContext *avctx)
 if (avctx->bit_rate > 0) {
 xavs2_opt_set2("RateControl",   "%d", 1);
 xavs2_opt_set2("TargetBitRate", "%"PRId64"", avctx->bit_rate);
-xavs2_opt_set2("initial_qp","%d", cae->initial_qp);
-xavs2_opt_set2("max_qp","%d", cae->max_qp);
-xavs2_opt_set2("min_qp","%d", cae->min_qp);
+xavs2_opt_set2("InitialQP", "%d", cae->initial_qp);
+xavs2_opt_set2("MaxQP", "%d", cae->max_qp);
+xavs2_opt_set2("MinQP", "%d", cae->min_qp);
 } else {
-xavs2_opt_set2("initial_qp","%d", cae->qp);
+xavs2_opt_set2("InitialQP", "%d", cae->qp);
 }
 
 
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH V2] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs

2018-10-18 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Carl Eugen Hoyos
> Sent: Thursday, October 18, 2018 6:23 AM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH V2] Add a filter implementing HDR
> image reconstruction from a single exposure using deep CNNs
> 
> 2018-10-17 18:41 GMT+02:00, Guo, Yejun :
> 
> > +short* outg = (short*)out->data[0];
> > +short* outb = (short*)out->data[1];
> > +short* outr = (short*)out->data[2];
> 
> I believe this should use "int16_t", there is no guarantee that short is 
> smaller
> than 128 bit.
> 

thanks will fix it to use int16_t.

> Carl Eugen
> ___
> 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] #7496: Access to the reference track (dolby vision) of a stream

2018-10-18 Thread Dmitrij.Gresserman
Here is my new approach with side data.

Visit our website: https://www.loewe.tv/int

[Facebook]  [Instagram] 
   [Pinterest] 
   [YouTube] 


Loewe Technologies GmbH, Industriestraße 11, 96317 Kronach
Tel. +49 9261 99-500 • Fax +49 9261 99-515
c...@loewe.de • www.loewe.tv

Executive Management: Mark Hüsges, Hans-Henning Doerr, Peter Nortmann, Dr. Ralf 
Vogt • Registered Office: Kronach • Commercial Register: Amtsgericht Coburg HRB 
5443
From ec14915807d79a9e2c4bbf082d07080fdc86a37b Mon Sep 17 00:00:00 2001
From: gressermdm 
Date: Thu, 18 Oct 2018 14:19:53 +0200
Subject: [PATCH] Access to the reference track (dolby vision) of a stream

---
 libavcodec/avcodec.h |  6 ++
 libavformat/dump.c   | 22 ++
 libavformat/mov.c| 23 +++
 3 files changed, 51 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 705a3ce..81b30dc 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1372,6 +1372,12 @@ enum AVPacketSideDataType {
 AV_PKT_DATA_AFD,
 
 /**
+ * This side data contains an integer value representing the
+ * reference to another dolby track.
+ */
+AV_PKT_DATA_REFERENCE_TRACK,
+
+/**
  * The number of side data types.
  * This is not part of the public API/ABI in the sense that it may
  * change when new side data types are added.
diff --git a/libavformat/dump.c b/libavformat/dump.c
index bc0f401..ef20070 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -380,6 +380,24 @@ static void dump_spherical(void *ctx, AVCodecParameters *par, AVPacketSideData *
 }
 }
 
+static void dump_reference_track(void *ctx, AVPacketSideData *sd)
+{
+uint32_t *track_id;
+
+if (sd->size < sizeof(uint32_t)) {
+av_log(ctx, AV_LOG_INFO, "invalid data");
+return;
+}
+
+track_id = (uint32_t *)sd->data;
+
+if (!track_id) {
+av_log(ctx, AV_LOG_INFO, "invalid data");
+return;
+}
+av_log(ctx, AV_LOG_INFO, "%"PRIu32"", *track_id);
+}
+
 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 {
 int i;
@@ -439,6 +457,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 case AV_PKT_DATA_CONTENT_LIGHT_LEVEL:
 dump_content_light_metadata(ctx, );
 break;
+case AV_PKT_DATA_REFERENCE_TRACK:
+av_log(ctx, AV_LOG_INFO, "reference track: ");
+dump_reference_track(ctx, );
+break;
 default:
 av_log(ctx, AV_LOG_INFO,
"unknown side data type %d (%d bytes)", sd.type, sd.size);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index ec57a05..922776e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -6658,6 +6658,28 @@ static int mov_read_dops(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 return 0;
 }
 
+static int mov_read_vdep(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+uint32_t *track_id;
+AVStream *st;
+int ret;
+
+track_id = av_mallocz(sizeof(uint32_t));
+if (!track_id)
+return AVERROR(ENOMEM);
+*track_id = (uint32_t)avio_rb32(pb);
+
+st = c->fc->streams[c->fc->nb_streams-1];
+ret = av_stream_add_side_data(st, AV_PKT_DATA_REFERENCE_TRACK,
+  (uint8_t *)track_id, sizeof(uint32_t));
+if (ret < 0) {
+av_freep(_id);
+return ret;
+}
+
+return 0;
+}
+
 static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('A','C','L','R'), mov_read_aclr },
 { MKTAG('A','P','R','G'), mov_read_avid },
@@ -6751,6 +6773,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = {
 { MKTAG('v','p','c','C'), mov_read_vpcc },
 { MKTAG('m','d','c','v'), mov_read_mdcv },
 { MKTAG('c','l','l','i'), mov_read_clli },
+{ MKTAG('v','d','e','p'), mov_read_vdep },
 { 0, NULL }
 };
 
-- 
2.7.4

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


[FFmpeg-devel] [PATCH] avfilter: add chromahold filter

2018-10-18 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi   | 20 
 libavfilter/Makefile   |  1 +
 libavfilter/allfilters.c   |  1 +
 libavfilter/vf_chromakey.c | 96 +-
 4 files changed, 116 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index cadf78c93c..0835a8ef43 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -6120,6 +6120,26 @@ Only deinterlace frames marked as interlaced.
 The default value is @code{all}.
 @end table
 
+@section chromahold
+Remove all color infomation for all colors except for certain one.
+
+The filter accepts the following options:
+
+@table @option
+@item color
+The color which will be not be replaced with neutral chroma.
+
+@item similarity
+Similarity percentage with the above color.
+0.01 matches only the exact key color, while 1.0 matches everything.
+
+@item yuv
+Signals that the color passed is already in YUV instead of RGB.
+
+Literal colors like "green" or "red" don't make sense with this enabled 
anymore.
+This can be used to pass exact YUV values as hexadecimal numbers.
+@end table
+
 @section chromakey
 YUV colorspace color/chroma keying.
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 62cc2f561f..077415a909 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -165,6 +165,7 @@ OBJS-$(CONFIG_BOXBLUR_FILTER)+= 
vf_boxblur.o boxblur.o
 OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \
 opencl/avgblur.o boxblur.o
 OBJS-$(CONFIG_BWDIF_FILTER)  += vf_bwdif.o
+OBJS-$(CONFIG_CHROMAHOLD_FILTER) += vf_chromakey.o
 OBJS-$(CONFIG_CHROMAKEY_FILTER)  += vf_chromakey.o
 OBJS-$(CONFIG_CIESCOPE_FILTER)   += vf_ciescope.o
 OBJS-$(CONFIG_CODECVIEW_FILTER)  += vf_codecview.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 5e72803b13..6078a948d2 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -155,6 +155,7 @@ extern AVFilter ff_vf_bm3d;
 extern AVFilter ff_vf_boxblur;
 extern AVFilter ff_vf_boxblur_opencl;
 extern AVFilter ff_vf_bwdif;
+extern AVFilter ff_vf_chromahold;
 extern AVFilter ff_vf_chromakey;
 extern AVFilter ff_vf_ciescope;
 extern AVFilter ff_vf_codecview;
diff --git a/libavfilter/vf_chromakey.c b/libavfilter/vf_chromakey.c
index 88414783bc..42b7d71d49 100644
--- a/libavfilter/vf_chromakey.c
+++ b/libavfilter/vf_chromakey.c
@@ -38,6 +38,9 @@ typedef struct ChromakeyContext {
 
 int hsub_log2;
 int vsub_log2;
+
+int (*do_slice)(AVFilterContext *ctx, void *arg,
+int jobnr, int nb_jobs);
 } ChromakeyContext;
 
 static uint8_t do_chromakey_pixel(ChromakeyContext *ctx, uint8_t u[9], uint8_t 
v[9])
@@ -103,12 +106,45 @@ static int do_chromakey_slice(AVFilterContext *avctx, 
void *arg, int jobnr, int
 return 0;
 }
 
+static int do_chromahold_slice(AVFilterContext *avctx, void *arg, int jobnr, 
int nb_jobs)
+{
+ChromakeyContext *ctx = avctx->priv;
+AVFrame *frame = arg;
+const int slice_start = ((frame->height >> ctx->vsub_log2) * jobnr) / 
nb_jobs;
+const int slice_end = ((frame->height >> ctx->vsub_log2) * (jobnr + 1)) / 
nb_jobs;
+
+int x, y, alpha;
+
+for (y = slice_start; y < slice_end; ++y) {
+for (x = 0; x < frame->width >> ctx->hsub_log2; ++x) {
+int u = frame->data[1][frame->linesize[1] * y + x];
+int v = frame->data[2][frame->linesize[2] * y + x];
+double diff;
+int du, dv;
+
+du = u - ctx->chromakey_uv[0];
+dv = v - ctx->chromakey_uv[1];
+
+diff = sqrt((du * du + dv * dv) / (255.0 * 255.0));
+
+alpha = diff > ctx->similarity;
+if (alpha) {
+frame->data[1][frame->linesize[1] * y + x] = 128;
+frame->data[2][frame->linesize[2] * y + x] = 128;
+}
+}
+}
+
+return 0;
+}
+
 static int filter_frame(AVFilterLink *link, AVFrame *frame)
 {
 AVFilterContext *avctx = link->dst;
+ChromakeyContext *ctx = avctx->priv;
 int res;
 
-if (res = avctx->internal->execute(avctx, do_chromakey_slice, frame, NULL, 
FFMIN(frame->height, ff_filter_get_nb_threads(avctx
+if (res = avctx->internal->execute(avctx, ctx->do_slice, frame, NULL, 
FFMIN(frame->height, ff_filter_get_nb_threads(avctx
 return res;
 
 return ff_filter_frame(avctx->outputs[0], frame);
@@ -130,6 +166,12 @@ static av_cold int initialize_chromakey(AVFilterContext 
*avctx)
 ctx->chromakey_uv[1] = RGB_TO_V(ctx->chromakey_rgba);
 }
 
+if (!strcmp(avctx->filter->name, "chromakey")) {
+ctx->do_slice = do_chromakey_slice;
+} else {
+ctx->do_slice = do_chromahold_slice;
+}
+
 return 0;
 }
 
@@ -142,9 +184,19 @@ static av_cold int query_formats(AVFilterContext *avctx)
 AV_PIX_FMT_NONE
 };
 
+static 

[FFmpeg-devel] [PATCH] avformat/dashenc: URL close unconditionally after DELETE segments

2018-10-18 Thread Karthick J
Fixes bug with HTTP DELETE when HTTP Persistent is ON.
Right now, HTTP Persistent connections is supported only for POSTs and PUTs.
HTTP DELETE will still open a new connection every time.
---
 libavformat/dashenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 15b84a0f3b..b0a59af3ee 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1253,7 +1253,7 @@ static void dashenc_delete_file(AVFormatContext *s, char 
*filename) {
 }
 
 av_dict_free(_opts);
-dashenc_io_close(s, , filename);
+ff_format_io_close(s, );
 } else if (unlink(filename) < 0) {
 av_log(s, AV_LOG_ERROR, "failed to delete %s: %s\n", filename, 
strerror(errno));
 }
-- 
2.17.1 (Apple Git-112)

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


Re: [FFmpeg-devel] [PATCH] avcodec/libopenh264enc.c: Handle sample_aspect_ratio in libopenh264 encoder

2018-10-18 Thread Valery Kot
A gentle ping...
On Fri, Oct 12, 2018 at 9:14 AM Valery Kot  wrote:
>
> When using libx264 (GPL) encoder, sample aspect ratio gets stored on
> both container and frame levels. For libopenh264 (LGPL) encoder,
> aspect ratio on codec/frame level currently is ignored, which results
> in weird display aspect ratio for non-square pixels on some players.
>
> Proposed patch fixes that, if FFmpeg being build against libopenh264
> 1.7 or newer.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/dashenc: Support HTTP Persistent for master.mu8 as well

2018-10-18 Thread Karthick J
---
 libavformat/dashenc.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 3f5f290e25..15b84a0f3b 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final)
 snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : 
"%s", filename_hls);
 
 set_http_options(, c);
-ret = avio_open2(, temp_filename, AVIO_FLAG_WRITE, NULL, );
+ret = dashenc_io_open(s, >m3u8_out, temp_filename, );
 if (ret < 0) {
 av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", 
temp_filename);
 return ret;
 }
 av_dict_free();
 
-ff_hls_write_playlist_version(out, 7);
+ff_hls_write_playlist_version(c->m3u8_out, 7);
 
 for (i = 0; i < s->nb_streams; i++) {
 char playlist_file[64];
@@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final)
 if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO)
 continue;
 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, 
i);
-ff_hls_write_audio_rendition(out, (char *)audio_group,
+ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group,
  playlist_file, i, is_default);
 max_audio_bitrate = FFMAX(st->codecpar->bit_rate +
   os->muxer_overhead, max_audio_bitrate);
@@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final)
 av_strlcat(codec_str, audio_codec_str, sizeof(codec_str));
 }
 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, 
i);
-ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, 
agroup,
+ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate,
+ playlist_file, agroup,
  codec_str, NULL);
 }
-avio_close(out);
+dashenc_io_close(s, >m3u8_out, temp_filename);
 if (use_rename)
 if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0)
 return ret;
-- 
2.17.1 (Apple Git-112)

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


[FFmpeg-devel] [PATCH v2] avformat/dashenc: Support HTTP Persistent for master.m3u8 as well

2018-10-18 Thread Karthick J
---
 libavformat/dashenc.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 3f5f290e25..15b84a0f3b 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final)
 snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : 
"%s", filename_hls);
 
 set_http_options(, c);
-ret = avio_open2(, temp_filename, AVIO_FLAG_WRITE, NULL, );
+ret = dashenc_io_open(s, >m3u8_out, temp_filename, );
 if (ret < 0) {
 av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", 
temp_filename);
 return ret;
 }
 av_dict_free();
 
-ff_hls_write_playlist_version(out, 7);
+ff_hls_write_playlist_version(c->m3u8_out, 7);
 
 for (i = 0; i < s->nb_streams; i++) {
 char playlist_file[64];
@@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final)
 if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO)
 continue;
 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, 
i);
-ff_hls_write_audio_rendition(out, (char *)audio_group,
+ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group,
  playlist_file, i, is_default);
 max_audio_bitrate = FFMAX(st->codecpar->bit_rate +
   os->muxer_overhead, max_audio_bitrate);
@@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final)
 av_strlcat(codec_str, audio_codec_str, sizeof(codec_str));
 }
 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, 
i);
-ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, 
agroup,
+ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate,
+ playlist_file, agroup,
  codec_str, NULL);
 }
-avio_close(out);
+dashenc_io_close(s, >m3u8_out, temp_filename);
 if (use_rename)
 if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0)
 return ret;
-- 
2.17.1 (Apple Git-112)

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


[FFmpeg-devel] [PATCH] avformat/dashenc: Support HTTP Persistent for master.mu8 as well

2018-10-18 Thread Karthick J
---
 libavformat/dashenc.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 3f5f290e25..15b84a0f3b 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final)
 snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : 
"%s", filename_hls);
 
 set_http_options(, c);
-ret = avio_open2(, temp_filename, AVIO_FLAG_WRITE, NULL, );
+ret = dashenc_io_open(s, >m3u8_out, temp_filename, );
 if (ret < 0) {
 av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", 
temp_filename);
 return ret;
 }
 av_dict_free();
 
-ff_hls_write_playlist_version(out, 7);
+ff_hls_write_playlist_version(c->m3u8_out, 7);
 
 for (i = 0; i < s->nb_streams; i++) {
 char playlist_file[64];
@@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final)
 if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO)
 continue;
 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, 
i);
-ff_hls_write_audio_rendition(out, (char *)audio_group,
+ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group,
  playlist_file, i, is_default);
 max_audio_bitrate = FFMAX(st->codecpar->bit_rate +
   os->muxer_overhead, max_audio_bitrate);
@@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final)
 av_strlcat(codec_str, audio_codec_str, sizeof(codec_str));
 }
 get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, 
i);
-ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, 
agroup,
+ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate,
+ playlist_file, agroup,
  codec_str, NULL);
 }
-avio_close(out);
+dashenc_io_close(s, >m3u8_out, temp_filename);
 if (use_rename)
 if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0)
 return ret;
-- 
2.17.1 (Apple Git-112)

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