[FFmpeg-devel] [PATCH] ivfenc: add AV1 support

2017-12-10 Thread Tristan Matthews
libaom tools work with ivf files.
---
 libavformat/ivfenc.c | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/ivfenc.c b/libavformat/ivfenc.c
index fdc0ee03e1..2d1f9aeef6 100644
--- a/libavformat/ivfenc.c
+++ b/libavformat/ivfenc.c
@@ -37,14 +37,16 @@ static int ivf_write_header(AVFormatContext *s)
 }
 par = s->streams[0]->codecpar;
 if (par->codec_type != AVMEDIA_TYPE_VIDEO ||
-!(par->codec_id == AV_CODEC_ID_VP8 || par->codec_id == 
AV_CODEC_ID_VP9)) {
-av_log(s, AV_LOG_ERROR, "Currently only VP8 and VP9 are supported!\n");
+!(par->codec_id == AV_CODEC_ID_VP8 || par->codec_id == AV_CODEC_ID_VP9 
||
+  par->codec_id == AV_CODEC_ID_AV1)) {
+av_log(s, AV_LOG_ERROR, "Currently only VP8, VP9 and AV1 are 
supported!\n");
 return AVERROR(EINVAL);
 }
 avio_write(pb, "DKIF", 4);
 avio_wl16(pb, 0); // version
 avio_wl16(pb, 32); // header length
-avio_wl32(pb, par->codec_tag ? par->codec_tag : par->codec_id == 
AV_CODEC_ID_VP9 ? AV_RL32("VP90") : AV_RL32("VP80"));
+avio_wl32(pb, par->codec_tag ? par->codec_tag : par->codec_id ==  
AV_CODEC_ID_VP9 ? AV_RL32("VP90") :
+par->codec_id ==  AV_CODEC_ID_VP8 ? AV_RL32("VP80") : 
AV_RL32("AV01"));
 avio_wl16(pb, par->width);
 avio_wl16(pb, par->height);
 avio_wl32(pb, s->streams[0]->time_base.den);
@@ -100,6 +102,7 @@ static int ivf_check_bitstream(struct AVFormatContext *s, 
const AVPacket *pkt)
 static const AVCodecTag codec_ivf_tags[] = {
 { AV_CODEC_ID_VP8,  MKTAG('V', 'P', '8', '0') },
 { AV_CODEC_ID_VP9,  MKTAG('V', 'P', '9', '0') },
+{ AV_CODEC_ID_AV1,  MKTAG('A', 'V', '0', '1') },
 { AV_CODEC_ID_NONE, 0 }
 };
 
-- 
2.15.1

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


[FFmpeg-devel] [PATCH] rtsp: only break on parse_rtsp_message on error

2017-12-01 Thread Tristan Matthews
Fix suggested by Luca Barbato.

This was causing spurious EOFs when using -rtsp_transport udp, as
reported in https://bugzilla.libav.org/show_bug.cgi?id=1103
---
 libavformat/rtsp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index b6da61b95e..cf7cdb2f2b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2009,7 +2009,9 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream 
**prtsp_st,
 }
 #if CONFIG_RTSP_DEMUXER
 if (rt->rtsp_hd && p[0].revents & POLLIN) {
-return parse_rtsp_message(s);
+if ((ret = parse_rtsp_message(s)) < 0) {
+return ret;
+}
 }
 #endif
 } else if (n == 0 && ++timeout_cnt >= MAX_TIMEOUTS) {
-- 
2.14.1

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


Re: [FFmpeg-devel] [PATCH] rtsp: only break on parse_rtsp_message on error

2017-12-03 Thread Tristan Matthews
On Sat, Dec 2, 2017 at 11:01 AM, Michael Niedermayer
<mich...@niedermayer.cc> wrote:
> On Fri, Dec 01, 2017 at 04:09:15PM -0500, Tristan Matthews wrote:
>> Fix suggested by Luca Barbato.
>>
>> This was causing spurious EOFs when using -rtsp_transport udp, as
>> reported in https://bugzilla.libav.org/show_bug.cgi?id=1103
>> ---
>>  libavformat/rtsp.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> where is the code which interprets 0 as EOF ?

udp_read_packet is called here:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l2082

which in turn, calls rtsp_parse_message here:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l2010

which returns 0 in the non-error case here:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l1945

this is then interpreted as an EOF here
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/rtsp.c;h=b6da61b95e6c0ecce63d1d86e2b8fe7066ee2f96;hb=HEAD#l2098

Best,
Tristan

> also nicolas may want to look at this, he was working on EOF vs 0 issues
> (thus ccing nicolas)
>
> thanks
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> it is not once nor twice but times without number that the same ideas make
> their appearance in the world. -- 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] h264: fix RTSP stream decoding

2017-12-29 Thread Tristan Matthews
Hi,

On Fri, Dec 29, 2017 at 12:43 PM, ser...@gavrushkin.com
 wrote:
> Hello,
>
> FFmpeg stop working with the latest model of camera that I work now. I've 
> investigated it and found that "bad" commit is 
> 98c97994c5b90bdae02accb155eeceeb5224b8ef. There was additional check for ret 
> value and err_recognition, that was ignored while refactoring to h264_parse.c 
> function.
>
> Test RTSP streams are available here:
>
> rtsp://admin:123456@69.42.237.230:1569/mpeg4cif 
> 
> rtsp://admin:123456@69.42.237.230:1568/mpeg4cif

This seems to fix the reported issue here.

Best,
Tristan

>
> P.S. It is my first patch so please write any notes what I should provide for 
> accepting.
>
> Thank you,
> Sergey
>
>
> -
>
>
>
> From e90ef7b56d4147ff6555468f0154321b55596846 Mon Sep 17 00:00:00 2001
> From: Sergey Gavrushkin 
> Date: Fri, 29 Dec 2017 20:03:50 +0300
> Subject: [PATCH] h264: fix RTSP stream decoding
>
> It is a regression fix for an issue that was introduced in commit
> 98c97994c5b90bdae02accb155eeceeb5224b8ef. Variable err_recognition is
> ignored while extradata is decoded and the whole decoding process is
> failed due to timeout.
> ---
>  libavcodec/h264_parse.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
> index fee28d9..009d50c 100644
> --- a/libavcodec/h264_parse.c
> +++ b/libavcodec/h264_parse.c
> @@ -347,7 +347,7 @@ int ff_h264_init_poc(int pic_field_poc[2], int *pic_poc,
>  }
>
>  static int decode_extradata_ps(const uint8_t *data, int size, H264ParamSets 
> *ps,
> -   int is_avc, void *logctx)
> +   int is_avc, int err_recognition, void *logctx)
>  {
>  H2645Packet pkt = { 0 };
>  int i, ret = 0;
> @@ -363,13 +363,13 @@ static int decode_extradata_ps(const uint8_t *data, int 
> size, H264ParamSets *ps,
>  switch (nal->type) {
>  case H264_NAL_SPS:
>  ret = ff_h264_decode_seq_parameter_set(>gb, logctx, ps, 0);
> -if (ret < 0)
> +if (ret < 0 && (err_recognition & AV_EF_EXPLODE))
>  goto fail;
>  break;
>  case H264_NAL_PPS:
>  ret = ff_h264_decode_picture_parameter_set(>gb, logctx, ps,
> nal->size_bits);
> -if (ret < 0)
> +if (ret < 0 && (err_recognition & AV_EF_EXPLODE))
>  goto fail;
>  break;
>  default:
> @@ -393,7 +393,7 @@ static int decode_extradata_ps_mp4(const uint8_t *buf, 
> int buf_size, H264ParamSe
>  {
>  int ret;
>
> -ret = decode_extradata_ps(buf, buf_size, ps, 1, logctx);
> +ret = decode_extradata_ps(buf, buf_size, ps, 1, err_recognition, logctx);
>  if (ret < 0 && !(err_recognition & AV_EF_EXPLODE)) {
>  GetByteContext gbc;
>  PutByteContext pbc;
> @@ -425,7 +425,7 @@ static int decode_extradata_ps_mp4(const uint8_t *buf, 
> int buf_size, H264ParamSe
>  escaped_buf_size = bytestream2_tell_p();
>  AV_WB16(escaped_buf, escaped_buf_size - 2);
>
> -(void)decode_extradata_ps(escaped_buf, escaped_buf_size, ps, 1, 
> logctx);
> +(void)decode_extradata_ps(escaped_buf, escaped_buf_size, ps, 1, 
> err_recognition, logctx);
>  // lorex.mp4 decodes ok even with extradata decoding failing
>  av_freep(_buf);
>  }
> @@ -486,7 +486,7 @@ int ff_h264_decode_extradata(const uint8_t *data, int 
> size, H264ParamSets *ps,
>  *nal_length_size = (data[4] & 0x03) + 1;
>  } else {
>  *is_avc = 0;
> -ret = decode_extradata_ps(data, size, ps, 0, logctx);
> +ret = decode_extradata_ps(data, size, ps, 0, err_recognition, 
> logctx);
>  if (ret < 0)
>  return ret;
>  }
> --
> 2.6.4
>
> ___
> 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] lavfi/silencedetect: fix spelling

2018-09-10 Thread Tristan Matthews
---
 libavfilter/af_silencedetect.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index 6e321a5d97..d9582aa589 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -38,7 +38,7 @@ typedef struct SilenceDetectContext {
 double duration;///< minimum duration of silence until 
notification
 int mono;   ///< mono mode : check each channel separately 
(default = check when ALL channels are silent)
 int channels;   ///< number of channels
-int independant_channels;   ///< number of entries in following arrays 
(always 1 in mono mode)
+int independent_channels;   ///< number of entries in following arrays 
(always 1 in mono mode)
 int64_t *nb_null_samples;   ///< (array) current number of continuous zero 
samples
 int64_t *start; ///< (array) if silence is detected, this 
value contains the time of the first zero sample (default/unset = INT64_MIN)
 int64_t frame_end;  ///< pts of the end of the current frame (used 
to compute duration of silence at EOS)
@@ -77,12 +77,12 @@ static av_always_inline void update(SilenceDetectContext 
*s, AVFrame *insamples,
 int is_silence, int current_sample, 
int64_t nb_samples_notify,
 AVRational time_base)
 {
-int channel = current_sample % s->independant_channels;
+int channel = current_sample % s->independent_channels;
 if (is_silence) {
 if (s->start[channel] == INT64_MIN) {
 s->nb_null_samples[channel]++;
 if (s->nb_null_samples[channel] >= nb_samples_notify) {
-s->start[channel] = insamples->pts + 
av_rescale_q(current_sample / s->channels + 1 - nb_samples_notify * 
s->independant_channels / s->channels,
+s->start[channel] = insamples->pts + 
av_rescale_q(current_sample / s->channels + 1 - nb_samples_notify * 
s->independent_channels / s->channels,
 (AVRational){ 1, s->last_sample_rate }, time_base);
 set_meta(insamples, s->mono ? channel + 1 : 0, "silence_start",
 av_ts2timestr(s->start[channel], _base));
@@ -141,14 +141,14 @@ static int config_input(AVFilterLink *inlink)
 int c;
 
 s->channels = inlink->channels;
-s->independant_channels = s->mono ? s->channels : 1;
-s->nb_null_samples = av_mallocz_array(sizeof(*s->nb_null_samples), 
s->independant_channels);
+s->independent_channels = s->mono ? s->channels : 1;
+s->nb_null_samples = av_mallocz_array(sizeof(*s->nb_null_samples), 
s->independent_channels);
 if (!s->nb_null_samples)
 return AVERROR(ENOMEM);
-s->start = av_malloc_array(sizeof(*s->start), s->independant_channels);
+s->start = av_malloc_array(sizeof(*s->start), s->independent_channels);
 if (!s->start)
 return AVERROR(ENOMEM);
-for (c = 0; c < s->independant_channels; c++)
+for (c = 0; c < s->independent_channels; c++)
 s->start[c] = INT64_MIN;
 
 switch (inlink->format) {
@@ -178,7 +178,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*insamples)
 
 // scale number of null samples to the new sample rate
 if (s->last_sample_rate && s->last_sample_rate != srate)
-for (c = 0; c < s->independant_channels; c++) {
+for (c = 0; c < s->independent_channels; c++) {
 s->nb_null_samples[c] = srate * s->nb_null_samples[c] / 
s->last_sample_rate;
 }
 s->last_sample_rate = srate;
@@ -231,7 +231,7 @@ static av_cold void uninit(AVFilterContext *ctx)
 SilenceDetectContext *s = ctx->priv;
 int c;
 
-for (c = 0; c < s->independant_channels; c++)
+for (c = 0; c < s->independent_channels; c++)
 if (s->start[c] > INT64_MIN)
 update(s, NULL, 0, c, 0, s->time_base);
 av_freep(>nb_null_samples);
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Copy the value of x264_build before calling h264_slice_header_init during thread init

2018-10-09 Thread Tristan Matthews
On Tue, Oct 9, 2018 at 10:15 AM Derek Buitenhuis
 wrote:
>
> On 08/10/2018 16:36, Derek Buitenhuis wrote:
> > If we don't copy this value first, it is seen as 0 by 
> > h264_slice_header_init,
> > due to zero-allocation of the new context, triggering an old hack that
> > multiplied the denominator by 2 for files produced by old x264 versions, but
> > only if more than one thread was used.
> >
> > Fixes #7475.
> >
> > Signed-off-by: Derek Buitenhuis
> > ---
> >   libavcodec/h264_slice.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
>
> Pushed, thanks.
>
> - Derek
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

BTW, looks like this bug isn't present in 4.0.2.

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


[FFmpeg-devel] [PATCH] libaomdec: add row_mt option

2018-09-26 Thread Tristan Matthews
Partially fixes #7456
---
 libavcodec/libaomdec.c | 62 ++
 1 file changed, 62 insertions(+)

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 2530c9f76b..6740f98be1 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -23,20 +23,63 @@
  * AV1 decoder support via libaom
  */
 
+#define AOM_DISABLE_CTRL_TYPECHECKS 1
 #include 
 #include 
 
 #include "libavutil/common.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
 
 #include "avcodec.h"
 #include "internal.h"
 #include "profiles.h"
 
 typedef struct AV1DecodeContext {
+AVClass *class;
 struct aom_codec_ctx decoder;
+int row_mt;
 } AV1DecodeContext;
 
+static const char *const ctlidstr[] = {
+[AV1D_SET_ROW_MT]  = "AV1D_SET_ROW_MT",
+};
+
+
+static av_cold void log_decoder_error(AVCodecContext *avctx, const char *desc)
+{
+AV1DecodeContext *ctx= avctx->priv_data;
+const char *error  = aom_codec_error(>decoder);
+const char *detail = aom_codec_error_detail(>decoder);
+
+av_log(avctx, AV_LOG_ERROR, "%s: %s\n", desc, error);
+if (detail)
+av_log(avctx, AV_LOG_ERROR, "  Additional information: %s\n", detail);
+}
+
+static av_cold int codecctl_int(AVCodecContext *avctx,
+enum aom_dec_control_id id, int val)
+{
+AV1DecodeContext *ctx = avctx->priv_data;
+char buf[80];
+int width = -30;
+int res;
+
+snprintf(buf, sizeof(buf), "%s:", ctlidstr[id]);
+av_log(avctx, AV_LOG_DEBUG, "  %*s%d\n", width, buf, val);
+
+res = aom_codec_control(>decoder, id, val);
+if (res != AOM_CODEC_OK) {
+snprintf(buf, sizeof(buf), "Failed to set %s codec control",
+ ctlidstr[id]);
+log_decoder_error(avctx, buf);
+return AVERROR(EINVAL);
+}
+
+return 0;
+}
+
+
 static av_cold int aom_init(AVCodecContext *avctx,
 const struct aom_codec_iface *iface)
 {
@@ -56,6 +99,10 @@ static av_cold int aom_init(AVCodecContext *avctx,
 return AVERROR(EINVAL);
 }
 
+// codec control failures are currently treated only as warnings
+av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
+codecctl_int(avctx, AV1D_SET_ROW_MT, ctx->row_mt);
+
 return 0;
 }
 
@@ -220,6 +267,20 @@ static av_cold int av1_init(AVCodecContext *avctx)
 return aom_init(avctx, _codec_av1_dx_algo);
 }
 
+#define OFFSET(x) offsetof(AV1DecodeContext, x)
+#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption options[] = {
+{ "row-mt", "Enable row-based multithreading", OFFSET(row_mt), 
AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, VD},
+{ NULL },
+};
+
+static const AVClass class_aom = {
+.class_name = "libaom-av1 decoder",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_libaom_av1_decoder = {
 .name   = "libaom-av1",
 .long_name  = NULL_IF_CONFIG_SMALL("libaom AV1"),
@@ -231,5 +292,6 @@ AVCodec ff_libaom_av1_decoder = {
 .decode = aom_decode,
 .capabilities   = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
 .profiles   = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
+.priv_class = _aom,
 .wrapper_name   = "libaom",
 };
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH] libaomdec: add row_mt option

2018-09-26 Thread Tristan Matthews
On Wed, Sep 26, 2018 at 9:43 AM Hendrik Leppkes  wrote:

> On Wed, Sep 26, 2018 at 2:27 PM Tristan Matthews 
> wrote:
> >
> > Partially fixes #7456
> > ---
>
> row-mt is enabled by default in recent libaom versions, and they even
> removed the option for it from aomdec, so do we really need that
> option?
>

I'm fine with dropping the option (unless someone has a good reason for
wanting to disable row_mt), but I'd still suggest doing the explicit codec
control call.

Best,
Tristan


> - Hendrik
> ___
> 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] libaomdec: add row_mt option

2018-09-25 Thread Tristan Matthews
Partially fixes #7456
---
 libavcodec/libaomdec.c | 62 ++
 1 file changed, 62 insertions(+)

diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 2530c9f76b..15cda2940a 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -23,20 +23,63 @@
  * AV1 decoder support via libaom
  */
 
+#define AOM_DISABLE_CTRL_TYPECHECKS 1
 #include 
 #include 
 
 #include "libavutil/common.h"
 #include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
 
 #include "avcodec.h"
 #include "internal.h"
 #include "profiles.h"
 
 typedef struct AV1DecodeContext {
+AVClass *class;
 struct aom_codec_ctx decoder;
+int row_mt;
 } AV1DecodeContext;
 
+static const char *const ctlidstr[] = {
+[AV1D_SET_ROW_MT]  = "AV1D_SET_ROW_MT",
+};
+
+
+static av_cold void log_decoder_error(AVCodecContext *avctx, const char *desc)
+{
+AV1DecodeContext *ctx= avctx->priv_data;
+const char *error  = aom_codec_error(>decoder);
+const char *detail = aom_codec_error_detail(>decoder);
+
+av_log(avctx, AV_LOG_ERROR, "%s: %s\n", desc, error);
+if (detail)
+av_log(avctx, AV_LOG_ERROR, "  Additional information: %s\n", detail);
+}
+
+static av_cold int codecctl_int(AVCodecContext *avctx,
+enum aom_dec_control_id id, int val)
+{
+AV1DecodeContext *ctx = avctx->priv_data;
+char buf[80];
+int width = -30;
+int res;
+
+snprintf(buf, sizeof(buf), "%s:", ctlidstr[id]);
+av_log(avctx, AV_LOG_DEBUG, "  %*s%d\n", width, buf, val);
+
+res = aom_codec_control(>decoder, id, val);
+if (res != AOM_CODEC_OK) {
+snprintf(buf, sizeof(buf), "Failed to set %s codec control",
+ ctlidstr[id]);
+log_decoder_error(avctx, buf);
+return AVERROR(EINVAL);
+}
+
+return 0;
+}
+
+
 static av_cold int aom_init(AVCodecContext *avctx,
 const struct aom_codec_iface *iface)
 {
@@ -56,6 +99,10 @@ static av_cold int aom_init(AVCodecContext *avctx,
 return AVERROR(EINVAL);
 }
 
+// codec control failures are currently treated only as warnings
+av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
+codecctl_int(avctx, AV1D_SET_ROW_MT, ctx->row_mt);
+
 return 0;
 }
 
@@ -220,6 +267,20 @@ static av_cold int av1_init(AVCodecContext *avctx)
 return aom_init(avctx, _codec_av1_dx_algo);
 }
 
+#define OFFSET(x) offsetof(AV1DecodeContext, x)
+#define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
+static const AVOption options[] = {
+{ "row-mt", "Enable row-based multithreading", OFFSET(row_mt), 
AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, VD},
+{ NULL },
+};
+
+static const AVClass class_aom = {
+.class_name = "libaom-av1 decoder",
+.item_name  = av_default_item_name,
+.option = options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 AVCodec ff_libaom_av1_decoder = {
 .name   = "libaom-av1",
 .long_name  = NULL_IF_CONFIG_SMALL("libaom AV1"),
@@ -231,5 +292,6 @@ AVCodec ff_libaom_av1_decoder = {
 .decode = aom_decode,
 .capabilities   = AV_CODEC_CAP_AUTO_THREADS | AV_CODEC_CAP_DR1,
 .profiles   = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
+.priv_class = _aom,
 .wrapper_name   = "libaom",
 };
-- 
2.17.1

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


[FFmpeg-devel] [PATCH] matroskaenc: fix leak on error

2019-04-04 Thread Tristan Matthews
---
 libavformat/matroskaenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index b9f99c4463..1a06103c5d 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -694,8 +694,10 @@ static int put_flac_codecpriv(AVFormatContext *s,
 av_dict_set(, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
 
 len = ff_vorbiscomment_length(dict, vendor, NULL, 0);
-if (len >= ((1<<24) - 4))
+if (len >= ((1<<24) - 4)) {
+av_dict_free();
 return AVERROR(EINVAL);
+}
 
 data = av_malloc(len + 4);
 if (!data) {
-- 
2.17.1

___
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] rtpenc_chain: forward strict_std_compliance flags to rtp muxer

2019-02-22 Thread Tristan Matthews
fixes: https://trac.ffmpeg.org/ticket/6713
---
 libavformat/rtpenc_chain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/rtpenc_chain.c b/libavformat/rtpenc_chain.c
index d3c1bc96dc..e7a4dffaba 100644
--- a/libavformat/rtpenc_chain.c
+++ b/libavformat/rtpenc_chain.c
@@ -59,6 +59,7 @@ int ff_rtp_chain_mux_open(AVFormatContext **out, 
AVFormatContext *s,
 /* Copy other stream parameters. */
 rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
 rtpctx->flags |= s->flags & AVFMT_FLAG_BITEXACT;
+rtpctx->strict_std_compliance = s->strict_std_compliance;
 
 /* Get the payload type from the codec */
 if (st->id < RTP_PT_PRIVATE)
-- 
2.17.1

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


[FFmpeg-devel] [PATCH] rtsp: add pkt_size option

2019-04-15 Thread Tristan Matthews
This allows users to specify an upper limit on the size of outgoing packets
when publishing via RTSP.

Signed-off-by: Martin Storsjö 
---
 libavformat/rtsp.c | 6 +-
 libavformat/rtsp.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 8349840c96..8a8ffdea4d 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -76,7 +76,9 @@
 
 #define COMMON_OPTS() \
 { "reorder_queue_size", "set number of packets to buffer for handling of 
reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 
}, -1, INT_MAX, DEC }, \
-{ "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC } \
+{ "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC }, \
+{ "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC }, \
+{ "pkt_size",   "Underlying protocol send packet size",
  OFFSET(pkt_size),  AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, ENC } \
 
 
 const AVOption ff_rtsp_options[] = {
@@ -132,6 +134,8 @@ static AVDictionary *map_to_opts(RTSPState *rt)
 
 snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
 av_dict_set(, "buffer_size", buf, 0);
+snprintf(buf, sizeof(buf), "%d", rt->pkt_size);
+av_dict_set(, "pkt_size", buf, 0);
 
 return opts;
 }
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index b49278fc20..54a9a30c16 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -410,6 +410,7 @@ typedef struct RTSPState {
 
 char default_lang[4];
 int buffer_size;
+int pkt_size;
 } RTSPState;
 
 #define RTSP_FLAG_FILTER_SRC  0x1/**< Filter incoming UDP packets -
-- 
2.17.1

___
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] rtsp: add pkt_size option

2019-04-15 Thread Tristan Matthews
This allows users to specify an upper limit on the size of outgoing packets
when publishing via RTSP.

Signed-off-by: Martin Storsjö 
---
 libavformat/rtsp.c | 5 -
 libavformat/rtsp.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 8349840c96..c153cac88b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -76,7 +76,8 @@
 
 #define COMMON_OPTS() \
 { "reorder_queue_size", "set number of packets to buffer for handling of 
reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = -1 
}, -1, INT_MAX, DEC }, \
-{ "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC } \
+{ "buffer_size","Underlying protocol send/receive buffer size",
  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, DEC|ENC }, \
+{ "pkt_size",   "Underlying protocol send packet size",
  OFFSET(pkt_size),  AV_OPT_TYPE_INT, { .i64 = -1 }, 
-1, INT_MAX, ENC } \
 
 
 const AVOption ff_rtsp_options[] = {
@@ -132,6 +133,8 @@ static AVDictionary *map_to_opts(RTSPState *rt)
 
 snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
 av_dict_set(, "buffer_size", buf, 0);
+snprintf(buf, sizeof(buf), "%d", rt->pkt_size);
+av_dict_set(, "pkt_size", buf, 0);
 
 return opts;
 }
diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
index b49278fc20..54a9a30c16 100644
--- a/libavformat/rtsp.h
+++ b/libavformat/rtsp.h
@@ -410,6 +410,7 @@ typedef struct RTSPState {
 
 char default_lang[4];
 int buffer_size;
+int pkt_size;
 } RTSPState;
 
 #define RTSP_FLAG_FILTER_SRC  0x1/**< Filter incoming UDP packets -
-- 
2.17.1

___
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] rtsp: add pkt_size option

2019-05-01 Thread Tristan Matthews
On Thu, Apr 18, 2019 at 5:14 PM Tristan Matthews  wrote:
>
> On Mon, Apr 15, 2019 at 6:50 PM Tristan Matthews  wrote:
> >
> > This allows users to specify an upper limit on the size of outgoing packets
> > when publishing via RTSP.
> >
> > Signed-off-by: Martin Storsjö 
> > ---
> >  libavformat/rtsp.c | 5 -
> >  libavformat/rtsp.h | 1 +
> >  2 files changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> > index 8349840c96..c153cac88b 100644
> > --- a/libavformat/rtsp.c
> > +++ b/libavformat/rtsp.c
> > @@ -76,7 +76,8 @@
> >
> >  #define COMMON_OPTS() \
> >  { "reorder_queue_size", "set number of packets to buffer for handling 
> > of reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { 
> > .i64 = -1 }, -1, INT_MAX, DEC }, \
> > -{ "buffer_size","Underlying protocol send/receive buffer 
> > size",  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { 
> > .i64 = -1 }, -1, INT_MAX, DEC|ENC } \
> > +{ "buffer_size","Underlying protocol send/receive buffer 
> > size",  OFFSET(buffer_size),   AV_OPT_TYPE_INT, { 
> > .i64 = -1 }, -1, INT_MAX, DEC|ENC }, \
> > +{ "pkt_size",   "Underlying protocol send packet size",
> >   OFFSET(pkt_size),  AV_OPT_TYPE_INT, { .i64 = 
> > -1 }, -1, INT_MAX, ENC } \
> >
> >
> >  const AVOption ff_rtsp_options[] = {
> > @@ -132,6 +133,8 @@ static AVDictionary *map_to_opts(RTSPState *rt)
> >
> >  snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
> >  av_dict_set(, "buffer_size", buf, 0);
> > +snprintf(buf, sizeof(buf), "%d", rt->pkt_size);
> > +av_dict_set(, "pkt_size", buf, 0);
> >
> >  return opts;
> >  }
> > diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
> > index b49278fc20..54a9a30c16 100644
> > --- a/libavformat/rtsp.h
> > +++ b/libavformat/rtsp.h
> > @@ -410,6 +410,7 @@ typedef struct RTSPState {
> >
> >  char default_lang[4];
> >  int buffer_size;
> > +int pkt_size;
> >  } RTSPState;
> >
> >  #define RTSP_FLAG_FILTER_SRC  0x1/**< Filter incoming UDP packets -
> > --
> > 2.17.1
> >
>
> Ping.

Ping.

Best,
-t
___
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] rtsp: add pkt_size option

2019-04-18 Thread Tristan Matthews
On Mon, Apr 15, 2019 at 6:50 PM Tristan Matthews  wrote:
>
> This allows users to specify an upper limit on the size of outgoing packets
> when publishing via RTSP.
>
> Signed-off-by: Martin Storsjö 
> ---
>  libavformat/rtsp.c | 5 -
>  libavformat/rtsp.h | 1 +
>  2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 8349840c96..c153cac88b 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -76,7 +76,8 @@
>
>  #define COMMON_OPTS() \
>  { "reorder_queue_size", "set number of packets to buffer for handling of 
> reordered packets", OFFSET(reordering_queue_size), AV_OPT_TYPE_INT, { .i64 = 
> -1 }, -1, INT_MAX, DEC }, \
> -{ "buffer_size","Underlying protocol send/receive buffer size",  
> OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 
> }, -1, INT_MAX, DEC|ENC } \
> +{ "buffer_size","Underlying protocol send/receive buffer size",  
> OFFSET(buffer_size),   AV_OPT_TYPE_INT, { .i64 = -1 
> }, -1, INT_MAX, DEC|ENC }, \
> +{ "pkt_size",   "Underlying protocol send packet size",  
> OFFSET(pkt_size),  AV_OPT_TYPE_INT, { .i64 = -1 
> }, -1, INT_MAX, ENC } \
>
>
>  const AVOption ff_rtsp_options[] = {
> @@ -132,6 +133,8 @@ static AVDictionary *map_to_opts(RTSPState *rt)
>
>  snprintf(buf, sizeof(buf), "%d", rt->buffer_size);
>  av_dict_set(, "buffer_size", buf, 0);
> +snprintf(buf, sizeof(buf), "%d", rt->pkt_size);
> +av_dict_set(, "pkt_size", buf, 0);
>
>  return opts;
>  }
> diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h
> index b49278fc20..54a9a30c16 100644
> --- a/libavformat/rtsp.h
> +++ b/libavformat/rtsp.h
> @@ -410,6 +410,7 @@ typedef struct RTSPState {
>
>  char default_lang[4];
>  int buffer_size;
> +int pkt_size;
>  } RTSPState;
>
>  #define RTSP_FLAG_FILTER_SRC  0x1/**< Filter incoming UDP packets -
> --
> 2.17.1
>

Ping.
___
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] matroskaenc: fix leak on error

2019-04-09 Thread Tristan Matthews
On Thu, Apr 4, 2019 at 12:56 PM Tristan Matthews  wrote:
>
> ---
>  libavformat/matroskaenc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
> index b9f99c4463..1a06103c5d 100644
> --- a/libavformat/matroskaenc.c
> +++ b/libavformat/matroskaenc.c
> @@ -694,8 +694,10 @@ static int put_flac_codecpriv(AVFormatContext *s,
>  av_dict_set(, "WAVEFORMATEXTENSIBLE_CHANNEL_MASK", buf, 0);
>
>  len = ff_vorbiscomment_length(dict, vendor, NULL, 0);
> -if (len >= ((1<<24) - 4))
> +if (len >= ((1<<24) - 4)) {
> +av_dict_free();
>  return AVERROR(EINVAL);
> +}
>
>  data = av_malloc(len + 4);
>  if (!data) {
> --
> 2.17.1
>

Ping (this shouldn't conflict with any of the recent matroskaenc patches).

Best,
Tristan
___
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/1] ffmpeg: gnutls: ignore TLS rehandshake requests

2020-02-12 Thread Tristan Matthews
Log a warning instead of terminating.

TLS does not explicitly require that the client initiate the handshake when
requested by the server, it can be ignored (although the server is free to
break the connection if no handshake is forthcoming).

https://www.gnutls.org/manual/html_node/Core-TLS-API.html#gnutls_005frehandshake
---
 libavformat/tls_gnutls.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/tls_gnutls.c b/libavformat/tls_gnutls.c
index f32bc2821b..db9d50b586 100644
--- a/libavformat/tls_gnutls.c
+++ b/libavformat/tls_gnutls.c
@@ -81,6 +81,9 @@ static int print_tls_error(URLContext *h, int ret)
 case GNUTLS_E_PREMATURE_TERMINATION:
 #endif
 break;
+case GNUTLS_E_REHANDSHAKE:
+av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
+return 0;
 case GNUTLS_E_WARNING_ALERT_RECEIVED:
 av_log(h, AV_LOG_WARNING, "%s\n", gnutls_strerror(ret));
 break;
-- 
2.20.1

___
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 1/1] avcodec/libopusdec: Enable FEC/PLC

2021-05-18 Thread Tristan Matthews
On Thu, Feb 18, 2021 at 11:39 AM Philip-Dylan Gleonec
 wrote:
>
> Here is the reworked patch properly attached.
> Sorry about the duplicate mail, I just noticed I had a mishap with my
> mail client and the previous patch was scrubbed.
>
> Signed-off-by: Philip-Dylan Gleonec 
> 
> Co-developed-by: Steinar H. Gunderson 
> ---
>  libavcodec/libopusdec.c | 107 +++-
>  1 file changed, 96 insertions(+), 11 deletions(-)
>
> diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c
> index 082a431c6c..3de784dfbd 100644
> --- a/libavcodec/libopusdec.c
> +++ b/libavcodec/libopusdec.c
> @@ -43,10 +43,15 @@ struct libopus_context {
>  #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
>  int apply_phase_inv;
>  #endif
> +int decode_fec;
> +int64_t expected_next_pts;
>  };
>
>  #define OPUS_HEAD_SIZE 19
>
> +// Sample rate is constant as libopus always output at 48kHz
> +const AVRational opus_timebase = { 1, 48000 };
> +
>  static av_cold int libopus_decode_init(AVCodecContext *avc)
>  {
>  struct libopus_context *opus = avc->priv_data;
> @@ -134,6 +139,8 @@ static av_cold int libopus_decode_init(AVCodecContext 
> *avc)
>  /* Decoder delay (in samples) at 48kHz */
>  avc->delay = avc->internal->skip_samples = opus->pre_skip;
>
> +opus->expected_next_pts = AV_NOPTS_VALUE;
> +
>  return 0;
>  }
>
> @@ -155,25 +162,102 @@ static int libopus_decode(AVCodecContext *avc, void 
> *data,
>  {
>  struct libopus_context *opus = avc->priv_data;
>  AVFrame *frame   = data;
> -int ret, nb_samples;
> +uint8_t *outptr;
> +int ret, nb_samples = 0, nb_lost_samples = 0, nb_samples_left;
> +
> +// If FEC is enabled, calculate number of lost samples
> +if (opus->decode_fec &&
> +opus->expected_next_pts != AV_NOPTS_VALUE &&
> +pkt->pts != AV_NOPTS_VALUE &&
> +pkt->pts != opus->expected_next_pts) {
> +// Cap at recovering 120 ms of lost audio.
> +nb_lost_samples = pkt->pts - opus->expected_next_pts;
> +nb_lost_samples = FFMIN(nb_lost_samples, MAX_FRAME_SIZE);
> +// pts is expressed in ms for some containers (e.g. mkv)
> +// FEC only works for SILK frames (> 10ms)
> +// Detect if nb_lost_samples is in ms, and convert in samples if it 
> is
> +if (nb_lost_samples > 0) {
> +if (avc->pkt_timebase.den != 48000) {
> +nb_lost_samples = av_rescale_q(nb_lost_samples, 
> avc->pkt_timebase, opus_timebase);
> +}
> +// For FEC/PLC, frame_size has to be to have a multiple of 2.5 ms
> +if (nb_lost_samples % (int)(2.5 / 1000 * opus_timebase.den)) {
> +nb_lost_samples -= nb_lost_samples % (int)(2.5 / 1000 * 
> opus_timebase.den);
> +}
> +}
> +}
>
> -frame->nb_samples = MAX_FRAME_SIZE;
> +frame->nb_samples = MAX_FRAME_SIZE + nb_lost_samples;
>  if ((ret = ff_get_buffer(avc, frame, 0)) < 0)
>  return ret;
>
> +outptr = frame->data[0];
> +nb_samples_left = frame->nb_samples;
> +
> +if (opus->decode_fec && nb_lost_samples > 0) {
> +// Try to recover the lost samples with FEC data from this one.
> +// If there's no FEC data, the decoder will do loss concealment 
> instead.
> +if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
> +ret = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
> +  (opus_int16 *)outptr,
> +  nb_lost_samples, 1);
> +else
> +ret = opus_multistream_decode_float(opus->dec, pkt->data, 
> pkt->size,
> +   (float *)outptr,
> +   nb_lost_samples, 1);
> +
> +if (ret < 0) {
> +if (opus->decode_fec) opus->expected_next_pts = pkt->pts + 
> pkt->duration;
> +av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n",
> +   opus_strerror(ret));
> +return ff_opus_error_to_averror(ret);
> +}
> +
> +av_log(avc, AV_LOG_WARNING, "Recovered %d samples with FEC/PLC\n",
> +   ret);
> +
> +outptr += ret * avc->channels * 
> av_get_bytes_per_sample(avc->sample_fmt);
> +nb_samples_left -= ret;
> +nb_samples += ret;
> +if (pkt->pts != AV_NOPTS_VALUE) {
> +frame->pts = pkt->pts - ret;
> +}
> +}
> +
> +// Decode the actual, non-lost data.
>  if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
> -nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
> - (opus_int16 *)frame->data[0],
> - frame->nb_samples, 0);
> +ret = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
> +  (opus_int16 *)outptr,
> +   

Re: [FFmpeg-devel] [PATCH 1/1] avcodec/libopusdec: Enable FEC/PLC

2021-05-19 Thread Tristan Matthews
On Thu, Feb 18, 2021 at 11:39 AM Philip-Dylan Gleonec
 wrote:
>
> Here is the reworked patch properly attached.
> Sorry about the duplicate mail, I just noticed I had a mishap with my
> mail client and the previous patch was scrubbed.
>
> Signed-off-by: Philip-Dylan Gleonec 
> 
> Co-developed-by: Steinar H. Gunderson 
> ---
>  libavcodec/libopusdec.c | 107 +++-
>  1 file changed, 96 insertions(+), 11 deletions(-)
>
> diff --git a/libavcodec/libopusdec.c b/libavcodec/libopusdec.c
> index 082a431c6c..3de784dfbd 100644
> --- a/libavcodec/libopusdec.c
> +++ b/libavcodec/libopusdec.c
> @@ -43,10 +43,15 @@ struct libopus_context {
>  #ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST
>  int apply_phase_inv;
>  #endif
> +int decode_fec;
> +int64_t expected_next_pts;
>  };
>
>  #define OPUS_HEAD_SIZE 19
>
> +// Sample rate is constant as libopus always output at 48kHz
> +const AVRational opus_timebase = { 1, 48000 };
> +
>  static av_cold int libopus_decode_init(AVCodecContext *avc)
>  {
>  struct libopus_context *opus = avc->priv_data;
> @@ -134,6 +139,8 @@ static av_cold int libopus_decode_init(AVCodecContext 
> *avc)
>  /* Decoder delay (in samples) at 48kHz */
>  avc->delay = avc->internal->skip_samples = opus->pre_skip;
>
> +opus->expected_next_pts = AV_NOPTS_VALUE;
> +
>  return 0;
>  }
>
> @@ -155,25 +162,102 @@ static int libopus_decode(AVCodecContext *avc, void 
> *data,
>  {
>  struct libopus_context *opus = avc->priv_data;
>  AVFrame *frame   = data;
> -int ret, nb_samples;
> +uint8_t *outptr;
> +int ret, nb_samples = 0, nb_lost_samples = 0, nb_samples_left;
> +
> +// If FEC is enabled, calculate number of lost samples
> +if (opus->decode_fec &&
> +opus->expected_next_pts != AV_NOPTS_VALUE &&
> +pkt->pts != AV_NOPTS_VALUE &&
> +pkt->pts != opus->expected_next_pts) {
> +// Cap at recovering 120 ms of lost audio.
> +nb_lost_samples = pkt->pts - opus->expected_next_pts;
> +nb_lost_samples = FFMIN(nb_lost_samples, MAX_FRAME_SIZE);
> +// pts is expressed in ms for some containers (e.g. mkv)
> +// FEC only works for SILK frames (> 10ms)
> +// Detect if nb_lost_samples is in ms, and convert in samples if it 
> is
> +if (nb_lost_samples > 0) {
> +if (avc->pkt_timebase.den != 48000) {
> +nb_lost_samples = av_rescale_q(nb_lost_samples, 
> avc->pkt_timebase, opus_timebase);
> +}
> +// For FEC/PLC, frame_size has to be to have a multiple of 2.5 ms
> +if (nb_lost_samples % (int)(2.5 / 1000 * opus_timebase.den)) {
> +nb_lost_samples -= nb_lost_samples % (int)(2.5 / 1000 * 
> opus_timebase.den);
> +}
> +}
> +}
>
> -frame->nb_samples = MAX_FRAME_SIZE;
> +frame->nb_samples = MAX_FRAME_SIZE + nb_lost_samples;
>  if ((ret = ff_get_buffer(avc, frame, 0)) < 0)
>  return ret;
>
> +outptr = frame->data[0];
> +nb_samples_left = frame->nb_samples;
> +
> +if (opus->decode_fec && nb_lost_samples > 0) {
> +// Try to recover the lost samples with FEC data from this one.
> +// If there's no FEC data, the decoder will do loss concealment 
> instead.
> +if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
> +ret = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
> +  (opus_int16 *)outptr,
> +  nb_lost_samples, 1);
> +else
> +ret = opus_multistream_decode_float(opus->dec, pkt->data, 
> pkt->size,
> +   (float *)outptr,
> +   nb_lost_samples, 1);
> +
> +if (ret < 0) {
> +if (opus->decode_fec) opus->expected_next_pts = pkt->pts + 
> pkt->duration;
> +av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n",
> +   opus_strerror(ret));
> +return ff_opus_error_to_averror(ret);
> +}
> +
> +av_log(avc, AV_LOG_WARNING, "Recovered %d samples with FEC/PLC\n",
> +   ret);
> +
> +outptr += ret * avc->channels * 
> av_get_bytes_per_sample(avc->sample_fmt);
> +nb_samples_left -= ret;
> +nb_samples += ret;
> +if (pkt->pts != AV_NOPTS_VALUE) {
> +frame->pts = pkt->pts - ret;
> +}
> +}
> +
> +// Decode the actual, non-lost data.
>  if (avc->sample_fmt == AV_SAMPLE_FMT_S16)
> -nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
> - (opus_int16 *)frame->data[0],
> - frame->nb_samples, 0);
> +ret = opus_multistream_decode(opus->dec, pkt->data, pkt->size,
> +  (opus_int16 *)outptr,
> +   

Re: [FFmpeg-devel] [PATCH] avfilter: add Audio Video Sync Test filter

2022-04-12 Thread Tristan Matthews
Hi,

On Mon, Apr 11, 2022 at 2:02 PM Paul B Mahol  wrote:

> On Sat, Apr 9, 2022 at 9:21 PM Paul B Mahol  wrote:
>
> >
> > will apply soon
> >
>
>
> Forgot to apply, will apply in next 24h.
>

Am I missing something obvious or is there a default that's maybe not set?
Getting:
./ffmpeg_g -loglevel debug -y -t 5 -hide_banner -f lavfi -i avsynctest -f
mp4 avsync.mp4
 [lavfi @ 0x55e4454c37c0] Output pad "video" with type video of the filter
instance "Parsed_avsynctest_0" of avsynctest not connected to any
destination
avsynctest: Invalid argument

whereas the equivalent works with e.g., testsrc

Best,
Tristan

___
> 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] avfilter: add Audio Video Sync Test filter

2022-04-12 Thread Tristan Matthews
On Tue, Apr 12, 2022 at 2:05 PM Paul B Mahol  wrote:

> On Tue, Apr 12, 2022 at 7:43 PM Tristan Matthews 
> wrote:
>
> > Hi,
> >
> > On Mon, Apr 11, 2022 at 2:02 PM Paul B Mahol  wrote:
> >
> > > On Sat, Apr 9, 2022 at 9:21 PM Paul B Mahol  wrote:
> > >
> > > >
> > > > will apply soon
> > > >
> > >
> > >
> > > Forgot to apply, will apply in next 24h.
> > >
> >
> > Am I missing something obvious or is there a default that's maybe not
> set?
> > Getting:
> > ./ffmpeg_g -loglevel debug -y -t 5 -hide_banner -f lavfi -i avsynctest -f
> > mp4 avsync.mp4
> >  [lavfi @ 0x55e4454c37c0] Output pad "video" with type video of the
> filter
> > instance "Parsed_avsynctest_0" of avsynctest not connected to any
> > destination
> > avsynctest: Invalid argument
> >
> > whereas the equivalent works with e.g., testsrc
> >
>
> Filter have 2 outputs, unlike other filters with single output.
>
> Need to specify that 2nd output is also output with [out1]
>
>
Oh cheers, this worked:
avsynctest=[out0][out1]


> > ___
> > 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 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/1] librtmp: make flashVer case consistent

2022-04-05 Thread Tristan Matthews
This is basically a cosmetic change (no functional difference).

---
 libavformat/librtmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 43013e46e0..b23adb9593 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -115,7 +115,7 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 if (ctx->app)  len += strlen(ctx->app)  + sizeof(" app=");
 if (ctx->tcurl)len += strlen(ctx->tcurl)+ sizeof(" tcUrl=");
 if (ctx->pageurl)  len += strlen(ctx->pageurl)  + sizeof(" pageUrl=");
-if (ctx->flashver) len += strlen(ctx->flashver) + sizeof(" flashver=");
+if (ctx->flashver) len += strlen(ctx->flashver) + sizeof(" flashVer=");
 
 if (ctx->conn) {
 char *sep, *p = ctx->conn;
-- 
2.32.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 1/1] librtmp: make flashVer case consistent

2022-04-11 Thread Tristan Matthews
On Sat, Apr 9, 2022 at 2:45 PM Marton Balint  wrote:

>
>
> On Wed, 6 Apr 2022, Tristan Matthews wrote:
>
> > This is basically a cosmetic change (no functional difference).
> >
> > ---
> > libavformat/librtmp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
> > index 43013e46e0..b23adb9593 100644
> > --- a/libavformat/librtmp.c
> > +++ b/libavformat/librtmp.c
> > @@ -115,7 +115,7 @@ static int rtmp_open(URLContext *s, const char *uri,
> int flags)
> > if (ctx->app)  len += strlen(ctx->app)  + sizeof(" app=");
> > if (ctx->tcurl)len += strlen(ctx->tcurl)+ sizeof(" tcUrl=");
> > if (ctx->pageurl)  len += strlen(ctx->pageurl)  + sizeof("
> pageUrl=");
> > -if (ctx->flashver) len += strlen(ctx->flashver) + sizeof("
> flashver=");
> > +if (ctx->flashver) len += strlen(ctx->flashver) + sizeof("
> flashVer=");
>
> Actually this whole rtmp_open function should be reworked to use an
> AVBPrint buffer to generate the rtmp URL. The way it works now -
> calculating the length first then creating the actual sting - is
> very ugly.
>
>
Oh yeah good call, I will follow up with that instead.
___
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/1] librtmp: use AVBPrint instead of char *

2022-04-11 Thread Tristan Matthews
This avoids having to do one pass to calculate the full length to allocate
followed by a second pass to actually append values.
---
 libavformat/librtmp.c | 123 +++---
 1 file changed, 32 insertions(+), 91 deletions(-)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 43013e46e0..7b379e48ee 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "avformat.h"
@@ -50,7 +51,6 @@ typedef struct LibRTMPContext {
 char *pageurl;
 char *client_buffer_time;
 int live;
-char *temp_filename;
 int buffer_size;
 } LibRTMPContext;
 
@@ -76,7 +76,6 @@ static int rtmp_close(URLContext *s)
 RTMP *r = >rtmp;
 
 RTMP_Close(r);
-av_freep(>temp_filename);
 return 0;
 }
 
@@ -94,11 +93,11 @@ static int rtmp_close(URLContext *s)
  */
 static int rtmp_open(URLContext *s, const char *uri, int flags)
 {
+AVBPrint filename;
 LibRTMPContext *ctx = s->priv_data;
 RTMP *r = >rtmp;
 int rc = 0, level;
-char *filename = s->filename;
-int len = strlen(s->filename) + 1;
+av_bprint_init(, 0, AV_BPRINT_SIZE_UNLIMITED);
 
 switch (av_log_get_level()) {
 default:
@@ -112,118 +111,58 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 RTMP_LogSetLevel(level);
 RTMP_LogSetCallback(rtmp_log);
 
-if (ctx->app)  len += strlen(ctx->app)  + sizeof(" app=");
-if (ctx->tcurl)len += strlen(ctx->tcurl)+ sizeof(" tcUrl=");
-if (ctx->pageurl)  len += strlen(ctx->pageurl)  + sizeof(" pageUrl=");
-if (ctx->flashver) len += strlen(ctx->flashver) + sizeof(" flashver=");
-
+av_bprintf(, "%s", s->filename);
+if (ctx->app)
+av_bprintf(, " app=%s", ctx->app);
+if (ctx->tcurl)
+av_bprintf(, " tcUrl=%s", ctx->tcurl);
+if (ctx->pageurl)
+av_bprintf(, " pageUrl=%s", ctx->pageurl);
+if (ctx->swfurl)
+av_bprintf(, " swfUrl=%s", ctx->swfurl);
+if (ctx->flashver)
+av_bprintf(, " flashVer=%s", ctx->flashver);
 if (ctx->conn) {
 char *sep, *p = ctx->conn;
-int options = 0;
-
 while (p) {
-options++;
+av_bprintf(,  " conn=");
 p += strspn(p, " ");
 if (!*p)
 break;
 sep = strchr(p, ' ');
+if (sep)
+*sep = '\0';
+av_bprintf(, "%s", p);
+
 if (sep)
 p = sep + 1;
 else
 break;
 }
-len += options * sizeof(" conn=");
-len += strlen(ctx->conn);
 }
-
 if (ctx->playpath)
-len += strlen(ctx->playpath) + sizeof(" playpath=");
+av_bprintf(, " playpath=%s", ctx->playpath);
 if (ctx->live)
-len += sizeof(" live=1");
+av_bprintf(, " live=1");
 if (ctx->subscribe)
-len += strlen(ctx->subscribe) + sizeof(" subscribe=");
-
+av_bprintf(, " subscribe=%s", ctx->subscribe);
 if (ctx->client_buffer_time)
-len += strlen(ctx->client_buffer_time) + sizeof(" buffer=");
-
+av_bprintf(, " buffer=%s", ctx->client_buffer_time);
 if (ctx->swfurl || ctx->swfverify) {
-len += sizeof(" swfUrl=");
-
 if (ctx->swfverify)
-len += strlen(ctx->swfverify) + sizeof(" swfVfy=1");
+av_bprintf(, " swfUrl=%s swfVfy=1", ctx->swfverify);
 else
-len += strlen(ctx->swfurl);
+av_bprintf(, " swfUrl=%s", ctx->swfurl);
 }
 
-if (!(ctx->temp_filename = filename = av_malloc(len)))
+if (!av_bprint_is_complete()) {
+av_bprint_finalize(, NULL);
 return AVERROR(ENOMEM);
-
-av_strlcpy(filename, s->filename, len);
-if (ctx->app) {
-av_strlcat(filename, " app=", len);
-av_strlcat(filename, ctx->app, len);
-}
-if (ctx->tcurl) {
-av_strlcat(filename, " tcUrl=", len);
-av_strlcat(filename, ctx->tcurl, len);
-}
-if (ctx->pageurl) {
-av_strlcat(filename, " pageUrl=", len);
-av_strlcat(filename, ctx->pageurl, len);
-}
-if (ctx->swfurl) {
-av_strlcat(filename, " swfUrl=", len);
-av_strlcat(filename, ctx->swfurl, len);
-}
-if (ctx->flashver) {
-av_strlcat(filename, " flashVer=", len);
-av_strlcat(filename, ctx->flashver, len);
-}
-if (ctx->conn) {
-char *sep, *p = ctx->conn;
-while (p) {
-av_strlcat(filename, " conn=", len);
-p += strspn(p, " ");
-if (!*p)
-break;
-sep = strchr(p, ' ');
-if (sep)
-*sep = '\0';
-av_strlcat(filename, p, len);
-
-if (sep)
-p = sep + 1;
-else
-break;
-}
-}
-if (ctx->playpath) {
-

Re: [FFmpeg-devel] [PATCH 1/1] librtmp: use AVBPrint instead of char *

2022-04-15 Thread Tristan Matthews
On Wed, Apr 13, 2022 at 3:40 PM Marton Balint  wrote:

>
>
> On Wed, 13 Apr 2022, Martin Storsjö wrote:
>
> > On Mon, 11 Apr 2022, Tristan Matthews wrote:
> >
> >>  This avoids having to do one pass to calculate the full length to
> allocate
> >>  followed by a second pass to actually append values.
> >>  ---
> >>  libavformat/librtmp.c | 123 +++---
> >>  1 file changed, 32 insertions(+), 91 deletions(-)
> >
> > Thanks, this patch looks good to me. I'll wait for a little while still
> if
> > Marton wants to comment on it, before I go ahead and push it.
>
> According to commit 865461099e062de5a3a109c2a5be98004c11d8bd the buffer
> passed to RTMP_SetupURL has to be kept as long as the RTMP context is
> alive.
>
>
Oh good catch, I should've dug deeper as to why ctx->temp_filename existed.

Best,
Tristan



> Regards,
> Marton
> ___
> 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] [PATCH 1/1] librtmp: use AVBPrint instead of char *

2022-04-15 Thread Tristan Matthews
This avoids having to do one pass to calculate the full length to allocate
followed by a second pass to actually append values.
---
 libavformat/librtmp.c | 124 +++---
 1 file changed, 33 insertions(+), 91 deletions(-)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 43013e46e0..b7e9fc81cf 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -25,6 +25,7 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "avformat.h"
@@ -38,6 +39,7 @@
 
 typedef struct LibRTMPContext {
 const AVClass *class;
+AVBPrint filename;
 RTMP rtmp;
 char *app;
 char *conn;
@@ -50,7 +52,6 @@ typedef struct LibRTMPContext {
 char *pageurl;
 char *client_buffer_time;
 int live;
-char *temp_filename;
 int buffer_size;
 } LibRTMPContext;
 
@@ -76,7 +77,7 @@ static int rtmp_close(URLContext *s)
 RTMP *r = >rtmp;
 
 RTMP_Close(r);
-av_freep(>temp_filename);
+av_bprint_finalize(>filename, NULL);
 return 0;
 }
 
@@ -97,8 +98,8 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 LibRTMPContext *ctx = s->priv_data;
 RTMP *r = >rtmp;
 int rc = 0, level;
-char *filename = s->filename;
-int len = strlen(s->filename) + 1;
+/* This needs to stay allocated for as long as the RTMP context exists. */
+av_bprint_init(>filename, 0, AV_BPRINT_SIZE_UNLIMITED);
 
 switch (av_log_get_level()) {
 default:
@@ -112,118 +113,58 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 RTMP_LogSetLevel(level);
 RTMP_LogSetCallback(rtmp_log);
 
-if (ctx->app)  len += strlen(ctx->app)  + sizeof(" app=");
-if (ctx->tcurl)len += strlen(ctx->tcurl)+ sizeof(" tcUrl=");
-if (ctx->pageurl)  len += strlen(ctx->pageurl)  + sizeof(" pageUrl=");
-if (ctx->flashver) len += strlen(ctx->flashver) + sizeof(" flashver=");
-
+av_bprintf(>filename, "%s", s->filename);
+if (ctx->app)
+av_bprintf(>filename, " app=%s", ctx->app);
+if (ctx->tcurl)
+av_bprintf(>filename, " tcUrl=%s", ctx->tcurl);
+if (ctx->pageurl)
+av_bprintf(>filename, " pageUrl=%s", ctx->pageurl);
+if (ctx->swfurl)
+av_bprintf(>filename, " swfUrl=%s", ctx->swfurl);
+if (ctx->flashver)
+av_bprintf(>filename, " flashVer=%s", ctx->flashver);
 if (ctx->conn) {
 char *sep, *p = ctx->conn;
-int options = 0;
-
 while (p) {
-options++;
+av_bprintf(>filename,  " conn=");
 p += strspn(p, " ");
 if (!*p)
 break;
 sep = strchr(p, ' ');
+if (sep)
+*sep = '\0';
+av_bprintf(>filename, "%s", p);
+
 if (sep)
 p = sep + 1;
 else
 break;
 }
-len += options * sizeof(" conn=");
-len += strlen(ctx->conn);
 }
-
 if (ctx->playpath)
-len += strlen(ctx->playpath) + sizeof(" playpath=");
+av_bprintf(>filename, " playpath=%s", ctx->playpath);
 if (ctx->live)
-len += sizeof(" live=1");
+av_bprintf(>filename, " live=1");
 if (ctx->subscribe)
-len += strlen(ctx->subscribe) + sizeof(" subscribe=");
-
+av_bprintf(>filename, " subscribe=%s", ctx->subscribe);
 if (ctx->client_buffer_time)
-len += strlen(ctx->client_buffer_time) + sizeof(" buffer=");
-
+av_bprintf(>filename, " buffer=%s", ctx->client_buffer_time);
 if (ctx->swfurl || ctx->swfverify) {
-len += sizeof(" swfUrl=");
-
 if (ctx->swfverify)
-len += strlen(ctx->swfverify) + sizeof(" swfVfy=1");
+av_bprintf(>filename, " swfUrl=%s swfVfy=1", ctx->swfverify);
 else
-len += strlen(ctx->swfurl);
+av_bprintf(>filename, " swfUrl=%s", ctx->swfurl);
 }
 
-if (!(ctx->temp_filename = filename = av_malloc(len)))
+if (!av_bprint_is_complete(>filename)) {
+av_bprint_finalize(>filename, NULL);
 return AVERROR(ENOMEM);
-
-av_strlcpy(filename, s->filename, len);
-if (ctx->app) {
-av_strlcat(filename, " app=", len);
-av_strlcat(filename, ctx->app, len);
-}
-if (ctx->tcurl) {
-av_strlcat(filename, " tcUrl=", len);
-av_strlcat(filename, ctx->tcurl, len);
-}
-if (ctx->pageurl) {
-av_strlcat(filename, " pageUrl=", len);
-av_strlcat(filename, ctx->pageurl, len);
-}
-if (ctx->swfurl) {
-av_strlcat(filename, " swfUrl=", len);
-av_strlcat(filename, ctx->swfurl, len);
-}
-if (ctx->flashver) {
-av_strlcat(filename, " flashVer=", len);
-av_strlcat(filename, ctx->flashver, len);
-}
-if (ctx->conn) {
-char *sep, *p = ctx->conn;
-while (p) {
-av_strlcat(filename, " conn=", len);
-  

Re: [FFmpeg-devel] [PATCH] configure: disable libglslang/libshaderc if the vulkan is disabled

2023-10-15 Thread Tristan Matthews
On Sat, Oct 14, 2023 at 12:38 PM Lynne  wrote:
>
> Fixes build failures when the Vulkan headers are too old and libglslang
> or libshaderc are enabled.

This fixes https://trac.ffmpeg.org/ticket/10596

Tested-by: Tristan Matthews 

>
> Patch attached.
>
> ___
> 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] avfillter/buffersrc: activate and EOF fix

2023-11-02 Thread Tristan Matthews
On Thu, Nov 2, 2023 at 6:10 AM Paul B Mahol  wrote:
>
> On Thu, Nov 2, 2023 at 11:03 AM Nicolas George  wrote:
>
> > Paul B Mahol (12023-11-02):
> > > I analyzed it already, It is very sorry state of libavfilter that
> > buffersrc
> > > keeps sending frames to EOF filtergraph.
> >
> > So, Paul, I will explain this to you one last time.
> >
> > Remember high school, when you had math test, and if you just gave the
> > result you got almost no points even if the result was correct? That was
> > because solving a math exercise is not just about finding the result, it
> > is about showing how you reach the result and proving that the result is
> > correct.
> >
> > The same goes here. On your own projects, you can change randomly the
> > code until a bug is no longer triggered and call it fixed.
> >
> > But in FFmpeg, you are not alone, and when a change is not trivial you
> > have to prove to your fellow developers that it is correct and
> > necessary.
> >
> > So get to work, produce that proof, re-submit the patch with the proof
> > in the commit message, and then we can talk.
> >
> > As it is, the need to switch buffersrc to activate is not established,
> > and therefore it should not be done.
> >
>
> I do not understand. What proof you need?
> Have you even tested this JEEB script without patches applied?
> It should straight forward cause OOM bomb.
>
> Have you noticed that buffersrc filter never checks outlink status of its
> output link?
>

Just to confirm that I can reproduce JEEB's test, before the patches:

Maximum resident set size (kbytes): 629568

with *both* patches applied:

Maximum resident set size (kbytes): 80920

Best,
Tristan

>
> >
> > --
> >   Nicolas George
> > ___
> > 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 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] [RFC] Release 6.1

2023-11-07 Thread Tristan Matthews
On Tue, Nov 7, 2023 at 2:36 AM Lynne  wrote:
>
> Oct 29, 2023, 06:57 by d...@lynne.ee:
>
> > Oct 29, 2023, 05:51 by mich...@niedermayer.cc:
> >
> >> On Sat, Oct 28, 2023 at 09:23:45PM +0200, Lynne wrote:
> >>
> >>> Oct 28, 2023, 18:49 by mich...@niedermayer.cc:
> >>>
> >>> > On Thu, Jul 06, 2023 at 06:04:41PM +0200, Lynne wrote:
> >>> >
> >>> >> It's been a while since we've had a release, and we've had
> >>> >> a lot of new features in.
> >>> >> We did say we would make releases more often, and I think
> >>> >> it's about time we have a new release.
> >>> >>
> >>> >> Anything anyone wants to have merged or should we branch
> >>> >> off 6.1 in a few days?
> >>> >>
> >>> >
> >>> > Whats the status of this ?
> >>> > I can branch 6.1 anytime
> >>> >
> >>> > It was just that jb told me
> >>> > "6.1 opportunity is gone.
> >>> >  We're too late on the schedule, and noone had time to work on it, so 
> >>> > it is wiser to target 7.0 in January"
> >>> >
> >>> > but now i see on IRC
> >>> >  make a damn release already
> >>> >  j-b: drop MiNi from release maintership and nominate 
> >>> > Lynne
> >>> >  I pledge to bring back /slap IRC messages to those who fail to 
> >>> > push the patches they want for release!
> >>> >  durandal_1707: good point, we should look at doing another 5.1.x 
> >>> > release and a 6.0.x release.
> >>> >
> >>> > noone mentioned 5.1.x and 6.0.x to me before
> >>> >
> >>> > anyway, ill try to make releases from all maintained branches,
> >>> >
> >>> > and will branch 6.1 as soon as Lynne or others say everything is ready.
> >>> >
> >>> > thx
> >>> >
> >>>
> >>> It's never too late to make a release. If we do a release now, nothing's 
> >>> stopping
> >>> us from doing a 7.0 and getting back on track with releases every two 
> >>> months or so,
> >>> like the plan was.
> >>>
> >>> 7.0 is likely to be a pretty big release, with YUVJ removal, (xHE) 
> >>> AAC+fixes, D3D12 hwdec,
> >>> Vulkan encode and Vulkan AV1, and VVC, and IAMF, and MLP work, so it's a 
> >>> good idea to
> >>> have a release before all this lands.
> >>>
> >>> I think the tree is in a pretty good state ATM, you should go ahead and 
> >>> branch if you're
> >>> comfortable with it as well.
> >>>
> >>
> >> branch made
> >>
> >
> > Thanks. I'll get a blog post ready for the transform work, as kierank 
> > wanted to post something,
> > and if users can know to who to point fingers to in case it degrades 
> > performance on RPI1 devices.
> >
> >
> >>> Let's aim for a release by Sunday next week. That should give everyone 
> >>> enough time to
> >>> backport fixes they want in.
> >>>
> >>
> >> I would aim for 1-3 weeks (when code and developers are ready)
> >> dont want to aim for a specific day, better pick a day when everything is 
> >> fine
> >> not too many distractions, ...
> >>
> >> Or is there something that favors us to be before a specific date ?
> >>
> >
> > Not really a reason, Sunday is just an optimistic date to aim for.
> > If there are no big fixes to backport to the branch, I think we can target 
> > it.
> >
>
> The nlmeans_vulkan patch I just sent is the last patch I'd like to have in 
> 6.1.
> Does anyone else have any patches they would like in 6.1?

I was going to request Steven Liu's enhanced RTMP set but it looks
like those are already in the release/6.1 branch, so cheers.

-t
___
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 4/6] libavformat/webrtc: add common code for WebRTC streaming

2023-11-06 Thread Tristan Matthews
On Mon, Nov 6, 2023 at 10:20 AM Michael Riedl
 wrote:
>
> Signed-off-by: Michael Riedl 
> ---
>  libavformat/webrtc.c | 398 +++
>  libavformat/webrtc.h |  70 
>  2 files changed, 468 insertions(+)
>  create mode 100644 libavformat/webrtc.c
>  create mode 100644 libavformat/webrtc.h
>
> diff --git a/libavformat/webrtc.c b/libavformat/webrtc.c
> new file mode 100644
> index 000..75884eac46f
> --- /dev/null
> +++ b/libavformat/webrtc.c
> @@ -0,0 +1,398 @@
> +/*
> + * WebRTC-HTTP ingestion/egress protocol (WHIP/WHEP) common code
> + *
> + * Copyright (C) 2023 NativeWaves GmbH 
> + * This work is supported by FFG project 47168763.
> + *
> + * 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/avstring.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/uuid.h"
> +#include "libavutil/random_seed.h"
> +#include "rtpenc_chain.h"
> +#include "rtsp.h"
> +#include "webrtc.h"
> +
> +static const char* webrtc_get_state_name(const rtcState state)
> +{
> +switch (state)
> +{
> +case RTC_NEW:
> +return "RTC_NEW";
> +case RTC_CONNECTING:
> +return "RTC_CONNECTING";
> +case RTC_CONNECTED:
> +return "RTC_CONNECTED";
> +case RTC_DISCONNECTED:
> +return "RTC_DISCONNECTED";
> +case RTC_FAILED:
> +return "RTC_FAILED";
> +case RTC_CLOSED:
> +return "RTC_CLOSED";
> +default:
> +return "UNKNOWN";
> +}
> +}
> +
> +static void webrtc_log(const rtcLogLevel rtcLevel, const char *const message)
> +{
> +int level = AV_LOG_VERBOSE;
> +switch (rtcLevel)
> +{
> +case RTC_LOG_NONE:
> +level = AV_LOG_QUIET;
> +break;
> +case RTC_LOG_DEBUG:
> +case RTC_LOG_VERBOSE:
> +level = AV_LOG_DEBUG;
> +break;
> +case RTC_LOG_INFO:
> +level = AV_LOG_VERBOSE;
> +break;
> +case RTC_LOG_WARNING:
> +level = AV_LOG_WARNING;
> +break;
> +case RTC_LOG_ERROR:
> +level = AV_LOG_ERROR;
> +break;
> +case RTC_LOG_FATAL:
> +level = AV_LOG_FATAL;
> +break;
> +}
> +
> +av_log(NULL, level, "[libdatachannel] %s\n", message);
> +}
> +
> +void webrtc_init_logger(void)
> +{
> +rtcLogLevel level = RTC_LOG_VERBOSE;
> +switch (av_log_get_level())
> +{
> +case AV_LOG_QUIET:
> +level = RTC_LOG_NONE;
> +break;
> +case AV_LOG_DEBUG:
> +level = RTC_LOG_DEBUG;
> +break;
> +case AV_LOG_VERBOSE:
> +level = RTC_LOG_VERBOSE;
> +break;
> +case AV_LOG_WARNING:
> +level = RTC_LOG_WARNING;
> +break;
> +case AV_LOG_ERROR:
> +level = RTC_LOG_ERROR;
> +break;
> +case AV_LOG_FATAL:
> +level = RTC_LOG_FATAL;
> +break;
> +}
> +
> +rtcInitLogger(level, webrtc_log);
> +}
> +
> +int webrtc_generate_media_stream_id(char media_stream_id[37])
> +{
> +int ret;
> +AVUUID uuid;
> +
> +ret = av_random_bytes(uuid, sizeof(uuid));
> +if (ret < 0) {
> +goto fail;
> +}
> +av_uuid_unparse(uuid, media_stream_id);
> +return 0;
> +
> +fail:
> +return ret;
> +}
> +
> +int webrtc_create_resource(DataChannelContext*const ctx)
> +{
> +int ret;
> +URLContext* h = NULL;
> +char* headers;
> +char offer_sdp[SDP_MAX_SIZE] = { 0 };
> +char response_sdp[SDP_MAX_SIZE] = { 0 };
> +
> +/* set local description */
> +if (rtcSetLocalDescription(ctx->peer_connection, "offer") != 
> RTC_ERR_SUCCESS) {
> +av_log(ctx->avctx, AV_LOG_ERROR, "Failed to set local 
> description\n");
> +ret = AVERROR_EXTERNAL;
> +goto fail;
> +}
> +
> +/* create offer */
> +ret = rtcGetLocalDescription(ctx->peer_connection, offer_sdp, 
> sizeof(offer_sdp));
> +if (ret < 0) {
> +av_log(ctx->avctx, AV_LOG_ERROR, "Failed to get local 
> description\n");
> +ret = AVERROR_EXTERNAL;
> +goto fail;
> +}
> +av_log(ctx->avctx, 

[FFmpeg-devel] [PATCH] configure: disable vulkan if min version insufficient

2023-09-29 Thread Tristan Matthews
Fixes: https://trac.ffmpeg.org/ticket/10596
---
 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 20db1801ed..50ba6f772f 100755
--- a/configure
+++ b/configure
@@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h 
libcrystalhd/libcrystalhd_if.
 
 if enabled vulkan; then
 check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" 
"defined VK_VERSION_1_3" ||
-check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) 
|| (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)"
+check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) 
|| (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)" ||
+warn "Disabling vulkan" && disable vulkan
 fi
 
 if enabled x86; then
-- 
2.39.2

___
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] configure: disable vulkan if min version insufficient

2023-09-29 Thread Tristan Matthews
On Fri, Sep 29, 2023 at 1:37 PM Timo Rothenpieler  wrote:
>
> On 29.09.2023 15:52, Tristan Matthews wrote:
> > Fixes: https://trac.ffmpeg.org/ticket/10596
> > ---
> >   configure | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index 20db1801ed..50ba6f772f 100755
> > --- a/configure
> > +++ b/configure
> > @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h 
> > libcrystalhd/libcrystalhd_if.
> >
> >   if enabled vulkan; then
> >   check_pkg_config_header_only vulkan "vulkan >= 1.3.255" 
> > "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
> > -check_cpp_condition vulkan "vulkan/vulkan.h" 
> > "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION 
> > >= 255)"
> > +check_cpp_condition vulkan "vulkan/vulkan.h" 
> > "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION 
> > >= 255)" ||
> > +warn "Disabling vulkan" && disable vulkan
> >   fi
>
> Doesn't that just always disable vulkan if any of the previous checks
> succeed? The logic looks weird to me.

No, it will only disable vulkan if all the previous checks fail as
this conditional shortcircuits (so to get to here it would have to be
false || false || false || false || false || warn "Disable vulkan" &&
disable vulkan). If I hack the version number to match mine (changing
it to 1.3.239), vulkan won't be disabled (that's why I added the
warning message) and you'll hit the build breakage I and others are
hitting currently.

>
> Also, shouldn't all of those check_* calls disable vulkan already?
> That's what the first argument is for.

They don't, so my first thought was that since this is the only place
where check_pkg_config_header_only is called, it seemed likely that
there was a bug in that function. However, I couldn't spot anything
obviously broken in it and it is returning the correct value (hence
this patch behaving as expected).

Best,
Tristan

> ___
> 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] configure: disable vulkan if min version insufficient

2023-09-29 Thread Tristan Matthews
On Fri, Sep 29, 2023 at 3:26 PM Timo Rothenpieler  wrote:
>
> On 29.09.2023 20:10, Tristan Matthews wrote:
> > On Fri, Sep 29, 2023 at 1:37 PM Timo Rothenpieler  
> > wrote:
> >>
> >> On 29.09.2023 15:52, Tristan Matthews wrote:
> >>> Fixes: https://trac.ffmpeg.org/ticket/10596
> >>> ---
> >>>configure | 3 ++-
> >>>1 file changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/configure b/configure
> >>> index 20db1801ed..50ba6f772f 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h 
> >>> libcrystalhd/libcrystalhd_if.
> >>>
> >>>if enabled vulkan; then
> >>>check_pkg_config_header_only vulkan "vulkan >= 1.3.255" 
> >>> "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
> >>> -check_cpp_condition vulkan "vulkan/vulkan.h" 
> >>> "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION 
> >>> >= 255)"
> >>> +check_cpp_condition vulkan "vulkan/vulkan.h" 
> >>> "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION 
> >>> >= 255)" ||
> >>> +warn "Disabling vulkan" && disable vulkan
> >>>fi
> >>
> >> Doesn't that just always disable vulkan if any of the previous checks
> >> succeed? The logic looks weird to me.
> >
> > No, it will only disable vulkan if all the previous checks fail as
> > this conditional shortcircuits (so to get to here it would have to be
> > false || false || false || false || false || warn "Disable vulkan" &&
> > disable vulkan). If I hack the version number to match mine (changing
> > it to 1.3.239), vulkan won't be disabled (that's why I added the
> > warning message) and you'll hit the build breakage I and others are
> > hitting currently.
>
> My shell disagrees:
>
> $ function warn() { echo $1; }
> $ true || false || warn "Disabling vulkan" && echo DISABLED
> DISABLED
> $ false || true || warn "Disabling vulkan" && echo DISABLED
> DISABLED
> $ false || false || warn "Disabling vulkan" && echo DISABLED
> Disabling vulkan
> DISABLED
> $ true || true || warn "Disabling vulkan" && echo DISABLED
> DISABLED
>
> No matter the results of the checks, this will always disable Vulkan,
> since the chain before it will always have a positive outcome, so &&
> continues.

Oh I see, I should have parens around the last bit, e.g.:
false || true || (warn "Disabling vulkan" && echo DISABLED)

but as Hendrik mentioned, the warning can be dropped in which case
this would become:
check_pkg_config_header_only vulkan ... || check_cpp_condition || disable vulkan

As mentioned earlier in the thread if someone has a better idea of how
to avoid explicitly calling disable vulkan like this (i.e. why isn't
this already working) that would of course be preferable.

Best,
-t
___
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] configure: disable vulkan if min version insufficient

2023-09-29 Thread Tristan Matthews
On Fri, Sep 29, 2023 at 2:32 PM Hendrik Leppkes  wrote:
>
> On Fri, Sep 29, 2023 at 3:55 PM Tristan Matthews  wrote:
> >
> > Fixes: https://trac.ffmpeg.org/ticket/10596
> > ---
> >  configure | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index 20db1801ed..50ba6f772f 100755
> > --- a/configure
> > +++ b/configure
> > @@ -7154,7 +7154,8 @@ enabled crystalhd && check_lib crystalhd "stdint.h 
> > libcrystalhd/libcrystalhd_if.
> >
> >  if enabled vulkan; then
> >  check_pkg_config_header_only vulkan "vulkan >= 1.3.255" 
> > "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
> > -check_cpp_condition vulkan "vulkan/vulkan.h" 
> > "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION 
> > >= 255)"
> > +check_cpp_condition vulkan "vulkan/vulkan.h" 
> > "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION 
> > >= 255)" ||
> > +warn "Disabling vulkan" && disable vulkan
> >  fi
> >
>
> This change doesn't seem right. If a feature is explicitly requested,
> we generally fail the build and don't just disable the feature
> (afterall the user wanted it to be on).

That is the case here, with or without this patch, on my system
--enable-vulkan will fail as expected on:
> ERROR: vulkan requested but not found

The bug I'm trying to address is the autodetect case. I'm happy to
drop the warning, I just wanted it to be obvious what was happening
(but one could infer it from the list of modules that will be built).

>  If the feature is not
> explicitly requested, then it should not print a message.
>
___
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 v1 2/2] avformat/rtmpproto: support enhanced rtmp

2023-08-24 Thread Tristan Matthews
Hi,

On Thu, Aug 24, 2023 at 1:32 AM Steven Liu  wrote:
>
> add option named rtmp_enhanced_codec,
> it would support hvc1,av01,vp09 now,
> the fourcc is using Array of strings.
>
> Signed-off-by: Steven Liu 
> ---
>  doc/protocols.texi  |  6 ++
>  libavformat/rtmpproto.c | 38 ++
>  2 files changed, 44 insertions(+)
>
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index b3fad55591..f2930fb3a2 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -896,6 +896,12 @@ be named, by prefixing the type with 'N' and specifying 
> the name before
>  the value (i.e. @code{NB:myFlag:1}). This option may be used multiple
>  times to construct arbitrary AMF sequences.
>
> +@item rtmp_enhanced_codec
> +Specify that the media is an enhanced rtmp live stream. This option should
> +set a sting like @code{hvc1,av01,vp09} for multiple codecs, or @code{hvc1}

I think this should be more like "Specify the codecs to use in an
enhanced rtmp live stream", the wording here makes it sound more like
a boolean flag.

Also nit: "set a string"

> +for only one codec, set codec fourcc into fourCcLive property into
> +Connect Command Message,
> +
>  @item rtmp_flashver
>  Version of the Flash plugin used to run the SWF player. The default
>  is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0 (compatible;
> diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
> index f0ef223f05..f7ce04244f 100644
> --- a/libavformat/rtmpproto.c
> +++ b/libavformat/rtmpproto.c
> @@ -127,6 +127,7 @@ typedef struct RTMPContext {
>  int   nb_streamid;///< The next stream id to 
> return on createStream calls
>  doubleduration;   ///< Duration of the stream in 
> seconds as returned by the server (only valid if non-zero)
>  int   tcp_nodelay;///< Use TCP_NODELAY to 
> disable Nagle's algorithm if set to 1
> +char  *enhanced;  ///< codecs list in enhanced 
> rtmp

nit: "codec list"
>  char  username[50];
>  char  password[50];
>  char  auth_params[500];
> @@ -336,6 +337,42 @@ static int gen_connect(URLContext *s, RTMPContext *rt)
>  ff_amf_write_field_name(, "app");
>  ff_amf_write_string2(, rt->app, rt->auth_params);
>
> +if (rt->enhanced) {
> +uint32_t list_len = 0;
> +char *fourcc_data = rt->enhanced;
> +int fourcc_str_len = fourcc_data ? strlen(fourcc_data) : 0;
> +
> +// check the string, fourcc + ',' + ...  + end fourcc correct length 
> should be (4+1)*n+4
> +if ((fourcc_str_len + 1) % 5 != 0)
> +return AVERROR(EINVAL);
> +
> +list_len = (fourcc_str_len + 1) / 5;
> +// write the fourCcList field name
> +ff_amf_write_field_name(, "fourCcList");
> +
> +// write the fourcc array length
> +ff_amf_write_array(, list_len);
> +
> +while(fourcc_data) {
> +unsigned char fourcc[5];
> +switch (*(uint32_t *)fourcc_data) {
> +case MKTAG('h', 'v', 'c', '1'):
> +case MKTAG('a', 'v', '0', '1'):
> +case MKTAG('v', 'p', '0', '9'):
> +strncpy(fourcc, fourcc_data, 4);
> +fourcc[4] = '\0';
> +ff_amf_write_string(, fourcc);
> +break;
> +default:
> +return AVERROR(EINVAL);
> +}
> +
> +fourcc_data += (fourcc_str_len - (fourcc_data - rt->enhanced)) > 
> 4 ? 5 : 4;
> +if (fourcc_data - rt->enhanced >= fourcc_str_len)
> +break;
> +}
> +}
> +
>  if (!rt->is_input) {
>  ff_amf_write_field_name(, "type");
>  ff_amf_write_string(, "nonprivate");
> @@ -3104,6 +3141,7 @@ static const AVOption rtmp_options[] = {
>  {"rtmp_conn", "Append arbitrary AMF data to the Connect message", 
> OFFSET(conn), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
>  {"rtmp_flashver", "Version of the Flash plugin used to run the SWF 
> player.", OFFSET(flashver), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, 
> DEC|ENC},
>  {"rtmp_flush_interval", "Number of packets flushed in the same request 
> (RTMPT only).", OFFSET(flush_interval), AV_OPT_TYPE_INT, {.i64 = 10}, 0, 
> INT_MAX, ENC},
> +{"rtmp_enhanced_codec", "Specify that the codec in enhanced rtmp live 
> stream", OFFSET(enhanced), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, ENC},

I think this should be more like "Specify the codec(s) to use in an
enhanced rtmp live stream" ?

>  {"rtmp_live", "Specify that the media is a live stream.", OFFSET(live), 
> AV_OPT_TYPE_INT, {.i64 = -2}, INT_MIN, INT_MAX, DEC, "rtmp_live"},
>  {"any", "both", 0, AV_OPT_TYPE_CONST, {.i64 = -2}, 0, 0, DEC, 
> "rtmp_live"},
>  {"live", "live stream", 0, AV_OPT_TYPE_CONST, {.i64 = -1}, 0, 0, DEC, 
> "rtmp_live"},
> --
> 2.40.0
>
> 

Re: [FFmpeg-devel] [PATCH] libavformat/rtsp: pkt_size option is not honored in rtsp

2022-04-19 Thread Tristan Matthews
On Wed, Apr 6, 2022 at 10:04 AM Zhao Zhili  wrote:

>
> > 在 2022年4月6日,下午9:49,Yubo Xie  写道:
> >
> > Yes, I've removed it already.
>
> Sorry I missed that. LGTM.
>

Nice catch, I guess this bug only impacted using TCP as the
media-transport? I'm guessing I only tested UDP at the time.

Best,
Tristan
___
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 to libavc/opus to create extradata if missing

2022-07-06 Thread Tristan Matthews
On Wed, Jul 6, 2022 at 10:10 AM Tristan Matthews 
wrote:

> Hi,
>
> On Sun, Jan 3, 2021 at 8:09 PM Andreas Rheinhardt <
> andreas.rheinha...@gmail.com> wrote:
>
>> Jonathan Baudanza:
>> > On Sun, Jan 3, 2021, at 3:34 PM, Andreas Rheinhardt wrote:
>> >> Lynne:
>> >>>
>> >>> Apart from that LGTM.
>> >>
>> >> +1 if the case of more than two channels has been properly tested.
>> >>
>> >
>> > I tested this by creating an (invalid) SDP file with channels set to 3.
>> In this case, the rtp demuxer fails with the following message:
>> >
>> >[sdp @ 0x7fe40280b800] Error creating opus extradata: Invalid data
>> found when processing input
>> >
>> > It might be more descriptive if we added a log warning about the
>> channel count. WDYT?
>>
>> It's ok as-is.
>>
>> - Andreas
>>
>
> Could this land? I found another case that it fixes (specifically
> streamcopy + muxing a specific mkv file that was captured via RTP).
>

Sorry for the noise, I missed in the thread that the code in question moved
from the opus decoder to the RTP parser and landed there.

Best,
Tristan
___
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 to libavc/opus to create extradata if missing

2022-07-06 Thread Tristan Matthews
Hi,

On Sun, Jan 3, 2021 at 8:09 PM Andreas Rheinhardt <
andreas.rheinha...@gmail.com> wrote:

> Jonathan Baudanza:
> > On Sun, Jan 3, 2021, at 3:34 PM, Andreas Rheinhardt wrote:
> >> Lynne:
> >>>
> >>> Apart from that LGTM.
> >>
> >> +1 if the case of more than two channels has been properly tested.
> >>
> >
> > I tested this by creating an (invalid) SDP file with channels set to 3.
> In this case, the rtp demuxer fails with the following message:
> >
> >[sdp @ 0x7fe40280b800] Error creating opus extradata: Invalid data
> found when processing input
> >
> > It might be more descriptive if we added a log warning about the channel
> count. WDYT?
>
> It's ok as-is.
>
> - Andreas
>

Could this land? I found another case that it fixes (specifically
streamcopy + muxing a specific mkv file that was captured via RTP).

Best,
Tristan
___
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/1] opus_silk: reset midonly flag after skipping LBRR

2022-08-31 Thread Tristan Matthews
Fix suggested by Mark Harris. Fixes ticket #9890
---
 libavcodec/opus_silk.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 8523b55ada..0b4438388e 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -828,11 +828,16 @@ int ff_silk_decode_superframe(SilkContext *s, 
OpusRangeCoder *rc,
 
 /* decode the LBRR frames */
 for (i = 0; i < nb_frames; i++) {
+int skipped = 0;
 for (j = 0; j < coded_channels; j++)
 if (redundancy[j] & (1 << i)) {
 int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 1;
 silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 1);
+skipped = 1;
 }
+/* reset midonly if needed */
+if (skipped)
+s->midonly = 0;
 }
 
 for (i = 0; i < nb_frames; i++) {
-- 
2.34.1

___
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] avformat/hls: fix spelling and grammar on wrap warning

2022-10-19 Thread Tristan Matthews
On Fri, Oct 7, 2022 at 1:41 AM Gyan Doshi  wrote:

>
>
> On 2022-10-05 08:59 pm, Steven Liu wrote:
> > Tristan Matthews  于2022年10月5日周三 22:44写道:
> >> ---
> >>   libavformat/hls.c | 2 +-
> >>   1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/libavformat/hls.c b/libavformat/hls.c
> >> index e622425e80..402eb2b5a0 100644
> >> --- a/libavformat/hls.c
> >> +++ b/libavformat/hls.c
> >> @@ -1527,7 +1527,7 @@ reload:
> >>   return AVERROR_EOF;
> >>   }
> >>   } else {
> >> -av_log(v->parent, AV_LOG_WARNING, "maybe the m3u8 list
> sequence have been wraped.\n");
> >> +av_log(v->parent, AV_LOG_WARNING, "The m3u8 list sequence
> may have been wrapped.\n");
> >>   }
> >>   if (v->cur_seq_no >= v->start_seq_no + v->n_segments) {
> >>   if (v->finished)
> >> --
> >> 2.34.1
> >>
> >> ___
> >> 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".
> > English is not my native language, but this look ok to me.
> > Waiting for familiarity with English reviewer comments.
>
> LGTM.
>

Ping?

Best,
-t
___
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/1] fate/opus: add silk LBRR test (refs #9890)

2022-09-08 Thread Tristan Matthews
This adds a fate test for a sample with LBRR packets.

It requires that these files be uploaded:
https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.mka
https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.dec

---
 tests/fate/opus.mak | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/fate/opus.mak b/tests/fate/opus.mak
index 573044ed15..7d359f414a 100644
--- a/tests/fate/opus.mak
+++ b/tests/fate/opus.mak
@@ -4,7 +4,7 @@
 
 OPUS_CELT_SAMPLES   = $(addprefix testvector, 01 11) tron.6ch.tinypkts
 OPUS_HYBRID_SAMPLES = $(addprefix testvector, 05 06)
-OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04)
+OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04) silk-lbrr
 OPUS_OTHER_SAMPLES  = $(addprefix testvector, 07 08 09 10 12)
 
 define FATE_OPUS_TEST
@@ -33,6 +33,7 @@ fate-opus-testvector09:  CMP_TARGET = 0
 fate-opus-testvector10:  CMP_TARGET = 38
 fate-opus-testvector11:  CMP_TARGET = 0
 fate-opus-testvector12:  CMP_TARGET = 160
+fate-opus-silk-lbrr: CMP_TARGET = 0
 fate-opus-tron.6ch.tinypkts: CMP_SHIFT = 1440
 fate-opus-tron.6ch.tinypkts: CMP_TARGET = 0
 
-- 
2.34.1

___
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 1/1] fate/opus: add silk LBRR test (refs #9890)

2022-09-08 Thread Tristan Matthews
On Thu, Sep 8, 2022 at 3:58 PM Tristan Matthews  wrote:

> This adds a fate test for a sample with LBRR packets.
>
> It requires that these files be uploaded:
> https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.mka
> https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.dec
>
> ---
>  tests/fate/opus.mak | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tests/fate/opus.mak b/tests/fate/opus.mak
> index 573044ed15..7d359f414a 100644
> --- a/tests/fate/opus.mak
> +++ b/tests/fate/opus.mak
> @@ -4,7 +4,7 @@
>
>  OPUS_CELT_SAMPLES   = $(addprefix testvector, 01 11) tron.6ch.tinypkts
>  OPUS_HYBRID_SAMPLES = $(addprefix testvector, 05 06)
> -OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04)
> +OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04) silk-lbrr
>  OPUS_OTHER_SAMPLES  = $(addprefix testvector, 07 08 09 10 12)
>
>  define FATE_OPUS_TEST
> @@ -33,6 +33,7 @@ fate-opus-testvector09:  CMP_TARGET = 0
>  fate-opus-testvector10:  CMP_TARGET = 38
>  fate-opus-testvector11:  CMP_TARGET = 0
>  fate-opus-testvector12:  CMP_TARGET = 160
> +fate-opus-silk-lbrr: CMP_TARGET = 0
>  fate-opus-tron.6ch.tinypkts: CMP_SHIFT = 1440
>  fate-opus-tron.6ch.tinypkts: CMP_TARGET = 0
>
> --
> 2.34.1
>


Sorry this was supposed to be in response to
http://ffmpeg.org/pipermail/ffmpeg-devel/2022-August/300758.html (as it
depends on it) but I screwed up the git-send-email.

Best,
-t
___
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 1/1] opus_silk: reset midonly flag after skipping LBRR

2022-09-15 Thread Tristan Matthews
On Wed, Aug 31, 2022 at 2:32 PM Tristan Matthews  wrote:
>
> Fix suggested by Mark Harris. Fixes ticket #9890
> ---
>  libavcodec/opus_silk.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
> index 8523b55ada..0b4438388e 100644
> --- a/libavcodec/opus_silk.c
> +++ b/libavcodec/opus_silk.c
> @@ -828,11 +828,16 @@ int ff_silk_decode_superframe(SilkContext *s, 
> OpusRangeCoder *rc,
>
>  /* decode the LBRR frames */
>  for (i = 0; i < nb_frames; i++) {
> +int skipped = 0;
>  for (j = 0; j < coded_channels; j++)
>  if (redundancy[j] & (1 << i)) {
>  int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 
> 1;
>  silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 
> 1);
> +skipped = 1;
>  }
> +/* reset midonly if needed */
> +if (skipped)
> +s->midonly = 0;
>  }
>
>  for (i = 0; i < nb_frames; i++) {
> --
> 2.34.1
>

Ping
___
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 1/1] fate/opus: add silk LBRR test (refs #9890)

2022-09-23 Thread Tristan Matthews
On Fri, Sep 23, 2022 at 8:15 AM Andreas Rheinhardt
 wrote:
>
> Tristan Matthews:
> > On Thu, Sep 8, 2022 at 3:58 PM Tristan Matthews  wrote:
> >
> >> This adds a fate test for a sample with LBRR packets.
> >>
> >> It requires that these files be uploaded:
> >> https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.mka
> >> https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.dec
> >>
> >> ---
> >>  tests/fate/opus.mak | 3 ++-
> >>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/tests/fate/opus.mak b/tests/fate/opus.mak
> >> index 573044ed15..7d359f414a 100644
> >> --- a/tests/fate/opus.mak
> >> +++ b/tests/fate/opus.mak
> >> @@ -4,7 +4,7 @@
> >>
> >>  OPUS_CELT_SAMPLES   = $(addprefix testvector, 01 11) tron.6ch.tinypkts
> >>  OPUS_HYBRID_SAMPLES = $(addprefix testvector, 05 06)
> >> -OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04)
> >> +OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04) silk-lbrr
> >>  OPUS_OTHER_SAMPLES  = $(addprefix testvector, 07 08 09 10 12)
> >>
> >>  define FATE_OPUS_TEST
> >> @@ -33,6 +33,7 @@ fate-opus-testvector09:  CMP_TARGET = 0
> >>  fate-opus-testvector10:  CMP_TARGET = 38
> >>  fate-opus-testvector11:  CMP_TARGET = 0
> >>  fate-opus-testvector12:  CMP_TARGET = 160
> >> +fate-opus-silk-lbrr: CMP_TARGET = 0
> >>  fate-opus-tron.6ch.tinypkts: CMP_SHIFT = 1440
> >>  fate-opus-tron.6ch.tinypkts: CMP_TARGET = 0
> >>
> >> --
> >> 2.34.1
> >>
> >
> >
> > Sorry this was supposed to be in response to
> > http://ffmpeg.org/pipermail/ffmpeg-devel/2022-August/300758.html (as it
> > depends on it) but I screwed up the git-send-email.
> >
>
> Does this sample have to be so long?

I've shortened it from 4 seconds to 1 second (which is still long
enough to hear the bug when using an older build).
Note that most of the opus test vectors are on the order of 25 seconds.

Best,
Tristan

>
> - 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".
___
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/1] opus_silk: reset midonly flag after skipping LBRR

2022-09-23 Thread Tristan Matthews
Fix suggested by Mark Harris. Fixes ticket #9890

Simplified after feedback from Anton Khirnov.
---
 libavcodec/opus_silk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/opus_silk.c b/libavcodec/opus_silk.c
index 8523b55ada..f9d67f4fb3 100644
--- a/libavcodec/opus_silk.c
+++ b/libavcodec/opus_silk.c
@@ -833,6 +833,8 @@ int ff_silk_decode_superframe(SilkContext *s, 
OpusRangeCoder *rc,
 int active1 = (j == 0 && !(redundancy[1] & (1 << i))) ? 0 : 1;
 silk_decode_frame(s, rc, i, j, coded_channels, 1, active1, 1);
 }
+
+s->midonly = 0;
 }
 
 for (i = 0; i < nb_frames; i++) {
-- 
2.34.1

___
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 1/1] fate/opus: add silk LBRR test (refs #9890)

2022-09-30 Thread Tristan Matthews
On Fri, Sep 23, 2022 at 3:04 PM Tristan Matthews  wrote:
>
> On Fri, Sep 23, 2022 at 8:15 AM Andreas Rheinhardt
>  wrote:
> >
> > Tristan Matthews:
> > > On Thu, Sep 8, 2022 at 3:58 PM Tristan Matthews  
> > > wrote:
> > >
> > >> This adds a fate test for a sample with LBRR packets.
> > >>
> > >> It requires that these files be uploaded:
> > >> https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.mka
> > >> https://people.videolan.org/~tmatth/9890-fate/silk-lbrr.dec
> > >>
> > >> ---
> > >>  tests/fate/opus.mak | 3 ++-
> > >>  1 file changed, 2 insertions(+), 1 deletion(-)
> > >>
> > >> diff --git a/tests/fate/opus.mak b/tests/fate/opus.mak
> > >> index 573044ed15..7d359f414a 100644
> > >> --- a/tests/fate/opus.mak
> > >> +++ b/tests/fate/opus.mak
> > >> @@ -4,7 +4,7 @@
> > >>
> > >>  OPUS_CELT_SAMPLES   = $(addprefix testvector, 01 11) tron.6ch.tinypkts
> > >>  OPUS_HYBRID_SAMPLES = $(addprefix testvector, 05 06)
> > >> -OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04)
> > >> +OPUS_SILK_SAMPLES   = $(addprefix testvector, 02 03 04) silk-lbrr
> > >>  OPUS_OTHER_SAMPLES  = $(addprefix testvector, 07 08 09 10 12)
> > >>
> > >>  define FATE_OPUS_TEST
> > >> @@ -33,6 +33,7 @@ fate-opus-testvector09:  CMP_TARGET = 0
> > >>  fate-opus-testvector10:  CMP_TARGET = 38
> > >>  fate-opus-testvector11:  CMP_TARGET = 0
> > >>  fate-opus-testvector12:  CMP_TARGET = 160
> > >> +fate-opus-silk-lbrr: CMP_TARGET = 0
> > >>  fate-opus-tron.6ch.tinypkts: CMP_SHIFT = 1440
> > >>  fate-opus-tron.6ch.tinypkts: CMP_TARGET = 0
> > >>
> > >> --
> > >> 2.34.1
> > >>
> > >
> > >
> > > Sorry this was supposed to be in response to
> > > http://ffmpeg.org/pipermail/ffmpeg-devel/2022-August/300758.html (as it
> > > depends on it) but I screwed up the git-send-email.
> > >
> >
> > Does this sample have to be so long?
>
> I've shortened it from 4 seconds to 1 second (which is still long
> enough to hear the bug when using an older build).
> Note that most of the opus test vectors are on the order of 25 seconds.

These shorter samples have been updated by James Almer, so this patch
is good to go

Best,
-t


>
> Best,
> Tristan
>
> >
> > - 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".
___
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] avformat/hls: fix spelling and grammar on wrap warning

2022-10-05 Thread Tristan Matthews
---
 libavformat/hls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index e622425e80..402eb2b5a0 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1527,7 +1527,7 @@ reload:
 return AVERROR_EOF;
 }
 } else {
-av_log(v->parent, AV_LOG_WARNING, "maybe the m3u8 list sequence 
have been wraped.\n");
+av_log(v->parent, AV_LOG_WARNING, "The m3u8 list sequence may have 
been wrapped.\n");
 }
 if (v->cur_seq_no >= v->start_seq_no + v->n_segments) {
 if (v->finished)
-- 
2.34.1

___
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] av1dec: fix typo in logged error

2022-12-12 Thread Tristan Matthews
On Mon, Nov 28, 2022 at 10:39 AM Tristan Matthews  wrote:
>
> ---
>  libavcodec/av1dec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
> index 80da0943d4..d83c902f1f 100644
> --- a/libavcodec/av1dec.c
> +++ b/libavcodec/av1dec.c
> @@ -567,7 +567,7 @@ static int get_pixel_format(AVCodecContext *avctx)
>   * implemented in the future, need remove this check.
>   */
>  if (!avctx->hwaccel) {
> -av_log(avctx, AV_LOG_ERROR, "Your platform doesn't suppport"
> +av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support"
> " hardware accelerated AV1 decoding.\n");
>  return AVERROR(ENOSYS);
>  }
> --
> 2.34.1
>

Ping
___
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/2] av1dec: fix typo in logged error

2022-11-28 Thread Tristan Matthews
---
 libavcodec/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 80da0943d4..d83c902f1f 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -567,7 +567,7 @@ static int get_pixel_format(AVCodecContext *avctx)
  * implemented in the future, need remove this check.
  */
 if (!avctx->hwaccel) {
-av_log(avctx, AV_LOG_ERROR, "Your platform doesn't suppport"
+av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support"
" hardware accelerated AV1 decoding.\n");
 return AVERROR(ENOSYS);
 }
-- 
2.34.1

___
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/2] av1dec: fix comment typo

2022-11-28 Thread Tristan Matthews
---
 libavcodec/av1dec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 0c24eac842..80da0943d4 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -194,7 +194,7 @@ static uint8_t get_shear_params_valid(AV1DecContext *s, int 
idx)
 }
 
 /**
-* update gm type/params, since cbs already implemented part of this funcation,
+* update gm type/params, since cbs already implemented part of this function,
 * so we don't need to full implement spec.
 */
 static void global_motion_params(AV1DecContext *s)
-- 
2.34.1

___
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] nellymoser: user float literals for table

2023-05-26 Thread Tristan Matthews
On Sat, May 27, 2023, 00:24 Tristan Matthews  wrote:

> ---
>  libavcodec/nellymoser.c | 36 ++--
>  1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/libavcodec/nellymoser.c b/libavcodec/nellymoser.c
> index 66c5f83a56..fa22b79909 100644
> --- a/libavcodec/nellymoser.c
> +++ b/libavcodec/nellymoser.c
> @@ -39,30 +39,30 @@
>  #include "nellymoser.h"
>
>  const float ff_nelly_dequantization_table[127] = {
> - 0.00,
> + 0.00f,
>
> --0.8472560048, 0.7224709988,
> +-0.8472560048f, 0.7224709988f,
>
> --1.5247479677,-0.4531480074, 0.3753609955, 1.4717899561,
> +-1.5247479677f,-0.4531480074f, 0.3753609955f, 1.4717899561f,
>
> --1.9822579622,-1.1929379702,-0.5829370022,-0.0693780035, 0.3909569979,
> 0.9069200158, 1.4862740040, 2.2215409279,
> +-1.9822579622f,-1.1929379702f,-0.5829370022f,-0.0693780035f,
> 0.3909569979f, 0.9069200158f, 1.4862740040f, 2.2215409279f,
>
>
> --2.3887870312,-1.8067539930,-1.4105420113,-1.0773609877,-0.7995010018,-0.5558109879,-0.3334020078,-0.1324490011,
> - 0.0568020009, 0.2548770010, 0.4773550034, 0.7386850119, 1.0443060398,
> 1.3954459429, 1.8098750114, 2.3918759823,
>
> +-2.3887870312f,-1.8067539930f,-1.4105420113f,-1.0773609877f,-0.7995010018f,-0.5558109879f,-0.3334020078f,-0.1324490011f,
> + 0.0568020009f, 0.2548770010f, 0.4773550034f, 0.7386850119f,
> 1.0443060398f, 1.3954459429f, 1.8098750114f, 2.3918759823f,
>
>
> --2.3893830776,-1.9884680510,-1.7514040470,-1.5643119812,-1.3922129869,-1.2164649963,-1.0469499826,-0.8905100226,
>
> --0.7645580173,-0.6454579830,-0.5259280205,-0.4059549868,-0.3029719889,-0.2096900046,-0.1239869967,-0.0479229987,
> - 0.025773, 0.1001340002, 0.1737180054, 0.2585540116, 0.3522900045,
> 0.4569880068, 0.5767750144, 0.7003160119,
> - 0.8425520062, 1.0093879700, 1.1821349859, 1.3534560204, 1.5320819616,
> 1.7332619429, 1.9722349644, 2.3978140354,
>
> +-2.3893830776f,-1.9884680510f,-1.7514040470f,-1.5643119812f,-1.3922129869f,-1.2164649963f,-1.0469499826f,-0.8905100226f,
>
> +-0.7645580173f,-0.6454579830f,-0.5259280205f,-0.4059549868f,-0.3029719889f,-0.2096900046f,-0.1239869967f,-0.0479229987f,
> + 0.025773f, 0.1001340002f, 0.1737180054f, 0.2585540116f,
> 0.3522900045f, 0.4569880068f, 0.5767750144f, 0.7003160119f,
> + 0.8425520062f, 1.0093879700f, 1.1821349859f, 1.3534560204f,
> 1.5320819616f, 1.7332619429f, 1.9722349644f, 2.3978140354f,
>
>
> --2.5756309032,-2.0573320389,-1.8984919786,-1.7727810144,-1.6662600040,-1.5742180347,-1.4993319511,-1.4316639900,
>
> --1.3652280569,-1.3000990152,-1.2280930281,-1.1588579416,-1.0921250582,-1.0135740042,-0.9202849865,-0.8287050128,
>
> --0.7374889851,-0.6447759867,-0.5590940118,-0.4857139885,-0.4110319912,-0.3459700048,-0.2851159871,-0.2341620028,
> --0.1870580018,-0.1442500055,-0.1107169986,-0.0739680007,-0.0365610011,-0.0073290002,
> 0.0203610007, 0.0479039997,
> - 0.0751969963, 0.098091, 0.1220389977, 0.145862, 0.1694349945,
> 0.1970459968, 0.2252430022, 0.2556869984,
> - 0.2870100141, 0.3197099864, 0.3525829911, 0.3889069855, 0.4334920049,
> 0.4769459963, 0.5204820037, 0.5644530058,
> - 0.6122040153, 0.6685929894, 0.7341650128, 0.8032159805, 0.8784040213,
> 0.9566209912, 1.0397069454, 1.1293770075,
> - 1.2211159468, 1.3080279827, 1.4024800062, 1.5056819916, 1.6227730513,
> 1.7724959850, 1.9430880547, 2.2903931141
>
> +-2.5756309032f,-2.0573320389f,-1.8984919786f,-1.7727810144f,-1.6662600040f,-1.5742180347f,-1.4993319511f,-1.4316639900f,
>
> +-1.3652280569f,-1.3000990152f,-1.2280930281f,-1.1588579416f,-1.0921250582f,-1.0135740042f,-0.9202849865f,-0.8287050128f,
>
> +-0.7374889851f,-0.6447759867f,-0.5590940118f,-0.4857139885f,-0.4110319912f,-0.3459700048f,-0.2851159871f,-0.2341620028f,
> +-0.1870580018f,-0.1442500055f,-0.1107169986f,-0.0739680007f,-0.0365610011f,-0.0073290002f,
> 0.0203610007f, 0.0479039997f,
> + 0.0751969963f, 0.098091f, 0.1220389977f, 0.145862f,
> 0.1694349945f, 0.1970459968f, 0.2252430022f, 0.2556869984f,
> + 0.2870100141f, 0.3197099864f, 0.3525829911f, 0.3889069855f,
> 0.4334920049f, 0.4769459963f, 0.5204820037f, 0.5644530058f,
> + 0.6122040153f, 0.6685929894f, 0.7341650128f, 0.8032159805f,
> 0.8784040213f, 0.9566209912f, 1.0397069454f, 1.1293770075f,
> + 1.2211159468f, 1.3080279827f, 1.4024800062f, 1.5056819916f,
> 1.6227730513f, 1.7724959850f, 1.9430880547f, 2.2903931141f
>  };
>
>  const uint8_t ff_nelly_band_sizes_table[NELLY_BANDS] = {
> --
> 2.39.2
>


Sorry for the typo in the subject, that should read "use float literals"...

Best,
-t

>
___
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] nellymoser: user float literals for table

2023-05-26 Thread Tristan Matthews
---
 libavcodec/nellymoser.c | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/libavcodec/nellymoser.c b/libavcodec/nellymoser.c
index 66c5f83a56..fa22b79909 100644
--- a/libavcodec/nellymoser.c
+++ b/libavcodec/nellymoser.c
@@ -39,30 +39,30 @@
 #include "nellymoser.h"
 
 const float ff_nelly_dequantization_table[127] = {
- 0.00,
+ 0.00f,
 
--0.8472560048, 0.7224709988,
+-0.8472560048f, 0.7224709988f,
 
--1.5247479677,-0.4531480074, 0.3753609955, 1.4717899561,
+-1.5247479677f,-0.4531480074f, 0.3753609955f, 1.4717899561f,
 
--1.9822579622,-1.1929379702,-0.5829370022,-0.0693780035, 0.3909569979, 
0.9069200158, 1.4862740040, 2.2215409279,
+-1.9822579622f,-1.1929379702f,-0.5829370022f,-0.0693780035f, 0.3909569979f, 
0.9069200158f, 1.4862740040f, 2.2215409279f,
 
--2.3887870312,-1.8067539930,-1.4105420113,-1.0773609877,-0.7995010018,-0.5558109879,-0.3334020078,-0.1324490011,
- 0.0568020009, 0.2548770010, 0.4773550034, 0.7386850119, 1.0443060398, 
1.3954459429, 1.8098750114, 2.3918759823,
+-2.3887870312f,-1.8067539930f,-1.4105420113f,-1.0773609877f,-0.7995010018f,-0.5558109879f,-0.3334020078f,-0.1324490011f,
+ 0.0568020009f, 0.2548770010f, 0.4773550034f, 0.7386850119f, 1.0443060398f, 
1.3954459429f, 1.8098750114f, 2.3918759823f,
 
--2.3893830776,-1.9884680510,-1.7514040470,-1.5643119812,-1.3922129869,-1.2164649963,-1.0469499826,-0.8905100226,
--0.7645580173,-0.6454579830,-0.5259280205,-0.4059549868,-0.3029719889,-0.2096900046,-0.1239869967,-0.0479229987,
- 0.025773, 0.1001340002, 0.1737180054, 0.2585540116, 0.3522900045, 
0.4569880068, 0.5767750144, 0.7003160119,
- 0.8425520062, 1.0093879700, 1.1821349859, 1.3534560204, 1.5320819616, 
1.7332619429, 1.9722349644, 2.3978140354,
+-2.3893830776f,-1.9884680510f,-1.7514040470f,-1.5643119812f,-1.3922129869f,-1.2164649963f,-1.0469499826f,-0.8905100226f,
+-0.7645580173f,-0.6454579830f,-0.5259280205f,-0.4059549868f,-0.3029719889f,-0.2096900046f,-0.1239869967f,-0.0479229987f,
+ 0.025773f, 0.1001340002f, 0.1737180054f, 0.2585540116f, 0.3522900045f, 
0.4569880068f, 0.5767750144f, 0.7003160119f,
+ 0.8425520062f, 1.0093879700f, 1.1821349859f, 1.3534560204f, 1.5320819616f, 
1.7332619429f, 1.9722349644f, 2.3978140354f,
 
--2.5756309032,-2.0573320389,-1.8984919786,-1.7727810144,-1.6662600040,-1.5742180347,-1.4993319511,-1.4316639900,
--1.3652280569,-1.3000990152,-1.2280930281,-1.1588579416,-1.0921250582,-1.0135740042,-0.9202849865,-0.8287050128,
--0.7374889851,-0.6447759867,-0.5590940118,-0.4857139885,-0.4110319912,-0.3459700048,-0.2851159871,-0.2341620028,
--0.1870580018,-0.1442500055,-0.1107169986,-0.0739680007,-0.0365610011,-0.0073290002,
 0.0203610007, 0.0479039997,
- 0.0751969963, 0.098091, 0.1220389977, 0.145862, 0.1694349945, 
0.1970459968, 0.2252430022, 0.2556869984,
- 0.2870100141, 0.3197099864, 0.3525829911, 0.3889069855, 0.4334920049, 
0.4769459963, 0.5204820037, 0.5644530058,
- 0.6122040153, 0.6685929894, 0.7341650128, 0.8032159805, 0.8784040213, 
0.9566209912, 1.0397069454, 1.1293770075,
- 1.2211159468, 1.3080279827, 1.4024800062, 1.5056819916, 1.6227730513, 
1.7724959850, 1.9430880547, 2.2903931141
+-2.5756309032f,-2.0573320389f,-1.8984919786f,-1.7727810144f,-1.6662600040f,-1.5742180347f,-1.4993319511f,-1.4316639900f,
+-1.3652280569f,-1.3000990152f,-1.2280930281f,-1.1588579416f,-1.0921250582f,-1.0135740042f,-0.9202849865f,-0.8287050128f,
+-0.7374889851f,-0.6447759867f,-0.5590940118f,-0.4857139885f,-0.4110319912f,-0.3459700048f,-0.2851159871f,-0.2341620028f,
+-0.1870580018f,-0.1442500055f,-0.1107169986f,-0.0739680007f,-0.0365610011f,-0.0073290002f,
 0.0203610007f, 0.0479039997f,
+ 0.0751969963f, 0.098091f, 0.1220389977f, 0.145862f, 0.1694349945f, 
0.1970459968f, 0.2252430022f, 0.2556869984f,
+ 0.2870100141f, 0.3197099864f, 0.3525829911f, 0.3889069855f, 0.4334920049f, 
0.4769459963f, 0.5204820037f, 0.5644530058f,
+ 0.6122040153f, 0.6685929894f, 0.7341650128f, 0.8032159805f, 0.8784040213f, 
0.9566209912f, 1.0397069454f, 1.1293770075f,
+ 1.2211159468f, 1.3080279827f, 1.4024800062f, 1.5056819916f, 1.6227730513f, 
1.7724959850f, 1.9430880547f, 2.2903931141f
 };
 
 const uint8_t ff_nelly_band_sizes_table[NELLY_BANDS] = {
-- 
2.39.2

___
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 v10 0/6] Support enhanced flv in FFmpeg

2023-06-01 Thread Tristan Matthews
On Thu, Jun 1, 2023 at 2:08 AM Steven Liu  wrote:
>
> Tristan Matthews  于2023年6月1日周四 13:03写道:
> >
> > > you can publish hevc, av1 or vp9 codec stream to Youtube over rtmp.
> >
> > Were you able to push av1 or vp9 to Youtube with this patchset alone?
> I've tested push them after after this patchset, do you mean you get
> some problems after this patchset?

Yeah for me at least vp9 and av1 are falling over when I try to push
to youtube over RTMP, I was under the impression that beyond patching
the FLV muxer you'd also need to add a `fourCcList` to the connect
command of the rtmp muxer (see "Extending NetConnection connect
command" of 
https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf).

In any case that's not really the scope of this patchset and I don't
want to derail the discussion, muxing to an flv file works fine. I
just wanted to clarify what was possible with these changes and I'm
surprised that you were able to push to youtube live with this given
the above, as I am not.

Best,
-t

>
>
> Thanks
> Steven
> ___
> 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 v10 3/6] avformat/flvenc: support mux av1 in enhanced flv

2023-06-01 Thread Tristan Matthews
On Mon, May 15, 2023 at 4:43 AM Steven Liu  wrote:
>
> Signed-off-by: Steven Liu 
> ---
>  libavformat/Makefile |  2 +-
>  libavformat/flvenc.c | 22 ++
>  2 files changed, 19 insertions(+), 5 deletions(-)
>
> diff --git a/libavformat/Makefile b/libavformat/Makefile
> index 1ef3d15467..c868e1626c 100644
> --- a/libavformat/Makefile
> +++ b/libavformat/Makefile
> @@ -214,7 +214,7 @@ OBJS-$(CONFIG_FLAC_MUXER)+= flacenc.o 
> flacenc_header.o \
>  OBJS-$(CONFIG_FLIC_DEMUXER)  += flic.o
>  OBJS-$(CONFIG_FLV_DEMUXER)   += flvdec.o
>  OBJS-$(CONFIG_LIVE_FLV_DEMUXER)  += flvdec.o
> -OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o
> +OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o av1.o
>  OBJS-$(CONFIG_FOURXM_DEMUXER)+= 4xm.o
>  OBJS-$(CONFIG_FRAMECRC_MUXER)+= framecrcenc.o framehash.o
>  OBJS-$(CONFIG_FRAMEHASH_MUXER)   += hashenc.o framehash.o
> diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
> index 35e198fa15..c1784b332d 100644
> --- a/libavformat/flvenc.c
> +++ b/libavformat/flvenc.c
> @@ -28,6 +28,7 @@
>  #include "libavcodec/mpeg4audio.h"
>  #include "avio.h"
>  #include "avc.h"
> +#include "av1.h"
>  #include "hevc.h"
>  #include "avformat.h"
>  #include "flv.h"
> @@ -48,6 +49,7 @@ static const AVCodecTag flv_video_codec_ids[] = {
>  { AV_CODEC_ID_VP6A, FLV_CODECID_VP6A },
>  { AV_CODEC_ID_H264, FLV_CODECID_H264 },
>  { AV_CODEC_ID_HEVC, MKBETAG('h', 'v', 'c', '1') },
> +{ AV_CODEC_ID_AV1,  MKBETAG('a', 'v', '0', '1') },
>  { AV_CODEC_ID_NONE, 0 }
>  };
>
> @@ -491,7 +493,8 @@ static void flv_write_codec_header(AVFormatContext* s, 
> AVCodecParameters* par, i
>  FLVContext *flv = s->priv_data;
>
>  if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264
> -|| par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == 
> AV_CODEC_ID_HEVC) {
> +|| par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == 
> AV_CODEC_ID_HEVC
> +|| par->codec_id == AV_CODEC_ID_AV1) {
>  int64_t pos;
>  avio_w8(pb,
>  par->codec_type == AVMEDIA_TYPE_VIDEO ?
> @@ -537,6 +540,9 @@ static void flv_write_codec_header(AVFormatContext* s, 
> AVCodecParameters* par, i
>  if (par->codec_id == AV_CODEC_ID_HEVC) {
>  avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart); // 
> ExVideoTagHeader mode with PacketTypeSequenceStart
>  avio_write(pb, "hvc1", 4);
> +} else if (par->codec_id == AV_CODEC_ID_AV1) {
> +avio_w8(pb, FLV_IS_EX_HEADER | PacketTypeSequenceStart);
> +avio_write(pb, "av01", 4);
>  } else {
>  avio_w8(pb, par->codec_tag | FLV_FRAME_KEY); // flags
>  avio_w8(pb, 0); // AVC sequence header
> @@ -545,6 +551,8 @@ static void flv_write_codec_header(AVFormatContext* s, 
> AVCodecParameters* par, i
>
>  if (par->codec_id == AV_CODEC_ID_HEVC)
>  ff_isom_write_hvcc(pb, par->extradata, par->extradata_size, 
> 0);
> +else if (par->codec_id == AV_CODEC_ID_AV1)
> +ff_isom_write_av1c(pb, par->extradata, par->extradata_size, 
> 1);
>  else
>  ff_isom_write_avcc(pb, par->extradata, par->extradata_size);
>  }
> @@ -843,13 +851,15 @@ static int flv_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
>  if (par->codec_id == AV_CODEC_ID_VP6F || par->codec_id == 
> AV_CODEC_ID_VP6A ||
>  par->codec_id == AV_CODEC_ID_VP6  || par->codec_id == 
> AV_CODEC_ID_AAC)
>  flags_size = 2;
> -else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == 
> AV_CODEC_ID_MPEG4 || par->codec_id == AV_CODEC_ID_HEVC)
> +else if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == 
> AV_CODEC_ID_MPEG4 ||
> + par->codec_id == AV_CODEC_ID_HEVC || par->codec_id == 
> AV_CODEC_ID_AV1)
>  flags_size = 5;
>  else
>  flags_size = 1;
>
>  if (par->codec_id == AV_CODEC_ID_AAC || par->codec_id == AV_CODEC_ID_H264
> -|| par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == 
> AV_CODEC_ID_HEVC) {
> +|| par->codec_id == AV_CODEC_ID_MPEG4 || par->codec_id == 
> AV_CODEC_ID_HEVC
> +|| par->codec_id == AV_CODEC_ID_AV1) {
>  size_t side_size;
>  uint8_t *side = av_packet_get_side_data(pkt, 
> AV_PKT_DATA_NEW_EXTRADATA, _size);
>  if (side && side_size > 0 && (side_size != par->extradata_size || 
> memcmp(side, par->extradata, side_size))) {
> @@ -869,7 +879,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket 
> *pkt)
> "Packets are not in the proper order with respect to DTS\n");
>  return AVERROR(EINVAL);
>  }
> -if (par->codec_id == AV_CODEC_ID_H264 || par->codec_id == 
> AV_CODEC_ID_MPEG4 || par->codec_id == 

Re: [FFmpeg-devel] [PATCH v10 0/6] Support enhanced flv in FFmpeg

2023-06-09 Thread Tristan Matthews
On Wed, Jun 7, 2023 at 8:02 PM Neal Gompa  wrote:
>
> On Tue, Jun 6, 2023 at 2:43 AM Steven Liu  wrote:
> >
> > Neal Gompa  于2023年5月31日周三 13:47写道:
> > >
> > > On Mon, May 15, 2023 at 10:41 PM Neal Gompa  wrote:
> > > >
> > > > On Mon, May 15, 2023 at 4:32 AM Steven Liu  wrote:
> > > > >
> > > > > Reference file: 
> > > > > https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf
> > > > > The Enhanced flv has been supported by OBS, Simple Realtime Server, 
> > > > > mpegts.js.
> > > > > you can publish hevc, av1 or vp9 codec stream to Youtube over rtmp.
> > > > > The enhanced flv documentation contributors include
> > > > > Jean-Baptiste Kempf (FFmpeg, VideoLAN).
> > > > > So this should be support by ffmpeg too.
> > > > >
> > > > > v8:
> > > > > Support vp9 codec according to enhanced flv.
> > > > > Support PacketTypeCodedFrames type for hevc in flv.
> > > > > v9:
> > > > > Add dependency codec object files for flvenc in Makefile.
> > > > > Move the hevc,av1,vp9 codec out of FF_COMPLIANCE_UNOFFICIAL.
> > > > >
> > > > > v10:
> > > > > modify first patch comment like the others before commit.
> > > > > exheader mode should only happened in video stream this patchset.
> > > > >
> > > > > Steven Liu (6):
> > > > >   avformat/flvenc: support mux hevc in enhanced flv
> > > > >   avformat/flvdec: support demux hevc in enhanced flv
> > > > >   avformat/flvenc: support mux av1 in enhanced flv
> > > > >   avformat/flvdec: support demux av1 in enhanced flv
> > > > >   avformat/flvenc: support mux vp9 in enhanced flv
> > > > >   avformat/flvdec: support demux vp9 in enhanced flv
> > > > >
> > > > >  libavformat/Makefile |  2 +-
> > > > >  libavformat/flv.h| 15 +
> > > > >  libavformat/flvdec.c | 73 
> > > > > +++-
> > > > >  libavformat/flvenc.c | 58 +--
> > > > >  4 files changed, 130 insertions(+), 18 deletions(-)
> > > > >
> > > >
> > > > This version works for me. Thanks for this work!
> > > >
> > > > Tested-by: Neal Gompa 
> > > > Reviewed-by: Neal Gompa 
> > > >
> > >
> > > Is this patch set going to get pushed to master anytime soon?
> >
> > Hi Neal,
> >
> > Do you agree move the enhanced flv support into experimental flags?
> >
>
> I don't think we should mark it experimental. Aside from the fact that
> other implementations haven't done that, it's in production now with
> YouTube.
>

Just wanted to add that v11 also worked for me (successfully tested
pushing RTMP 720p and 1080p AV1 from a live source, tried VP9 but
YouTube doesn't seem to support it as ingest). I can also confirm what
Steven reported that YouTube will output VP9 or AVC given AV1 RTMP
(from the "Stats for nerds" menu).

Great work!

Tested-by: Tristan Matthews 
Reviewed-by: Tristan Matthews 
___
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 v10 0/6] Support enhanced flv in FFmpeg

2023-05-31 Thread Tristan Matthews
> you can publish hevc, av1 or vp9 codec stream to Youtube over rtmp.

Were you able to push av1 or vp9 to Youtube with this patchset alone?

Best,
-t

On Wed, May 31, 2023 at 8:03 PM Steven Liu  wrote:
>
> Neal Gompa  于2023年5月31日周三 13:47写道:
> >
> > On Mon, May 15, 2023 at 10:41 PM Neal Gompa  wrote:
> > >
> > > On Mon, May 15, 2023 at 4:32 AM Steven Liu  wrote:
> > > >
> > > > Reference file: 
> > > > https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf
> > > > The Enhanced flv has been supported by OBS, Simple Realtime Server, 
> > > > mpegts.js.
> > > > you can publish hevc, av1 or vp9 codec stream to Youtube over rtmp.
> > > > The enhanced flv documentation contributors include
> > > > Jean-Baptiste Kempf (FFmpeg, VideoLAN).
> > > > So this should be support by ffmpeg too.
> > > >
> > > > v8:
> > > > Support vp9 codec according to enhanced flv.
> > > > Support PacketTypeCodedFrames type for hevc in flv.
> > > > v9:
> > > > Add dependency codec object files for flvenc in Makefile.
> > > > Move the hevc,av1,vp9 codec out of FF_COMPLIANCE_UNOFFICIAL.
> > > >
> > > > v10:
> > > > modify first patch comment like the others before commit.
> > > > exheader mode should only happened in video stream this patchset.
> > > >
> > > > Steven Liu (6):
> > > >   avformat/flvenc: support mux hevc in enhanced flv
> > > >   avformat/flvdec: support demux hevc in enhanced flv
> > > >   avformat/flvenc: support mux av1 in enhanced flv
> > > >   avformat/flvdec: support demux av1 in enhanced flv
> > > >   avformat/flvenc: support mux vp9 in enhanced flv
> > > >   avformat/flvdec: support demux vp9 in enhanced flv
> > > >
> > > >  libavformat/Makefile |  2 +-
> > > >  libavformat/flv.h| 15 +
> > > >  libavformat/flvdec.c | 73 +++-
> > > >  libavformat/flvenc.c | 58 +--
> > > >  4 files changed, 130 insertions(+), 18 deletions(-)
> > > >
> > >
> > > This version works for me. Thanks for this work!
> > >
> > > Tested-by: Neal Gompa 
> > > Reviewed-by: Neal Gompa 
> > >
> >
> > Is this patch set going to get pushed to master anytime soon?
>
> Hi Neal,
>
> Waiting for j-b check about the Enhanced-FLV status, i cannot sure if
> this patch can be pushed now.
>
>
>
>
> Thanks
> Steven
> ___
> 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] nellymoser: user float literals for table

2023-05-27 Thread Tristan Matthews
On Sat, May 27, 2023 at 8:17 AM Andreas Rheinhardt
 wrote:
>
> Tristan Matthews:
> > ---
> >  libavcodec/nellymoser.c | 36 ++--
> >  1 file changed, 18 insertions(+), 18 deletions(-)
> >
> > diff --git a/libavcodec/nellymoser.c b/libavcodec/nellymoser.c
> > index 66c5f83a56..fa22b79909 100644
> > --- a/libavcodec/nellymoser.c
> > +++ b/libavcodec/nellymoser.c
> > @@ -39,30 +39,30 @@
> >  #include "nellymoser.h"
> >
> >  const float ff_nelly_dequantization_table[127] = {
> > - 0.00,
> > + 0.00f,
> >
> > --0.8472560048, 0.7224709988,
> > +-0.8472560048f, 0.7224709988f,
> >
> > --1.5247479677,-0.4531480074, 0.3753609955, 1.4717899561,
> > +-1.5247479677f,-0.4531480074f, 0.3753609955f, 1.4717899561f,
> >
> > --1.9822579622,-1.1929379702,-0.5829370022,-0.0693780035, 0.3909569979, 
> > 0.9069200158, 1.4862740040, 2.2215409279,
> > +-1.9822579622f,-1.1929379702f,-0.5829370022f,-0.0693780035f, 
> > 0.3909569979f, 0.9069200158f, 1.4862740040f, 2.2215409279f,
> >
> > --2.3887870312,-1.8067539930,-1.4105420113,-1.0773609877,-0.7995010018,-0.5558109879,-0.3334020078,-0.1324490011,
> > - 0.0568020009, 0.2548770010, 0.4773550034, 0.7386850119, 1.0443060398, 
> > 1.3954459429, 1.8098750114, 2.3918759823,
> > +-2.3887870312f,-1.8067539930f,-1.4105420113f,-1.0773609877f,-0.7995010018f,-0.5558109879f,-0.3334020078f,-0.1324490011f,
> > + 0.0568020009f, 0.2548770010f, 0.4773550034f, 0.7386850119f, 
> > 1.0443060398f, 1.3954459429f, 1.8098750114f, 2.3918759823f,
> >
> > --2.3893830776,-1.9884680510,-1.7514040470,-1.5643119812,-1.3922129869,-1.2164649963,-1.0469499826,-0.8905100226,
> > --0.7645580173,-0.6454579830,-0.5259280205,-0.4059549868,-0.3029719889,-0.2096900046,-0.1239869967,-0.0479229987,
> > - 0.025773, 0.1001340002, 0.1737180054, 0.2585540116, 0.3522900045, 
> > 0.4569880068, 0.5767750144, 0.7003160119,
> > - 0.8425520062, 1.0093879700, 1.1821349859, 1.3534560204, 1.5320819616, 
> > 1.7332619429, 1.9722349644, 2.3978140354,
> > +-2.3893830776f,-1.9884680510f,-1.7514040470f,-1.5643119812f,-1.3922129869f,-1.2164649963f,-1.0469499826f,-0.8905100226f,
> > +-0.7645580173f,-0.6454579830f,-0.5259280205f,-0.4059549868f,-0.3029719889f,-0.2096900046f,-0.1239869967f,-0.0479229987f,
> > + 0.025773f, 0.1001340002f, 0.1737180054f, 0.2585540116f, 
> > 0.3522900045f, 0.4569880068f, 0.5767750144f, 0.7003160119f,
> > + 0.8425520062f, 1.0093879700f, 1.1821349859f, 1.3534560204f, 
> > 1.5320819616f, 1.7332619429f, 1.9722349644f, 2.3978140354f,
> >
> > --2.5756309032,-2.0573320389,-1.8984919786,-1.7727810144,-1.6662600040,-1.5742180347,-1.4993319511,-1.4316639900,
> > --1.3652280569,-1.3000990152,-1.2280930281,-1.1588579416,-1.0921250582,-1.0135740042,-0.9202849865,-0.8287050128,
> > --0.7374889851,-0.6447759867,-0.5590940118,-0.4857139885,-0.4110319912,-0.3459700048,-0.2851159871,-0.2341620028,
> > --0.1870580018,-0.1442500055,-0.1107169986,-0.0739680007,-0.0365610011,-0.0073290002,
> >  0.0203610007, 0.0479039997,
> > - 0.0751969963, 0.098091, 0.1220389977, 0.145862, 0.1694349945, 
> > 0.1970459968, 0.2252430022, 0.2556869984,
> > - 0.2870100141, 0.3197099864, 0.3525829911, 0.3889069855, 0.4334920049, 
> > 0.4769459963, 0.5204820037, 0.5644530058,
> > - 0.6122040153, 0.6685929894, 0.7341650128, 0.8032159805, 0.8784040213, 
> > 0.9566209912, 1.0397069454, 1.1293770075,
> > - 1.2211159468, 1.3080279827, 1.4024800062, 1.5056819916, 1.6227730513, 
> > 1.7724959850, 1.9430880547, 2.2903931141
> > +-2.5756309032f,-2.0573320389f,-1.8984919786f,-1.7727810144f,-1.6662600040f,-1.5742180347f,-1.4993319511f,-1.4316639900f,
> > +-1.3652280569f,-1.3000990152f,-1.2280930281f,-1.1588579416f,-1.0921250582f,-1.0135740042f,-0.9202849865f,-0.8287050128f,
> > +-0.7374889851f,-0.6447759867f,-0.5590940118f,-0.4857139885f,-0.4110319912f,-0.3459700048f,-0.2851159871f,-0.2341620028f,
> > +-0.1870580018f,-0.1442500055f,-0.1107169986f,-0.0739680007f,-0.0365610011f,-0.0073290002f,
> >  0.0203610007f, 0.0479039997f,
> > + 0.0751969963f, 0.098091f, 0.1220389977f, 0.145862f, 
> > 0.1694349945f, 0.1970459968f, 0.2252430022f, 0.2556869984f,
> > + 0.2870100141f, 0.3197099864f, 0.3525829911f, 0.3889069855f, 
> > 0.4334920049f, 0.4769459963f, 0.5204820037f, 0.5644530058f,
> > + 0.6122040153f, 0.6685929894f, 0.7341650128f, 0.8032159805f, 
> > 0.8784040213f, 0.9566209912f, 1.0397069454f, 1.1293770075f,
> > + 1.2211159468f, 1.3080279827f, 1.4024800062f, 1.5056819916f, 
> > 1.6227730513f, 1.7724959850f, 1.9430880547f, 2.2903931141f
> >  };
> &g