Re: [FFmpeg-devel] No way to pass options to TCP through HLS

2019-11-23 Thread Tom Gaudasiński
This appears to have been raised before in almost exactly the same form:
https://lists.ffmpeg.org/pipermail/libav-user/2015-January/007841.html


On 24/11/19 1:41 pm, Tom Gaudasiński wrote:
> I supply an options dictionary to avformat_open_input(). The first stack
> trace passes the option correctly down to tcp.c, because the stack is:
>
> #0 tcp_open
> #1 ffurl_connect
> #2 ffurl_open_whitelist
> #3 http_open_cnx_internal
> #4 http_open_cnx
> #5 http_open
> #6 ffurl_connect
> #7 ffurl_open_whitelist
> #8 ffio_open_whitelist
> #9 io_open_default
> #10 init_input
> #11 avformat_open_input
>
> However, this is the connection to retrieve th m3u8 file. Which, in
> turn, causes ffmpeg to open a HLS stream, where the stack is:
>
> #0  open_url
> #1  open_input
> #2  read_data
> #3  read_packet_wrapper
> #4  fill_buffer
> #5  avio_read
> #6  av_probe_input_buffer2
> #7  av_probe_input_buffer
> #8  hls_read_header
> #9  avformat_open_input
>
> But in hls.c, in open_input(), the options dict is initialised as NULL.
> c->avio_opts is passed down to open_url, but that doesn't contain my
> options.
>
> How do I specify options at the ffmpeg API level to make sure they
> propagate down the stack all the way to the underlying protocol?
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] No way to pass options to TCP through HLS

2019-11-23 Thread Tom Gaudasiński
I supply an options dictionary to avformat_open_input(). The first stack
trace passes the option correctly down to tcp.c, because the stack is:

#0 tcp_open
#1 ffurl_connect
#2 ffurl_open_whitelist
#3 http_open_cnx_internal
#4 http_open_cnx
#5 http_open
#6 ffurl_connect
#7 ffurl_open_whitelist
#8 ffio_open_whitelist
#9 io_open_default
#10 init_input
#11 avformat_open_input

However, this is the connection to retrieve th m3u8 file. Which, in
turn, causes ffmpeg to open a HLS stream, where the stack is:

#0  open_url
#1  open_input
#2  read_data
#3  read_packet_wrapper
#4  fill_buffer
#5  avio_read
#6  av_probe_input_buffer2
#7  av_probe_input_buffer
#8  hls_read_header
#9  avformat_open_input

But in hls.c, in open_input(), the options dict is initialised as NULL.
c->avio_opts is passed down to open_url, but that doesn't contain my
options.

How do I specify options at the ffmpeg API level to make sure they
propagate down the stack all the way to the underlying protocol?


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v2 3/3] bavfilter/vsrc_life: Fix for random_seed type

2019-11-23 Thread Limin Wang
On Sat, Nov 23, 2019 at 09:14:35PM +0100, Moritz Barsnick wrote:
> On Fri, Nov 22, 2019 at 09:48:04 +0800, lance.lmw...@gmail.com wrote:
> > From: Limin Wang 
> > Subject: bavfilter/vsrc_life: Fix for random_seed type
>^
> There's a stray letter in that line. (Also in another patch.)

Yes, good catch, I have send the update version immediately after 
get the mail. It seems that I should reply the thread to ignore it,
sorry for that.

> 
> Moritz
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v6 1/3] hevc_mp4toannexb: Insert correct parameter sets before IRAP

2019-11-23 Thread Michael Niedermayer
On Tue, Oct 15, 2019 at 10:50:39PM -0400, Andriy Gelman wrote:
> From: Andriy Gelman 
> 
> Fixes #7799
> 
> Currently, the mp4toannexb filter always inserts the same extradata at
> the start of the first IRAP unit. As in ticket #7799, this can lead to
> decoding errors if modified parameter sets are signalled in-band.
> 
> Decoding errors/visual artifacts are also present in the following 
> fate-suite/hevc-conformance datasets for hevc->mp4->hevc conversion:
>  -RAP_B_Bossen_1.bit
>  -RPS_C_ericsson_5.bit
>  -SLIST_A_Sony_4.bit
>  -SLIST_B_Sony_8.bit
>  -SLIST_C_Sony_3.bit
>  -SLIST_D_Sony_9.bit
>  -TSKIP_A_MS_2.bit
> 
> This commit solves these errors by keeping track of VPS/SPS/PPS parameter sets
> during the conversion. The correct combination is inserted at the start
> of the first IRAP. SEIs from extradata are inserted before each IRAP.
> 
> This commit also makes an update to the hevc-bsf-mp4toannexb fate test
> since the result before this patch contained duplicate parameter sets
> in-band.
> ---
>  libavcodec/hevc_mp4toannexb_bsf.c | 503 --
>  tests/fate/hevc.mak   |   2 +-
>  2 files changed, 472 insertions(+), 33 deletions(-)
> 
> diff --git a/libavcodec/hevc_mp4toannexb_bsf.c 
> b/libavcodec/hevc_mp4toannexb_bsf.c
> index 09bce5b34c..1ca5f13807 100644
> --- a/libavcodec/hevc_mp4toannexb_bsf.c
> +++ b/libavcodec/hevc_mp4toannexb_bsf.c
> @@ -23,19 +23,224 @@
>  
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/mem.h"
> +#include "libavutil/avassert.h"
>  
>  #include "avcodec.h"
>  #include "bsf.h"
>  #include "bytestream.h"
>  #include "hevc.h"
> +#include "h2645_parse.h"
> +#include "hevc_ps.h"
> +#include "golomb.h"
>  
>  #define MIN_HEVCC_LENGTH 23
> +#define PROFILE_WITHOUT_IDC_BITS88

> +#define IS_IRAP(s)  ((s)->type >= 16 && (s)->type <= 23)

This is kind of duplicated, it would be more ideal if no macros are duplicated


> +#define IS_PARAMSET(s)  ((s)->type >= 32 && (s)->type <= 34)
> +
> +/*reserved VCLs not included*/
> +#define IS_VCL(s)   ((s)->type <= 9 || ((s)->type >= 16 && 
> (s)->type <= 21))
> +#define HEVC_NAL_HEADER_BITS16



[...]

> +static int parse_sps(AVBSFContext *ctx, H2645NAL *nal)
> +{
> +int i, ret;
> +int sps_id, vps_ref, max_sub_layers_minus1;
> +
> +HEVCBSFContext *s = ctx->priv_data;
> +ParamSets *ps = >ps;
> +
> +uint8_t sub_layer_profile_present_flag[HEVC_MAX_SUB_LAYERS];
> +uint8_t sub_layer_level_present_flag[HEVC_MAX_SUB_LAYERS];
> +
> +GetBitContext *gb = >gb;
> +
> +vps_ref = get_bits(gb, 4);
> +
> +max_sub_layers_minus1 = get_bits(gb, 3);
> +skip_bits1(gb);  /* 
> sps_temporal_id_nesting_flag*/
> +skip_bits(gb, PROFILE_WITHOUT_IDC_BITS); /* profile_tier_level*/
> +skip_bits(gb, 8);/* general_level_idc*/
> +
> +for (i = 0; i < max_sub_layers_minus1; i++) {
> +sub_layer_profile_present_flag[i] = get_bits1(gb);
> +sub_layer_level_present_flag[i]   = get_bits1(gb);
> +}
> +
> +if (max_sub_layers_minus1 > 0)
> +for (i = max_sub_layers_minus1; i < 8; i++)
> +skip_bits(gb, 2); /* reserved_zero_2bits[i]*/
> +
> +for (i = 0; i < max_sub_layers_minus1; i++) {
> +if (sub_layer_profile_present_flag[i])
> +skip_bits(gb, PROFILE_WITHOUT_IDC_BITS); /* profile_tier_level*/
> +if (sub_layer_level_present_flag[i])
> +skip_bits(gb, 8);/* sub_layer_level_idc*/
> +}
> +
> +/*we only need the sps_id index*/
> +sps_id = get_ue_golomb(gb);
> +if (sps_id < 0 ||  sps_id >= HEVC_MAX_SPS_COUNT) {
> +av_log(ctx, AV_LOG_ERROR, "SPS id out of range: %d\n", sps_id);
> +return AVERROR_INVALIDDATA;
> +}
> +
> +if (get_bits_left(gb) < 0) {
> +av_log(ctx, AV_LOG_ERROR, "Over-read bitstream in SPS id: %d\n", 
> sps_id);
> +return AVERROR_INVALIDDATA;
> +}
> +
> +av_log(ctx, AV_LOG_TRACE, "Updating SPS id: %d, VPS ref: %d\n", sps_id, 
> vps_ref);
> +ret = update_cached_paramset(ctx, >sps_list[sps_id], nal, vps_ref);
> +return ret;

the intermediate ret is useless here, the same issue occurs in other cases too
[...]

> +
>  static int hevc_extradata_to_annexb(AVBSFContext *ctx)
>  {
>  GetByteContext gb;
> @@ -97,6 +302,7 @@ fail:
>  static int hevc_mp4toannexb_init(AVBSFContext *ctx)
>  {
>  HEVCBSFContext *s = ctx->priv_data;
> +H2645Packet pkt;
>  int ret;
>  
>  if (ctx->par_in->extradata_size < MIN_HEVCC_LENGTH ||
> @@ -104,77 +310,309 @@ static int hevc_mp4toannexb_init(AVBSFContext *ctx)
>  AV_RB32(ctx->par_in->extradata) == 1) {
>  av_log(ctx, AV_LOG_VERBOSE,
> "The input looks like it is Annex B already\n");
> +return 0;
>  } else {
>  ret = hevc_extradata_to_annexb(ctx);
>  if 

Re: [FFmpeg-devel] [PATCH] avcodec: add mvdv video decoder

2019-11-23 Thread James Almer
On 11/23/2019 5:30 PM, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/avcodec.h|   1 +
>  libavcodec/codec_desc.c |   7 ++
>  libavcodec/midivid.c| 264 
>  libavformat/riff.c  |   1 +
>  6 files changed, 275 insertions(+)
>  create mode 100644 libavcodec/midivid.c
> 
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 006a472a6d..52e5b4f345 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -493,6 +493,7 @@ OBJS-$(CONFIG_MSZH_DECODER)+= lcldec.o
>  OBJS-$(CONFIG_MTS2_DECODER)+= mss4.o
>  OBJS-$(CONFIG_MVC1_DECODER)+= mvcdec.o
>  OBJS-$(CONFIG_MVC2_DECODER)+= mvcdec.o
> +OBJS-$(CONFIG_MVDV_DECODER)+= midivid.o
>  OBJS-$(CONFIG_MWSC_DECODER)+= mwsc.o
>  OBJS-$(CONFIG_MXPEG_DECODER)   += mxpegdec.o
>  OBJS-$(CONFIG_NELLYMOSER_DECODER)  += nellymoserdec.o nellymoser.o
> diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
> index 0c0741936c..4eb1afbea1 100644
> --- a/libavcodec/allcodecs.c
> +++ b/libavcodec/allcodecs.c
> @@ -218,6 +218,7 @@ extern AVCodec ff_mszh_decoder;
>  extern AVCodec ff_mts2_decoder;
>  extern AVCodec ff_mvc1_decoder;
>  extern AVCodec ff_mvc2_decoder;
> +extern AVCodec ff_mvdv_decoder;
>  extern AVCodec ff_mwsc_decoder;
>  extern AVCodec ff_mxpeg_decoder;
>  extern AVCodec ff_nuv_decoder;
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 813a43b72e..1cbc9c9ef1 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -458,6 +458,7 @@ enum AVCodecID {
>  AV_CODEC_ID_LSCR,
>  AV_CODEC_ID_VP4,
>  AV_CODEC_ID_IMM5,
> +AV_CODEC_ID_MVDV,
>  
>  /* various PCM "codecs" */
>  AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
> start of audio codecs
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 5961af3c85..3e634bbec7 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1733,6 +1733,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
>  .long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"),
>  .props = AV_CODEC_PROP_LOSSY,
>  },
> +{
> +.id= AV_CODEC_ID_MVDV,
> +.type  = AVMEDIA_TYPE_VIDEO,
> +.name  = "mvdv",
> +.long_name = NULL_IF_CONFIG_SMALL("MidiVid VQ"),
> +.props = AV_CODEC_PROP_LOSSY,
> +},
>  
>  /* various PCM "codecs" */
>  {
> diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c
> new file mode 100644
> index 00..f2d125f2cf
> --- /dev/null
> +++ b/libavcodec/midivid.c
> @@ -0,0 +1,264 @@
> +/*
> + * MidiVid decoder
> + * Copyright (c) 2019 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 
> +#include 
> +#include 
> +
> +#include "libavutil/imgutils.h"
> +#include "libavutil/internal.h"
> +#include "libavutil/intreadwrite.h"
> +#include "libavutil/mem.h"
> +
> +#define BITSTREAM_READER_LE
> +#include "avcodec.h"
> +#include "get_bits.h"
> +#include "bytestream.h"
> +#include "internal.h"
> +
> +typedef struct MidiVidContext {
> +GetByteContext gb;
> +
> +uint8_t uncompressed[524288];
> +uint8_t *skip;
> +
> +AVFrame *frame;
> +} MidiVidContext;
> +
> +static int decode_mvdv(MidiVidContext *s, AVCodecContext *avctx, AVFrame 
> *frame)
> +{
> +GetByteContext *gb = >gb;
> +GetBitContext mask;
> +GetByteContext idx9;
> +uint16_t nb_vectors, intra_flag;
> +const uint8_t *vec;
> +const uint8_t *mask_start;
> +uint8_t *skip;
> +int mask_size;
> +int idx9bits = 0;
> +int idx9val = 0;
> +int num_blocks;
> +
> +nb_vectors = bytestream2_get_le16(gb);
> +intra_flag = bytestream2_get_le16(gb);
> +if (intra_flag) {
> +num_blocks = (avctx->width / 2) * (avctx->height / 2);
> +} else {
> +int skip_linesize;
> +
> +num_blocks = bytestream2_get_le32(gb);
> +skip_linesize = avctx->width >> 1;
> +mask_start = gb->buffer_start + bytestream2_tell(gb);
> +mask_size = (avctx->width >> 5) * 

[FFmpeg-devel] [PATCH] avcodec: add mvdv video decoder

2019-11-23 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 ++
 libavcodec/midivid.c| 264 
 libavformat/riff.c  |   1 +
 6 files changed, 275 insertions(+)
 create mode 100644 libavcodec/midivid.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 006a472a6d..52e5b4f345 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -493,6 +493,7 @@ OBJS-$(CONFIG_MSZH_DECODER)+= lcldec.o
 OBJS-$(CONFIG_MTS2_DECODER)+= mss4.o
 OBJS-$(CONFIG_MVC1_DECODER)+= mvcdec.o
 OBJS-$(CONFIG_MVC2_DECODER)+= mvcdec.o
+OBJS-$(CONFIG_MVDV_DECODER)+= midivid.o
 OBJS-$(CONFIG_MWSC_DECODER)+= mwsc.o
 OBJS-$(CONFIG_MXPEG_DECODER)   += mxpegdec.o
 OBJS-$(CONFIG_NELLYMOSER_DECODER)  += nellymoserdec.o nellymoser.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0c0741936c..4eb1afbea1 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -218,6 +218,7 @@ extern AVCodec ff_mszh_decoder;
 extern AVCodec ff_mts2_decoder;
 extern AVCodec ff_mvc1_decoder;
 extern AVCodec ff_mvc2_decoder;
+extern AVCodec ff_mvdv_decoder;
 extern AVCodec ff_mwsc_decoder;
 extern AVCodec ff_mxpeg_decoder;
 extern AVCodec ff_nuv_decoder;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 813a43b72e..1cbc9c9ef1 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -458,6 +458,7 @@ enum AVCodecID {
 AV_CODEC_ID_LSCR,
 AV_CODEC_ID_VP4,
 AV_CODEC_ID_IMM5,
+AV_CODEC_ID_MVDV,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 5961af3c85..3e634bbec7 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1733,6 +1733,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_MVDV,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "mvdv",
+.long_name = NULL_IF_CONFIG_SMALL("MidiVid VQ"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 
 /* various PCM "codecs" */
 {
diff --git a/libavcodec/midivid.c b/libavcodec/midivid.c
new file mode 100644
index 00..f2d125f2cf
--- /dev/null
+++ b/libavcodec/midivid.c
@@ -0,0 +1,264 @@
+/*
+ * MidiVid decoder
+ * Copyright (c) 2019 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 
+#include 
+#include 
+
+#include "libavutil/imgutils.h"
+#include "libavutil/internal.h"
+#include "libavutil/intreadwrite.h"
+#include "libavutil/mem.h"
+
+#define BITSTREAM_READER_LE
+#include "avcodec.h"
+#include "get_bits.h"
+#include "bytestream.h"
+#include "internal.h"
+
+typedef struct MidiVidContext {
+GetByteContext gb;
+
+uint8_t uncompressed[524288];
+uint8_t *skip;
+
+AVFrame *frame;
+} MidiVidContext;
+
+static int decode_mvdv(MidiVidContext *s, AVCodecContext *avctx, AVFrame 
*frame)
+{
+GetByteContext *gb = >gb;
+GetBitContext mask;
+GetByteContext idx9;
+uint16_t nb_vectors, intra_flag;
+const uint8_t *vec;
+const uint8_t *mask_start;
+uint8_t *skip;
+int mask_size;
+int idx9bits = 0;
+int idx9val = 0;
+int num_blocks;
+
+nb_vectors = bytestream2_get_le16(gb);
+intra_flag = bytestream2_get_le16(gb);
+if (intra_flag) {
+num_blocks = (avctx->width / 2) * (avctx->height / 2);
+} else {
+int skip_linesize;
+
+num_blocks = bytestream2_get_le32(gb);
+skip_linesize = avctx->width >> 1;
+mask_start = gb->buffer_start + bytestream2_tell(gb);
+mask_size = (avctx->width >> 5) * (avctx->height >> 2);
+init_get_bits8(, mask_start, mask_size);
+bytestream2_skip(gb, mask_size);
+skip = s->skip;
+
+for (int y = 0; y < avctx->height >> 2; y++) {
+for (int x = 0; x < avctx->width >> 2; x++) {
+int flag = !get_bits1();
+
+skip[(y*2)  

Re: [FFmpeg-devel] [PATCH v2 3/3] bavfilter/vsrc_life: Fix for random_seed type

2019-11-23 Thread Moritz Barsnick
On Fri, Nov 22, 2019 at 09:48:04 +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> Subject: bavfilter/vsrc_life: Fix for random_seed type
   ^
There's a stray letter in that line. (Also in another patch.)

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 01/23] avformat/matroskaenc: Fix ReferenceBlock timestamp

2019-11-23 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Andreas Rheinhardt:
>> In order to indicate that the frames in a BlockGroup are not keyframes,
>> one has to add a ReferenceBlock element containing the timestamp of a
>> reference block that has already been written. The timestamp ought to be
>> relative to the timestamp of the block it is attached to. Yet the
>> Matroska muxer used the relative timestamp of the preceding block of the
>> track, i.e. the timestamp of the preceding block relative to the
>> timestamp of the cluster containing said block (that need not be the
>> cluster containing the current block). This has been fixed.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>> Unchanged since last time.
>>
>>  libavformat/matroskaenc.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
>> index ba48aae454..90400de191 100644
>> --- a/libavformat/matroskaenc.c
>> +++ b/libavformat/matroskaenc.c
>> @@ -2165,9 +2165,9 @@ static void mkv_write_block(AVFormatContext *s, 
>> AVIOContext *pb,
>>  av_free(data);
>>  
>>  if (blockid == MATROSKA_ID_BLOCK && !keyframe) {
>> -put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE, 
>> track->last_timestamp);
>> +put_ebml_sint(pb, MATROSKA_ID_BLOCKREFERENCE, track->last_timestamp 
>> - ts);
>>  }
>> -track->last_timestamp = ts - mkv->cluster_pts;
>> +track->last_timestamp = ts;
>>  
>>  if (discard_padding) {
>>  put_ebml_sint(pb, MATROSKA_ID_DISCARDPADDING, discard_padding);
>>
> Ping for the whole patchset.
> 
> - Andreas
> 
Another ping.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] Reimbursement request LDP 2019

2019-11-23 Thread Michael Niedermayer
On Mon, Nov 18, 2019 at 12:44:37PM +0100, Thilo Borgmann wrote:
> Hi,
> 
> here comes my request for reimbursements for attending the Linux Days Prague 
> 2019.
> 
> Quite cheap, since accomodation is free. So there is a just bus ticket for 
> 51,87 EUR.
> 
> Prepared the SPI form and send it to Stefano for approval.

LGTM

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/adpcm: Clip predictor for APC

2019-11-23 Thread Michael Niedermayer
On Fri, Nov 22, 2019 at 07:20:55PM +0800, Limin Wang wrote:
> On Thu, Nov 21, 2019 at 11:26:12PM +0100, Michael Niedermayer wrote:
> > Fixes: signed integer overflow: -2147483648 - 13 cannot be represented in 
> > type 'int'
> > Fixes: 
> > 18893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APC_fuzzer-5630760442920960
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/adpcm.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> > index edf7052636..d3919288b1 100644
> > --- a/libavcodec/adpcm.c
> > +++ b/libavcodec/adpcm.c
> > @@ -140,8 +140,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * 
> > avctx)
> >  break;
> >  case AV_CODEC_ID_ADPCM_IMA_APC:
> >  if (avctx->extradata && avctx->extradata_size >= 8) {
> > -c->status[0].predictor = AV_RL32(avctx->extradata);
> > -c->status[1].predictor = AV_RL32(avctx->extradata + 4);
> > +c->status[0].predictor = 
> > av_clip_intp2(AV_RL32(avctx->extradata), 18);
> > +c->status[1].predictor = 
> > av_clip_intp2(AV_RL32(avctx->extradata + 4), 18);
> 
> 18 is 16?

18


> I understand c->status[i].predictor is 16bit.

ADPCMChannelStatus.predictor is an int so 32bit

the place where predictor is used is adpcm_ima_expand_nibble()
there its added to diff 

diff is maximally 32767*15 / 8 = 61438
if now predictor was -7 then we would get -8562
if predictor was cliped to 16bit (-32768) would produce 28670
thats different. Same for 17bit which is why i choose 18.
Its the smallest that does not change the output in any case.

Also i dont see any cliping of the global header values in
https://wiki.multimedia.cx/index.php/CRYO_APC

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 2/4] avcodec/nuv: Use ff_set_dimensions()

2019-11-23 Thread Michael Niedermayer
Fixes: OOM
Fixes: 
18956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-5766505644163072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/nuv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c
index bb80e3e884..db3246b8dd 100644
--- a/libavcodec/nuv.c
+++ b/libavcodec/nuv.c
@@ -131,10 +131,10 @@ static int codec_reinit(AVCodecContext *avctx, int width, 
int height,
  + RTJPEG_HEADER_SIZE;
 if (buf_size > INT_MAX/8)
 return -1;
-if ((ret = av_image_check_size(height, width, 0, avctx)) < 0)
+if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
 return ret;
-avctx->width  = c->width  = width;
-avctx->height = c->height = height;
+c->width  = width;
+c->height = height;
 av_fast_malloc(>decomp_buf, >decomp_size,
buf_size);
 if (!c->decomp_buf) {
-- 
2.23.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 4/4] tools/target_dec_fuzzer: Adjust threshold for dst

2019-11-23 Thread Michael Niedermayer
Fixes: Timeout (400sec -> 14sec)
Fixes: 
18989/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5175008116867072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 tools/target_dec_fuzzer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 1302a4458a..677b7faec4 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -140,6 +140,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 case AV_CODEC_ID_BINKVIDEO: maxpixels /= 32; break;
 case AV_CODEC_ID_CFHD:  maxpixels /= 128; break;
 case AV_CODEC_ID_DIRAC: maxpixels /= 8192; break;
+case AV_CODEC_ID_DST:   maxsamples /= 8192; break;
 case AV_CODEC_ID_DXV:   maxpixels /= 32;  break;
 case AV_CODEC_ID_FFWAVESYNTH: maxsamples /= 16384; break;
 case AV_CODEC_ID_MSRLE: maxpixels /= 16;  break;
-- 
2.23.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 1/4] avcodec/wmavoice: Check remaining input in parse_packet_header()

2019-11-23 Thread Michael Niedermayer
Fixes: Infinite loop
Fixes: 
18914/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5731902946541568

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/wmavoice.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 4c147fe04f..afd6b32780 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -1843,6 +1843,9 @@ static int parse_packet_header(WMAVoiceContext *s)
 skip_bits(gb, 4);  // packet sequence number
 s->has_residual_lsps = get_bits1(gb);
 do {
+if (get_bits_left(gb) < 6 + s->spillover_bitsize)
+return AVERROR_INVALIDDATA;
+
 res = get_bits(gb, 6); // number of superframes per packet
// (minus first one if there is spillover)
 n_superframes += res;
-- 
2.23.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH 3/4] avcodec/dstdec: Use get_ur_golomb_jpegls()

2019-11-23 Thread Michael Niedermayer
Fixes: shift exponent -4 is negative
Fixes: 
17793/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5766088435957760
Fixes: 
18989/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DST_fuzzer-5175008116867072

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/dstdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dstdec.c b/libavcodec/dstdec.c
index ae3fe428dd..880b838b0c 100644
--- a/libavcodec/dstdec.c
+++ b/libavcodec/dstdec.c
@@ -121,7 +121,7 @@ static int read_map(GetBitContext *gb, Table *t, unsigned 
int map[DST_MAX_CHANNE
 
 static av_always_inline int get_sr_golomb_dst(GetBitContext *gb, unsigned int 
k)
 {
-int v = get_ur_golomb(gb, k, get_bits_left(gb), 0);
+int v = get_ur_golomb_jpegls(gb, k, get_bits_left(gb), 0);
 if (v && get_bits1(gb))
 v = -v;
 return v;
-- 
2.23.0

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH v6 1/3] hevc_mp4toannexb: Insert correct parameter sets before IRAP

2019-11-23 Thread Andriy Gelman
On Sun, 10. Nov 14:55, Andriy Gelman wrote:
> On Tue, 05. Nov 09:25, Andriy Gelman wrote:
> > On Wed, 30. Oct 09:45, Andriy Gelman wrote:
> > > On Thu, 24. Oct 20:50, Andriy Gelman wrote:
> > > > On Tue, 15. Oct 22:50, Andriy Gelman wrote:
> > > > > From: Andriy Gelman 
> > > > > 
> > > > > Fixes #7799
> > > > > 
> > > > > Currently, the mp4toannexb filter always inserts the same extradata at
> > > > > the start of the first IRAP unit. As in ticket #7799, this can lead to
> > > > > decoding errors if modified parameter sets are signalled in-band.
> > > > > 
> > > > > Decoding errors/visual artifacts are also present in the following 
> > > > > fate-suite/hevc-conformance datasets for hevc->mp4->hevc conversion:
> > > > >  -RAP_B_Bossen_1.bit
> > > > >  -RPS_C_ericsson_5.bit
> > > > >  -SLIST_A_Sony_4.bit
> > > > >  -SLIST_B_Sony_8.bit
> > > > >  -SLIST_C_Sony_3.bit
> > > > >  -SLIST_D_Sony_9.bit
> > > > >  -TSKIP_A_MS_2.bit
> > > > > 
> > > > > This commit solves these errors by keeping track of VPS/SPS/PPS 
> > > > > parameter sets
> > > > > during the conversion. The correct combination is inserted at the 
> > > > > start
> > > > > of the first IRAP. SEIs from extradata are inserted before each IRAP.
> > > > > 
> > > > > This commit also makes an update to the hevc-bsf-mp4toannexb fate test
> > > > > since the result before this patch contained duplicate parameter sets
> > > > > in-band.
> > > > > ---
> > > > >  libavcodec/hevc_mp4toannexb_bsf.c | 503 
> > > > > --
> > > > >  tests/fate/hevc.mak   |   2 +-
> > > > >  2 files changed, 472 insertions(+), 33 deletions(-)
> > > > > 
> > > > > diff --git a/libavcodec/hevc_mp4toannexb_bsf.c 
> > > > > b/libavcodec/hevc_mp4toannexb_bsf.c
> > > > > index 09bce5b34c..1ca5f13807 100644
> > > > > --- a/libavcodec/hevc_mp4toannexb_bsf.c
> > > > > +++ b/libavcodec/hevc_mp4toannexb_bsf.c
> > > > > @@ -23,19 +23,224 @@
> > > > >  
> > > > >  #include "libavutil/intreadwrite.h"
> > > > >  #include "libavutil/mem.h"
> > > > > +#include "libavutil/avassert.h"
> > > > >  
> > > > >  #include "avcodec.h"
> > > > >  #include "bsf.h"
> > > > >  #include "bytestream.h"
> > > > >  #include "hevc.h"
> > > > > +#include "h2645_parse.h"
> > > > > +#include "hevc_ps.h"
> > > > > +#include "golomb.h"
> > > > >  
> > > > >  #define MIN_HEVCC_LENGTH 23
> > > > > +#define PROFILE_WITHOUT_IDC_BITS88
> > > > > +#define IS_IRAP(s)  ((s)->type >= 16 && (s)->type <= 
> > > > > 23)
> > > > > +#define IS_PARAMSET(s)  ((s)->type >= 32 && (s)->type <= 
> > > > > 34)
> > > > > +
> > > > > +/*reserved VCLs not included*/
> > > > > +#define IS_VCL(s)   ((s)->type <= 9 || ((s)->type >= 
> > > > > 16 && (s)->type <= 21))
> > > > > +#define HEVC_NAL_HEADER_BITS16
> > > > > +
> > > > > +/*
> > > > > + * Copies data from input buffer to output buffer. Appends annexb 
> > > > > startcode.
> > > > > + * out must be allocated at least out_len + in_len + write_startcode 
> > > > > * 4.
> > > > > + */
> > > > > +#define WRITE_NAL(out, out_len, in, in_len, write_startcode) do {
> > > > > \
> > > > > +if ((write_startcode)) { 
> > > > >\
> > > > > +AV_WB32((out) + (out_len), 1);   
> > > > >\
> > > > > +(out_len) += 4;  
> > > > >\
> > > > > +}
> > > > >\
> > > > > +memcpy((out) + (out_len), (in), (in_len));   
> > > > >\
> > > > > +(out_len) += (in_len);   
> > > > >\
> > > > > +} while (0)
> > > > > +
> > > > > +typedef struct Param {
> > > > > +uint8_t *raw_data;  /* raw data to store param set 
> > > > > payload*/
> > > > > +int  raw_size;  /* size of raw_data*/
> > > > > +size_t   allocated_size;/* allocated size of raw_data*/
> > > > > +int  ref;   /* stores the ref of the higher 
> > > > > level parameter set*/
> > > > > +int  is_signalled;  /* indicates whether this param has 
> > > > > already been signalled in the cvs*/
> > > > > +} Param;
> > > > > +
> > > > > +/* modified version of HEVCParamSets to store bytestream and 
> > > > > reference to previous level*/
> > > > > +typedef struct ParamSets {
> > > > > +Param vps_list[HEVC_MAX_VPS_COUNT];
> > > > > +Param sps_list[HEVC_MAX_SPS_COUNT];
> > > > > +Param pps_list[HEVC_MAX_PPS_COUNT];
> > > > > +
> > > > > +Param sei; /* cached SEIs from extradatat*/
> > > > > +} ParamSets;
> > > > >  
> > > > >  typedef struct HEVCBSFContext {
> > > > >  uint8_t  length_size;
> > > > >  int  extradata_parsed;
> > > > > +ParamSets ps; /* cached VPS/SPS/PPS parameter sets + SEI from 
> > > > > extradata*/
> > > > >  } HEVCBSFContext;
> > > > 

Re: [FFmpeg-devel] [PATCH v2] avcodec/v4l2_m2m_enc: Check encoder pix_fmt matches pix_fmt on device

2019-11-23 Thread Andriy Gelman
On Tue, 12. Nov 22:46, Andriy Gelman wrote:
> From: Andriy Gelman 
> 
> Fixes #8079
> 
> During initialization of a v4l2m2m device, the configured pix_fmt can be
> different to the pix_fmt of the encoder (i.e. avctx->pix_fmt).
> 
> For example on the Odroid XU4:
> ./ffmpeg -f lavfi -i yuvtestsrc -codec:v h264_v4l2m2m out.h264
> 
> will configure the v4l2 encoder to pix_fmt nv21, whereas the input
> frames will be yuv444p.
> 
> This commit checks that the configured v4l2 pix_fmt on device is the
> same as avctx->pix_fmt. If they are different the initialization fails
> and an error is returned. Tested on RPI4 and Odroid XU4.
> 
> Signed-off-by: Andriy Gelman 
> ---
>  libavcodec/v4l2_m2m_enc.c | 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
> index 474e6bef897..c0e82afe354 100644
> --- a/libavcodec/v4l2_m2m_enc.c
> +++ b/libavcodec/v4l2_m2m_enc.c
> @@ -30,6 +30,7 @@
>  #include "libavutil/opt.h"
>  #include "v4l2_context.h"
>  #include "v4l2_m2m.h"
> +#include "v4l2_fmt.h"
>  
>  #define MPEG_CID(x) V4L2_CID_MPEG_VIDEO_##x
>  #define MPEG_VIDEO(x) V4L2_MPEG_VIDEO_##x
> @@ -288,6 +289,8 @@ static av_cold int v4l2_encode_init(AVCodecContext *avctx)
>  V4L2Context *capture, *output;
>  V4L2m2mContext *s;
>  V4L2m2mPriv *priv = avctx->priv_data;
> +enum AVPixelFormat pix_fmt_output;
> +uint32_t v4l2_fmt_output;
>  int ret;
>  
>  ret = ff_v4l2_m2m_create_context(priv, );
> @@ -316,6 +319,18 @@ static av_cold int v4l2_encode_init(AVCodecContext 
> *avctx)
>  }
>  s->avctx = avctx;
>  
> +if (V4L2_TYPE_IS_MULTIPLANAR(output->type))
> +v4l2_fmt_output = output->format.fmt.pix_mp.pixelformat;
> +else
> +v4l2_fmt_output = output->format.fmt.pix.pixelformat;
> +
> +pix_fmt_output = ff_v4l2_format_v4l2_to_avfmt(v4l2_fmt_output, 
> AV_CODEC_ID_RAWVIDEO);
> +if (pix_fmt_output != avctx->pix_fmt) {
> +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt_output);
> +av_log(priv, AV_LOG_ERROR, "Encoder requires %s pixel format.\n", 
> desc->name);
> +return AVERROR(EINVAL);
> +}
> +
>  return v4l2_prepare_encoder(s);
>  }
>  
> -- 
> 2.23.0
> 

ping 

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avfilter: add axcorrelate filter

2019-11-23 Thread Paul B Mahol
Will apply soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".