[FFmpeg-devel] [PATCH] avcodec/hevc_sei: Use get_bits_long() for time_offset_value

2021-06-19 Thread Michael Niedermayer
Fixes: assertion failure
Fixes: crash_1

Found-by: Thuan Pham 
Signed-off-by: Michael Niedermayer 
---
 libavcodec/hevc_sei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc_sei.c b/libavcodec/hevc_sei.c
index c881c4338c..e6ae777852 100644
--- a/libavcodec/hevc_sei.c
+++ b/libavcodec/hevc_sei.c
@@ -386,7 +386,7 @@ static int decode_nal_sei_timecode(HEVCSEITimeCode *s, 
GetBitContext *gb)
 
 s->time_offset_length[i] = get_bits(gb, 5);
 if (s->time_offset_length[i] > 0) {
-s->time_offset_value[i] = get_bits(gb, 
s->time_offset_length[i]);
+s->time_offset_value[i] = get_bits_long(gb, 
s->time_offset_length[i]);
 }
 }
 }
-- 
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] web: add news about IRC move (stolen from twitter)

2021-06-19 Thread Michael Niedermayer
On Fri, Jun 18, 2021 at 04:24:02PM -0300, James Almer wrote:
> On 6/18/2021 11:18 AM, Michael Niedermayer wrote:
> > Feel free to suggest better wording
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >   src/index | 7 +++
> >   1 file changed, 7 insertions(+)
> > 
> > diff --git a/src/index b/src/index
> > index e456ed2..3f2dfa5 100644
> > --- a/src/index
> > +++ b/src/index
> > @@ -35,6 +35,13 @@
> >   News
> > 
> > +  June 18th, 2021, IRC
> > +  
> > +We have a new IRC home at @liberachat
> > +now! Feel free to join us at #ffmpeg and #ffmpeg-devel. Unsure About 
> > channel? More info at  > href="https://ffmpeg.org/contact.html#IRCChannels";>contact#IRCChannels
> 
> Remove the @ character and use "Libera Chat" instead of liberachat since
> this is not Twitter, and remove the "Unsure About channel?" part as it's
> both broken an unnecessary.
> Maybe also include a line stating that the project no longer has a presence
> in Freenode to make it clear it's not an alternative IRC server.

changes done and applied

thx

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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

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


[FFmpeg-devel] Getting started

2021-06-19 Thread Mihir Shah
Hi,

I would be interested in contributing to ffmpeg, can you please provide me
suggestions on how to get started/any good first issues?

Thank you so much!
-Mihir
___
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: add a concat protocol using a files recipe

2021-06-19 Thread James Almer
Suggested-by: ffm...@fb.com
Signed-off-by: James Almer 
---
 libavformat/Makefile|   1 +
 libavformat/concat.c| 111 
 libavformat/protocols.c |   1 +
 3 files changed, 113 insertions(+)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index c9ef564523..caca95802a 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -616,6 +616,7 @@ OBJS-$(CONFIG_APPLEHTTP_PROTOCOL)+= hlsproto.o
 OBJS-$(CONFIG_BLURAY_PROTOCOL)   += bluray.o
 OBJS-$(CONFIG_CACHE_PROTOCOL)+= cache.o
 OBJS-$(CONFIG_CONCAT_PROTOCOL)   += concat.o
+OBJS-$(CONFIG_CONCATF_PROTOCOL)  += concat.o
 OBJS-$(CONFIG_CRYPTO_PROTOCOL)   += crypto.o
 OBJS-$(CONFIG_DATA_PROTOCOL) += data_uri.o
 OBJS-$(CONFIG_FFRTMPCRYPT_PROTOCOL)  += rtmpcrypt.o rtmpdigest.o rtmpdh.o
diff --git a/libavformat/concat.c b/libavformat/concat.c
index 278afd997d..d7473d25f7 100644
--- a/libavformat/concat.c
+++ b/libavformat/concat.c
@@ -22,9 +22,12 @@
  */
 
 #include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
 #include "libavutil/mem.h"
 
 #include "avformat.h"
+#include "avio_internal.h"
+#include "internal.h"
 #include "url.h"
 
 #define AV_CAT_SEPARATOR "|"
@@ -56,6 +59,7 @@ static av_cold int concat_close(URLContext *h)
 return err < 0 ? -1 : 0;
 }
 
+#if CONFIG_CONCAT_PROTOCOL
 static av_cold int concat_open(URLContext *h, const char *uri, int flags)
 {
 char *node_uri = NULL;
@@ -124,6 +128,7 @@ static av_cold int concat_open(URLContext *h, const char 
*uri, int flags)
 data->total_size = total_size;
 return err;
 }
+#endif
 
 static int concat_read(URLContext *h, unsigned char *buf, int size)
 {
@@ -188,6 +193,7 @@ static int64_t concat_seek(URLContext *h, int64_t pos, int 
whence)
 return result;
 }
 
+#if CONFIG_CONCAT_PROTOCOL
 const URLProtocol ff_concat_protocol = {
 .name   = "concat",
 .url_open   = concat_open,
@@ -197,3 +203,108 @@ const URLProtocol ff_concat_protocol = {
 .priv_data_size = sizeof(struct concat_data),
 .default_whitelist = "concat,file,subfile",
 };
+#endif
+
+#if CONFIG_CONCATF_PROTOCOL
+static av_cold int concatf_open(URLContext *h, const char *uri, int flags)
+{
+AVBPrint bp;
+struct concat_data  *data = h->priv_data;
+struct concat_nodes *nodes = NULL;
+AVIOContext *in = NULL;
+URLContext *uc;
+char *node_uri = NULL;
+int64_t size, total_size = 0;
+unsigned int nodes_size = 0;
+size_t i = 0;
+int err = 0;
+
+if (!av_strstart(uri, "concatf:", &uri)) {
+av_log(h, AV_LOG_ERROR, "URL %s lacks prefix\n", uri);
+return AVERROR(EINVAL);
+}
+
+/* handle input */
+if (!*uri)
+return AVERROR(ENOENT);
+
+err = ffio_open_whitelist(&in, uri, AVIO_FLAG_READ, &h->interrupt_callback,
+  NULL, h->protocol_whitelist, 
h->protocol_blacklist);
+if (err < 0)
+return err;
+
+av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
+
+for (i = 0; !avio_feof(in); i++) {
+uint8_t *cursor;
+size_t len = i;
+
+if ((err = ff_read_line_to_bprint_overwrite(in, &bp)) <= 0) {
+if (err == 0 && i == 0)
+err = AVERROR_INVALIDDATA;
+else if (err == AVERROR_EOF)
+err = 0;
+break;
+}
+
+cursor = bp.str;
+node_uri = av_get_token((const char **)&cursor, SPACE_CHARS);
+if (!node_uri) {
+err = AVERROR(ENOMEM);
+break;
+}
+
+if (++len == SIZE_MAX / sizeof(*nodes)) {
+av_freep(&node_uri);
+err = AVERROR(ENAMETOOLONG);
+break;
+}
+
+/* creating URLContext */
+err = ffurl_open_whitelist(&uc, node_uri, flags,
+   &h->interrupt_callback, NULL, 
h->protocol_whitelist, h->protocol_blacklist, h);
+av_freep(&node_uri);
+if (err < 0)
+break;
+
+/* creating size */
+if ((size = ffurl_size(uc)) < 0) {
+ffurl_close(uc);
+err = AVERROR(ENOSYS);
+break;
+}
+
+nodes = av_fast_realloc(data->nodes, &nodes_size, sizeof(*nodes) * 
len);
+if (!nodes) {
+ffurl_close(uc);
+err = AVERROR(ENOMEM);
+break;
+}
+data->nodes = nodes;
+
+/* assembling */
+data->nodes[i].uc   = uc;
+data->nodes[i].size = size;
+total_size += size;
+}
+avio_closep(&in);
+av_bprint_finalize(&bp, NULL);
+data->length = i;
+
+if (err < 0)
+concat_close(h);
+
+data->total_size = total_size;
+return err;
+}
+
+const URLProtocol ff_concatf_protocol = {
+.name   = "concatf",
+.url_open   = concatf_open,
+.url_read   = concat_read,
+.url_seek   = concat_seek,
+.url_close  = concat_close,
+.priv_data_size = si

Re: [FFmpeg-devel] [PATCH] avfilter/vf_fps: extend support for expressions

2021-06-19 Thread Gyan Doshi




On 2021-06-05 21:22, James Almer wrote:

AV_OPT_TYPE_VIDEO_RATE AVOption types are parsed as expressions, but in a
limited way. For example, name constants can only be parsed alone and not as
part of a longer expression.

This change allows usage like

ffmpeg -i IN -vf fps="if(eq(source_fps\,film)\,ntsc_film\,source_fps)" OUT

Suggested-by: ffm...@fb.com
Signed-off-by: James Almer 
---
  libavfilter/vf_fps.c | 65 
  1 file changed, 60 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index b7b2d6f2db..29588a5f6e 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -30,6 +30,7 @@
  #include 
  
  #include "libavutil/avassert.h"

+#include "libavutil/eval.h"
  #include "libavutil/mathematics.h"
  #include "libavutil/opt.h"
  #include "avfilter.h"
@@ -42,12 +43,47 @@ enum EOFAction {
  EOF_ACTION_NB
  };
  
+static const char *const var_names[] = {

+  "source_fps",
+  "ntsc",
+  "pal",
+  "qntsc",
+  "qpal",
+  "sntsc",
+  "spal",
+  "film",
+  "ntsc_film",
+  NULL
+};
+
+enum var_name {
+  VAR_SOURCE_FPS,
+  VAR_FPS_NTSC,
+  VAR_FPS_PAL,
+  VAR_FPS_QNTSC,
+  VAR_FPS_QPAL,
+  VAR_FPS_SNTSC,
+  VAR_FPS_SPAL,
+  VAR_FPS_FILM,
+  VAR_FPS_NTSC_FILM,
+  VARS_NB
+};
+
+static const double ntsc_fps = 3.0 / 1001.0;
+static const double pal_fps = 25.0;
+static const double qntsc_fps = 3.0 / 1001.0;
+static const double qpal_fps = 25.0;
+static const double sntsc_fps = 3.0 / 1001.0;
+static const double spal_fps = 25.0;
+static const double film_fps = 24.0;
+static const double ntsc_film_fps = 24000.0 / 1001.0;


Sorry, I missed this before you applied it but what's the q- and s- 
prefixed standards with identical rates?

I can't find any specs or docs online.



+
  typedef struct FPSContext {
  const AVClass *class;
  
  double start_time;  ///< pts, in seconds, of the expected first frame
  
-AVRational framerate;   ///< target framerate

+char *framerate;///< expression that defines the target framerate
  int rounding;   ///< AVRounding method for timestamps
  int eof_action; ///< action performed for last frame in FIFO
  
@@ -76,7 +112,7 @@ typedef struct FPSContext {

  #define V AV_OPT_FLAG_VIDEO_PARAM
  #define F AV_OPT_FLAG_FILTERING_PARAM
  static const AVOption fps_options[] = {
-{ "fps", "A string describing desired output framerate", OFFSET(framerate), 
AV_OPT_TYPE_VIDEO_RATE, { .str = "25" }, 0, INT_MAX, V|F },
+{ "fps", "A string describing desired output framerate", OFFSET(framerate), 
AV_OPT_TYPE_STRING, { .str = "25" }, 0, 0, V|F },
  { "start_time", "Assume the first PTS should be this value.", 
OFFSET(start_time), AV_OPT_TYPE_DOUBLE, { .dbl = DBL_MAX}, -DBL_MAX, DBL_MAX, V|F },
  { "round", "set rounding method for timestamps", OFFSET(rounding), AV_OPT_TYPE_INT, 
{ .i64 = AV_ROUND_NEAR_INF }, 0, 5, V|F, "round" },
  { "zero", "round towards 0", 0, AV_OPT_TYPE_CONST, { .i64 = 
AV_ROUND_ZERO }, 0, 0, V|F, "round" },
@@ -99,7 +135,6 @@ static av_cold int init(AVFilterContext *ctx)
  s->status_pts   = AV_NOPTS_VALUE;
  s->next_pts = AV_NOPTS_VALUE;
  
-av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, s->framerate.den);

  return 0;
  }
  
@@ -153,8 +188,26 @@ static int config_props(AVFilterLink* outlink)

  AVFilterLink*inlink = ctx->inputs[0];
  FPSContext  *s  = ctx->priv;
  
-outlink->time_base  = av_inv_q(s->framerate);

-outlink->frame_rate = s->framerate;
+double var_values[VARS_NB], res;
+int ret;
+
+var_values[VAR_SOURCE_FPS]= av_q2d(inlink->frame_rate);
+var_values[VAR_FPS_NTSC]  = ntsc_fps;
+var_values[VAR_FPS_PAL]   = pal_fps;
+var_values[VAR_FPS_QNTSC] = qntsc_fps;
+var_values[VAR_FPS_QPAL]  = qpal_fps;
+var_values[VAR_FPS_SNTSC] = sntsc_fps;
+var_values[VAR_FPS_SPAL]  = spal_fps;
+var_values[VAR_FPS_FILM]  = film_fps;
+var_values[VAR_FPS_NTSC_FILM] = ntsc_film_fps;
+ret = av_expr_parse_and_eval(&res, s->framerate,
+ var_names, var_values,
+ NULL, NULL, NULL, NULL, NULL, 0, ctx);
+if (ret < 0)
+return ret;
+
+outlink->frame_rate = av_d2q(res, INT_MAX);
+outlink->time_base  = av_inv_q(outlink->frame_rate);
  
  /* Calculate the input and output pts offsets for start_time */

  if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {
@@ -173,6 +226,8 @@ static int config_props(AVFilterLink* outlink)
 s->in_pts_off, s->out_pts_off, s->start_time);
  }
  
+av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", outlink->frame_rate.num, outlink->frame_rate.den);

+
  return 0;
  }
  


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

To uns

Re: [FFmpeg-devel] [PATCH] avfilter/vf_fps: extend support for expressions

2021-06-19 Thread James Almer

On 6/19/2021 4:56 PM, Gyan Doshi wrote:



On 2021-06-05 21:22, James Almer wrote:

+static const double ntsc_fps = 3.0 / 1001.0;
+static const double pal_fps = 25.0;
+static const double qntsc_fps = 3.0 / 1001.0;
+static const double qpal_fps = 25.0;
+static const double sntsc_fps = 3.0 / 1001.0;
+static const double spal_fps = 25.0;
+static const double film_fps = 24.0;
+static const double ntsc_film_fps = 24000.0 / 1001.0;


Sorry, I missed this before you applied it but what's the q- and s- 
prefixed standards with identical rates?

I can't find any specs or docs online.


It's taken from video_rate_abbrs in libavutil/parseutils.c
The description is "VCD compliant" for q and "square pixel" for s.
___
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] avcodec/hevc_sei: Use get_bits_long() for time_offset_value

2021-06-19 Thread Michael Niedermayer
On Sat, Jun 19, 2021 at 03:55:35PM +0200, Michael Niedermayer wrote:
> Fixes: assertion failure
> Fixes: crash_1
> 
> Found-by: Thuan Pham 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/hevc_sei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


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

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


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

2021-06-19 Thread Timo Rothenpieler

On 11.06.2021 16:43, Timo Rothenpieler wrote:

---
  configure   |   2 +
  doc/filters.texi|  46 ++
  libavfilter/Makefile|   1 +
  libavfilter/allfilters.c|   1 +
  libavfilter/cuda/vector_helpers.cuh |  14 +-
  libavfilter/version.h   |   2 +-
  libavfilter/vf_format_cuda.c| 433 ++
  libavfilter/vf_format_cuda.cu   | 849 
  8 files changed, 1345 insertions(+), 3 deletions(-)
  create mode 100644 libavfilter/vf_format_cuda.c
  create mode 100644 libavfilter/vf_format_cuda.cu


Will push this soon(ish) if nobody objects.

Concerning the name, while I do agree that it internally does something 
very different compared to the software format filter, from a users 
perspective, it does pretty much the same thing.


So giving it a different name, like "convert_format_cuda" or something 
seems needlessly confusing to me.




smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH] avformat/aaxdec: Check avio_seek() in header reading

2021-06-19 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
32450/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-4875522262827008

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/aaxdec.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/libavformat/aaxdec.c b/libavformat/aaxdec.c
index 0cbf933dfd..866b3ca1fd 100644
--- a/libavformat/aaxdec.c
+++ b/libavformat/aaxdec.c
@@ -117,6 +117,7 @@ static int aax_read_header(AVFormatContext *s)
 int64_t column_offset = 0;
 int ret, extradata_size;
 char *codec;
+int64_t ret64;
 
 avio_skip(pb, 4);
 a->table_size  = avio_rb32(pb) + 8LL;
@@ -218,7 +219,10 @@ static int aax_read_header(AVFormatContext *s)
 }
 }
 
-avio_seek(pb, a->strings_offset, SEEK_SET);
+ret = ret64 = avio_seek(pb, a->strings_offset, SEEK_SET);
+if (ret64 < 0)
+goto fail;
+
 ret = avio_read(pb, a->string_table, a->strings_size);
 if (ret != a->strings_size) {
 if (ret < 0)
@@ -249,7 +253,10 @@ static int aax_read_header(AVFormatContext *s)
 goto fail;
 }
 
-avio_seek(pb, data_offset, SEEK_SET);
+ret = ret64 = avio_seek(pb, data_offset, SEEK_SET);
+if (ret64 < 0)
+goto fail;
+
 if (type == COLUMN_TYPE_VLDATA) {
 int64_t start, size;
 
@@ -281,8 +288,8 @@ static int aax_read_header(AVFormatContext *s)
 codec = a->string_table + a->name_offset;
 if (!strcmp(codec, "AAX")) {
 par->codec_id = AV_CODEC_ID_ADPCM_ADX;
-avio_seek(pb, a->segments[0].start, SEEK_SET);
-if (avio_rb16(pb) != 0x8000) {
+ret64 = avio_seek(pb, a->segments[0].start, SEEK_SET);
+if (ret64 < 0 || avio_rb16(pb) != 0x8000) {
 ret = AVERROR_INVALIDDATA;
 goto fail;
 }
-- 
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 v2] avfilter: compress CUDA PTX code if possible

2021-06-19 Thread Philip Langdale
On Fri, 18 Jun 2021 23:07:58 +0200
Timo Rothenpieler  wrote:

> >> +
> >> +if (inflateInit2(&stream, 32 + 15) != Z_OK) {  
> > 
> > Can you add a comment explaining the magic numbers?  
> 
> I have no idea what those numbers do, I copied them from http.c and
> they work.

Heh.

So, I read this: https://www.zlib.net/manual.html

> windowBits can also be greater than 15 for optional gzip decoding.
> Add 32 to windowBits to enable zlib and gzip decoding with automatic
> header detection, or add 16 to decode only the gzip format (the zlib
> format will return a Z_DATA_ERROR). If a gzip stream is being
> decoded, strm->adler is a CRC-32 instead of an Adler-32. Unlike the
> gunzip utility and gzread() (see below), inflate() will not
> automatically decode concatenated gzip streams. inflate() will return
> Z_STREAM_END at the end of the gzip stream. The state would need to
> be reset to continue decoding a subsequent gzip stream.
 
I think that means it is necessary to pass '32 + 15' although you might
do '32 + 16' because you know that the files were really gzipped.

--phil
___
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] avcodec/libx264: Add support for Sony XAVC Class 300 and 480

2021-06-19 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/libx264.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 36fdb56..89f5c7b 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -749,6 +749,17 @@ static av_cold int X264_init(AVCodecContext *avctx)
 av_log(avctx, AV_LOG_ERROR,
"x264 too old for AVC Intra, at least version 142 needed\n");
 #endif
+
+if (x4->avcintra_class > 200) {
+#if X264_BUILD < 164
+av_log(avctx, AV_LOG_ERROR,
+"x264 too old for AVC Intra 300/480, at least version 164 
needed\n");
+return AVERROR(EINVAL);
+#endif
+/* AVC-Intra 300/480 only supported by Sony XAVC flavor */
+x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY;
+}
+
 if (x4->b_bias != INT_MIN)
 x4->params.i_bframe_bias  = x4->b_bias;
 if (x4->b_pyramid >= 0)
@@ -1082,7 +1093,7 @@ static const AVOption options[] = {
 { "none",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, 
INT_MIN, INT_MAX, VE, "nal-hrd" },
 { "vbr",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR},  
INT_MIN, INT_MAX, VE, "nal-hrd" },
 { "cbr",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR},  
INT_MIN, INT_MAX, VE, "nal-hrd" },
-{ "avcintra-class","AVC-Intra class 50/100/200",  
OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200   , VE},
+{ "avcintra-class","AVC-Intra class 50/100/200/300/480",  
OFFSET(avcintra_class),AV_OPT_TYPE_INT,{ .i64 = -1 }, -1, 480   , VE},
 { "me_method","Set motion estimation method", 
OFFSET(motion_est),AV_OPT_TYPE_INT,{ .i64 = -1 }, -1, X264_ME_TESA, VE, 
"motion-est"},
 { "motion-est",   "Set motion estimation method", 
OFFSET(motion_est),AV_OPT_TYPE_INT,{ .i64 = -1 }, -1, X264_ME_TESA, VE, 
"motion-est"},
 { "dia",   NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_DIA },  
INT_MIN, INT_MAX, VE, "motion-est" },
-- 
1.8.3.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 2/2] avcodec/libx264: Separate headers not supported in AVC-Intra mode

2021-06-19 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/libx264.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 89f5c7b..caabc4e 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -891,6 +891,11 @@ static av_cold int X264_init(AVCodecContext *avctx)
 }
 }
 
+#if X264_BUILD >= 142
+/* Separate headers not supported in AVC-Intra mode */
+if (x4->params.i_avcintra_class >= 0)
+x4->params.b_repeat_headers = 1;
+#endif
 
 {
 AVDictionaryEntry *en = NULL;
-- 
1.8.3.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] avfilter/vf_fps: extend support for expressions

2021-06-19 Thread Gyan Doshi




On 2021-06-20 01:29, James Almer wrote:

On 6/19/2021 4:56 PM, Gyan Doshi wrote:



On 2021-06-05 21:22, James Almer wrote:

+static const double ntsc_fps = 3.0 / 1001.0;
+static const double pal_fps = 25.0;
+static const double qntsc_fps = 3.0 / 1001.0;
+static const double qpal_fps = 25.0;
+static const double sntsc_fps = 3.0 / 1001.0;
+static const double spal_fps = 25.0;
+static const double film_fps = 24.0;
+static const double ntsc_film_fps = 24000.0 / 1001.0;


Sorry, I missed this before you applied it but what's the q- and s- 
prefixed standards with identical rates?

I can't find any specs or docs online.


It's taken from video_rate_abbrs in libavutil/parseutils.c
The description is "VCD compliant" for q and "square pixel" for s.


Right. So originally, these labels were created to denote a distinct 
*permutation* of resolution and framerate, in ba2a8cb40b
They are not part of any distinct variant of any standard or convention, 
outside of ffmpeg, and frankly not even internally.


These should be removed to avoid any confusion.

Regards,
Gyan
___
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".