[FFmpeg-devel] [PATCH v2 2/2] lavf/movenc: cosmetics

2019-10-29 Thread Yuki.Tsuchiya
Signed-off-by: Yuki.Tsuchiya 
---
 libavformat/movenc.c | 72 +++-
 1 file changed, 38 insertions(+), 34 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ff234d9..85f978a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2411,7 +2411,9 @@ static int mov_preroll_write_stbl_atoms(AVIOContext *pb, 
MOVTrack *track)
 if (!sgpd_entries)
 return AVERROR(ENOMEM);
 
-av_assert0(track->par->codec_id == AV_CODEC_ID_OPUS || 
track->par->codec_id == AV_CODEC_ID_AAC || track->par->codec_id == 
AV_CODEC_ID_MPEGH_3D_AUDIO);
+av_assert0(track->par->codec_id == AV_CODEC_ID_OPUS ||
+   track->par->codec_id == AV_CODEC_ID_AAC ||
+   track->par->codec_id == AV_CODEC_ID_MPEGH_3D_AUDIO);
 
 if (track->par->codec_id == AV_CODEC_ID_OPUS) {
 for (i = 0; i < track->entry; i++) {
@@ -2513,7 +2515,9 @@ static int mov_write_stbl_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContext
 if (track->cenc.aes_ctr) {
 ff_mov_cenc_write_stbl_atoms(>cenc, pb);
 }
-if (track->par->codec_id == AV_CODEC_ID_OPUS || track->par->codec_id == 
AV_CODEC_ID_AAC || track->par->codec_id == AV_CODEC_ID_MPEGH_3D_AUDIO) {
+if (track->par->codec_id == AV_CODEC_ID_OPUS ||
+track->par->codec_id == AV_CODEC_ID_AAC ||
+track->par->codec_id == AV_CODEC_ID_MPEGH_3D_AUDIO) {
 mov_preroll_write_stbl_atoms(pb, track);
 }
 return update_size(pb, pos);
@@ -6847,39 +6851,39 @@ static const AVCodecTag codec_3gp_tags[] = {
 };
 
 const AVCodecTag codec_mp4_tags[] = {
-{ AV_CODEC_ID_MPEG4   , MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') },
-{ AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '3') },
-{ AV_CODEC_ID_HEVC, MKTAG('h', 'e', 'v', '1') },
-{ AV_CODEC_ID_HEVC, MKTAG('h', 'v', 'c', '1') },
-{ AV_CODEC_ID_MPEG2VIDEO  , MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_MPEG1VIDEO  , MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_MJPEG   , MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_PNG , MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_JPEG2000, MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_VC1 , MKTAG('v', 'c', '-', '1') },
-{ AV_CODEC_ID_DIRAC   , MKTAG('d', 'r', 'a', 'c') },
-{ AV_CODEC_ID_TSCC2   , MKTAG('m', 'p', '4', 'v') },
-{ AV_CODEC_ID_VP9 , MKTAG('v', 'p', '0', '9') },
-{ AV_CODEC_ID_AV1 , MKTAG('a', 'v', '0', '1') },
-{ AV_CODEC_ID_AAC , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_MP4ALS  , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_MP3 , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_MP2 , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_AC3 , MKTAG('a', 'c', '-', '3') },
-{ AV_CODEC_ID_EAC3, MKTAG('e', 'c', '-', '3') },
-{ AV_CODEC_ID_DTS , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_TRUEHD  , MKTAG('m', 'l', 'p', 'a') },
-{ AV_CODEC_ID_FLAC, MKTAG('f', 'L', 'a', 'C') },
-{ AV_CODEC_ID_OPUS, MKTAG('O', 'p', 'u', 's') },
-{ AV_CODEC_ID_VORBIS  , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_QCELP   , MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_EVRC, MKTAG('m', 'p', '4', 'a') },
-{ AV_CODEC_ID_DVD_SUBTITLE, MKTAG('m', 'p', '4', 's') },
-{ AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'x', '3', 'g') },
-{ AV_CODEC_ID_BIN_DATA, MKTAG('g', 'p', 'm', 'd') },
+{ AV_CODEC_ID_MPEG4 , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_H264  , MKTAG('a', 'v', 'c', '1') },
+{ AV_CODEC_ID_H264  , MKTAG('a', 'v', 'c', '3') },
+{ AV_CODEC_ID_HEVC  , MKTAG('h', 'e', 'v', '1') },
+{ AV_CODEC_ID_HEVC  , MKTAG('h', 'v', 'c', '1') },
+{ AV_CODEC_ID_MPEG2VIDEO, MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_MPEG1VIDEO, MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_MJPEG , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_PNG   , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_JPEG2000  , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_VC1   , MKTAG('v', 'c', '-', '1') },
+{ AV_CODEC_ID_DIRAC , MKTAG('d', 'r', 'a', 'c') },
+{ AV_CODEC_ID_TSCC2 , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_VP9   , MKTAG('v', 'p', '0', '9') },
+{ AV_CODEC_ID_AV1   , MKTAG('a', 'v', '0', '1') },
+{ AV_CODEC_ID_AAC   , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_MP4ALS, MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_MP3   , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_MP2   , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_AC3   , MKTAG('a', 'c', '-', '3') },
+{ AV_CODEC_ID_EAC3  , MKTAG('e', 'c', '-', '3') },
+{ AV_CODEC_ID_DTS   , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_TRUEHD, 

[FFmpeg-devel] [PATCH v2 1/2] lavf/isom: support for demuxing MPEG-H 3D Audio in MP4

2019-10-29 Thread Yuki.Tsuchiya
Implemented according to the specification at 
https://www.iso.org/standard/69561.html
The 'mhm1' sample entry is registered with MP4RA, which is defined as MHAS 
encapsulated single stream MPEG-H 3D Audio.
'MHAS' stands for MPEG-H audio stream, which contains encoded audio data and 
corresponds metadata for decoding.
This patch enables extracting the MHAS bitstream from MP4.

Signed-off-by: Yuki.Tsuchiya 
---
 Changelog   | 1 +
 libavcodec/avcodec.h| 1 +
 libavcodec/codec_desc.c | 7 +++
 libavcodec/version.h| 2 +-
 libavformat/isom.c  | 1 +
 libavformat/movenc.c| 6 --
 libavformat/utils.c | 3 ++-
 7 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/Changelog b/Changelog
index 7c971fc..afb3bff 100644
--- a/Changelog
+++ b/Changelog
@@ -20,6 +20,7 @@ version :
 - maskedmin and maskedmax filters
 - VDPAU VP9 hwaccel
 - median filter
+- Support for demuxing MPEG-H 3D Audio in mp4
 
 
 version 4.2:
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bcb931f..8c1a85d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -654,6 +654,7 @@ enum AVCodecID {
 AV_CODEC_ID_ATRAC9,
 AV_CODEC_ID_HCOM,
 AV_CODEC_ID_ACELP_KELVIN,
+AV_CODEC_ID_MPEGH_3D_AUDIO,
 
 /* subtitle codecs */
 AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,  ///< A dummy ID pointing at 
the start of subtitle codecs.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 0602ecb..a970fae 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2998,6 +2998,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("Sipro ACELP.KELVIN"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_MPEGH_3D_AUDIO,
+.type  = AVMEDIA_TYPE_AUDIO,
+.name  = "mpegh_3d_audio",
+.long_name = NULL_IF_CONFIG_SMALL("MPEG-H 3D Audio"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 
 /* subtitle codecs */
 {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 27c126e..64e2365 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  60
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavformat/isom.c b/libavformat/isom.c
index edd0d81..824e811 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -371,6 +371,7 @@ const AVCodecTag ff_codec_movaudio_tags[] = {
 { AV_CODEC_ID_FLAC,MKTAG('f', 'L', 'a', 'C') }, /* nonstandard 
*/
 { AV_CODEC_ID_TRUEHD,  MKTAG('m', 'l', 'p', 'a') }, /* mp4ra.org */
 { AV_CODEC_ID_OPUS,MKTAG('O', 'p', 'u', 's') }, /* mp4ra.org */
+{ AV_CODEC_ID_MPEGH_3D_AUDIO,  MKTAG('m', 'h', 'm', '1') }, /* MPEG-H 3D 
Audio bitstream */
 { AV_CODEC_ID_NONE, 0 },
 };
 
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 715bec1..ff234d9 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2411,7 +2411,7 @@ static int mov_preroll_write_stbl_atoms(AVIOContext *pb, 
MOVTrack *track)
 if (!sgpd_entries)
 return AVERROR(ENOMEM);
 
-av_assert0(track->par->codec_id == AV_CODEC_ID_OPUS || 
track->par->codec_id == AV_CODEC_ID_AAC);
+av_assert0(track->par->codec_id == AV_CODEC_ID_OPUS || 
track->par->codec_id == AV_CODEC_ID_AAC || track->par->codec_id == 
AV_CODEC_ID_MPEGH_3D_AUDIO);
 
 if (track->par->codec_id == AV_CODEC_ID_OPUS) {
 for (i = 0; i < track->entry; i++) {
@@ -2493,6 +2493,7 @@ static int mov_write_stbl_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContext
 mov_write_stts_tag(pb, track);
 if ((track->par->codec_type == AVMEDIA_TYPE_VIDEO ||
  track->par->codec_id == AV_CODEC_ID_TRUEHD ||
+ track->par->codec_id == AV_CODEC_ID_MPEGH_3D_AUDIO ||
  track->par->codec_tag == MKTAG('r','t','p',' ')) &&
 track->has_keyframes && track->has_keyframes < track->entry)
 mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE);
@@ -2512,7 +2513,7 @@ static int mov_write_stbl_tag(AVFormatContext *s, 
AVIOContext *pb, MOVMuxContext
 if (track->cenc.aes_ctr) {
 ff_mov_cenc_write_stbl_atoms(>cenc, pb);
 }
-if (track->par->codec_id == AV_CODEC_ID_OPUS || track->par->codec_id == 
AV_CODEC_ID_AAC) {
+if (track->par->codec_id == AV_CODEC_ID_OPUS || track->par->codec_id == 
AV_CODEC_ID_AAC || track->par->codec_id == AV_CODEC_ID_MPEGH_3D_AUDIO) {
 mov_preroll_write_stbl_atoms(pb, track);
 }
 return update_size(pb, pos);
@@ -6877,6 +6878,7 @@ const AVCodecTag codec_mp4_tags[] = {
 { AV_CODEC_ID_DVD_SUBTITLE, MKTAG('m', 'p', '4', 's') },
 { AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'x', '3', 'g') },
 { AV_CODEC_ID_BIN_DATA, MKTAG('g', 

[FFmpeg-devel] [PATCH v2 0/2] lavf/isom: support for demuxing MPEG-H 3D Audio in MP4

2019-10-29 Thread Yuki.Tsuchiya
Hi,



Here is the sample content of the MPEG-H 3D Audio.
https://www.filehosting.org/file/details/829625/mpeg-h_3d_audio_mhm1_sample.mp4

> If this patch allows remuxing with ffmpeg (I believe it does) but if the 
> output file is not compatible with something that supports mpeg-h 3D audio, 
> the patch has to be changed before it can be committed. 
I added some codes for copying mandatory boxes. I confirmed with following 
command that the remuxed.mp4 is compatible with MPEG-H 3D Audio standard.



  ffmpeg -i mpegh_3d_audio_mhm1_sample.mp4 -codec:a copy remuxed.mp4

Yuki.Tsuchiya (2):
  lavf/isom: support for demuxing MPEG-H 3D Audio in MP4
  lavf/movenc: cosmetics

 Changelog   |  1 +
 libavcodec/avcodec.h|  1 +
 libavcodec/codec_desc.c |  7 +
 libavcodec/version.h|  2 +-
 libavformat/isom.c  |  1 +
 libavformat/movenc.c| 74 ++---
 libavformat/utils.c |  3 +-
 7 files changed, 53 insertions(+), 36 deletions(-)

-- 
2.7.4

___
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 1/3] tests/fate/filter-video: add fate pixfmts test for lut3d

2019-10-29 Thread Limin Wang
On Wed, Oct 30, 2019 at 09:22:52AM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  tests/fate/filter-video.mak |  3 +++
>  tests/ref/fate/filter-pixfmts-lut3d | 24 
>  2 files changed, 27 insertions(+)
>  create mode 100644 tests/ref/fate/filter-pixfmts-lut3d
> 
> diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
> index 9e6351be3e..53e9def176 100644
> --- a/tests/fate/filter-video.mak
> +++ b/tests/fate/filter-video.mak
> @@ -678,6 +678,9 @@ fate-filter-pixfmts-kerndeint: CMD = pixfmts "" 
> "tinterlace=interleave_top,"
>  FATE_FILTER_PIXFMTS-$(CONFIG_LUT_FILTER) += fate-filter-pixfmts-lut
>  fate-filter-pixfmts-lut: CMD = pixfmts 
> "c0=2*val:c1=2*val:c2=val/2:c3=negval+40"
>  
> +FATE_FILTER_PIXFMTS-$(CONFIG_LUT_FILTER) += fate-filter-pixfmts-lut3d
> +fate-filter-pixfmts-lut3d: CMD = pixfmts
> +
>  FATE_FILTER_PIXFMTS-$(CONFIG_NULL_FILTER) += fate-filter-pixfmts-null
>  fate-filter-pixfmts-null:  CMD = pixfmts
>  
> diff --git a/tests/ref/fate/filter-pixfmts-lut3d 
> b/tests/ref/fate/filter-pixfmts-lut3d
> new file mode 100644
> index 00..56c294fa86
> --- /dev/null
> +++ b/tests/ref/fate/filter-pixfmts-lut3d
> @@ -0,0 +1,24 @@
> +0bgr5087cdbb3da0d014de02fda75618f278
> +0rgb9ccde40a857919017558353aaecfa5de
> +abgr0505ae7e852cf32ce9e2a0fc06462f48
> +argb77e7baba2d8b4389267a2ecb67662c15
> +bgr0cded4da42263da5bf0153e8bad09a0de
> +bgr24   fef9ee2e37a1d5c1787ffb3ed5dcc3bf
> +bgr48le 39fe9f41285f3325833d28ce1611d586

For mips, it'll print out bgr48be, but fate-filter-pixfmts-lut is *le always, I 
haven't see any special process 
for lut, please give comment if you're expert for the pixfmts test. 

> +bgra3433cdbdf07abbd8af4698a3b7a1a189
> +bgra64le8f33508d6c0362df83296513ebee3a2d
> +gbrap   4227379340c3d822dd6c59263b170972
> +gbrap10le   90721f63d6e3d5d7a6bafcefdca5151d
> +gbrap12le   e1eee70df0c2578937dcd7a90e22f4b7
> +gbrap16le   2fd82ec30573ed65fa23c4d1c150d596
> +gbrpe615c8ea180a0358261953812df0aa3d
> +gbrp10led61faad75dbd7cbb0271b47fa33d714e
> +gbrp12le90c4ec04807bbfbe194eddcc8d7bcb2a
> +gbrp14lec424158744f9e16dbfcf00c66ba651f9
> +gbrp16le8ccb63f9407cae03b2e061ed1249127d
> +gbrp9le 4a267ed7c6535c8829e83e35c51df6bf
> +rgb0545f5c4e4a7b7f3e61373149db0b932a
> +rgb24   aec4f0a1954823de17024383d6401b75
> +rgb48le 1d1e5a1849ed3c326961184bb2f45400
> +rgbaecd54389d03bded1e8209f5bdea5
> +rgba64leb26c35d221b026304db46014260ed1db
> -- 
> 2.21.0
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH v1 2/3] avfilter/vf_lut3d: simplify code

2019-10-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavfilter/vf_lut3d.c | 27 +++
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/libavfilter/vf_lut3d.c b/libavfilter/vf_lut3d.c
index cd0aba1f69..ff030f0950 100644
--- a/libavfilter/vf_lut3d.c
+++ b/libavfilter/vf_lut3d.c
@@ -711,34 +711,13 @@ static int query_formats(AVFilterContext *ctx)
 
 static int config_input(AVFilterLink *inlink)
 {
-int depth, is16bit = 0, planar = 0;
+int depth, is16bit, planar;
 LUT3DContext *lut3d = inlink->dst->priv;
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
 
 depth = desc->comp[0].depth;
-
-switch (inlink->format) {
-case AV_PIX_FMT_RGB48:
-case AV_PIX_FMT_BGR48:
-case AV_PIX_FMT_RGBA64:
-case AV_PIX_FMT_BGRA64:
-is16bit = 1;
-break;
-case AV_PIX_FMT_GBRP9:
-case AV_PIX_FMT_GBRP10:
-case AV_PIX_FMT_GBRP12:
-case AV_PIX_FMT_GBRP14:
-case AV_PIX_FMT_GBRP16:
-case AV_PIX_FMT_GBRAP10:
-case AV_PIX_FMT_GBRAP12:
-case AV_PIX_FMT_GBRAP16:
-is16bit = 1;
-case AV_PIX_FMT_GBRP:
-case AV_PIX_FMT_GBRAP:
-planar = 1;
-break;
-}
-
+is16bit = desc->comp[0].depth > 8;
+planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR;
 ff_fill_rgba_map(lut3d->rgba_map, inlink->format);
 lut3d->step = av_get_padded_bits_per_pixel(desc) >> (3 + is16bit);
 
-- 
2.21.0

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

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

[FFmpeg-devel] [PATCH v1 3/3] avfilter/vf_lut: simplify code

2019-10-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavfilter/vf_lut.c | 60 
 1 file changed, 11 insertions(+), 49 deletions(-)

diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c
index 1fdc5e1812..3aed4ccc2c 100644
--- a/libavfilter/vf_lut.c
+++ b/libavfilter/vf_lut.c
@@ -220,6 +220,10 @@ static int config_props(AVFilterLink *inlink)
 int min[4], max[4];
 int val, color, ret;
 
+s->is_yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) &&
+ (desc->flags & AV_PIX_FMT_FLAG_PLANAR) &&
+ desc->nb_components >= 3;
+s->is_rgb = ff_fill_rgba_map(rgba_map, inlink->format) >= 0;
 s->hsub = desc->log2_chroma_w;
 s->vsub = desc->log2_chroma_h;
 
@@ -227,42 +231,7 @@ static int config_props(AVFilterLink *inlink)
 s->var_values[VAR_H] = inlink->h;
 s->is_16bit = desc->comp[0].depth > 8;
 
-switch (inlink->format) {
-case AV_PIX_FMT_YUV410P:
-case AV_PIX_FMT_YUV411P:
-case AV_PIX_FMT_YUV420P:
-case AV_PIX_FMT_YUV422P:
-case AV_PIX_FMT_YUV440P:
-case AV_PIX_FMT_YUV444P:
-case AV_PIX_FMT_YUVA420P:
-case AV_PIX_FMT_YUVA422P:
-case AV_PIX_FMT_YUVA444P:
-case AV_PIX_FMT_YUV420P9LE:
-case AV_PIX_FMT_YUV422P9LE:
-case AV_PIX_FMT_YUV444P9LE:
-case AV_PIX_FMT_YUVA420P9LE:
-case AV_PIX_FMT_YUVA422P9LE:
-case AV_PIX_FMT_YUVA444P9LE:
-case AV_PIX_FMT_YUV420P10LE:
-case AV_PIX_FMT_YUV422P10LE:
-case AV_PIX_FMT_YUV440P10LE:
-case AV_PIX_FMT_YUV444P10LE:
-case AV_PIX_FMT_YUVA420P10LE:
-case AV_PIX_FMT_YUVA422P10LE:
-case AV_PIX_FMT_YUVA444P10LE:
-case AV_PIX_FMT_YUV420P12LE:
-case AV_PIX_FMT_YUV422P12LE:
-case AV_PIX_FMT_YUV440P12LE:
-case AV_PIX_FMT_YUV444P12LE:
-case AV_PIX_FMT_YUV420P14LE:
-case AV_PIX_FMT_YUV422P14LE:
-case AV_PIX_FMT_YUV444P14LE:
-case AV_PIX_FMT_YUV420P16LE:
-case AV_PIX_FMT_YUV422P16LE:
-case AV_PIX_FMT_YUV444P16LE:
-case AV_PIX_FMT_YUVA420P16LE:
-case AV_PIX_FMT_YUVA422P16LE:
-case AV_PIX_FMT_YUVA444P16LE:
+if (s->is_yuv) {
 min[Y] = 16 * (1 << (desc->comp[0].depth - 8));
 min[U] = 16 * (1 << (desc->comp[1].depth - 8));
 min[V] = 16 * (1 << (desc->comp[2].depth - 8));
@@ -271,24 +240,17 @@ static int config_props(AVFilterLink *inlink)
 max[U] = 240 * (1 << (desc->comp[1].depth - 8));
 max[V] = 240 * (1 << (desc->comp[2].depth - 8));
 max[A] = (1 << desc->comp[0].depth) - 1;
-break;
-case AV_PIX_FMT_RGB48LE:
-case AV_PIX_FMT_RGBA64LE:
-min[0] = min[1] = min[2] = min[3] = 0;
-max[0] = max[1] = max[2] = max[3] = 65535;
-break;
-default:
+} else {
 min[0] = min[1] = min[2] = min[3] = 0;
-max[0] = max[1] = max[2] = max[3] = 255 * (1 << (desc->comp[0].depth - 
8));
+if (inlink->format == AV_PIX_FMT_RGB48LE ||
+inlink->format == AV_PIX_FMT_RGBA64LE)
+max[0] = max[1] = max[2] = max[3] = 65535;
+else
+max[0] = max[1] = max[2] = max[3] = 255 * (1 << 
(desc->comp[0].depth - 8));
 }
 
-s->is_yuv = s->is_rgb = 0;
 s->is_planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR;
-if  (ff_fmt_is_in(inlink->format, yuv_pix_fmts)) s->is_yuv = 1;
-else if (ff_fmt_is_in(inlink->format, rgb_pix_fmts)) s->is_rgb = 1;
-
 if (s->is_rgb) {
-ff_fill_rgba_map(rgba_map, inlink->format);
 s->step = av_get_bits_per_pixel(desc) >> 3;
 if (s->is_16bit) {
 s->step = s->step >> 1;
-- 
2.21.0

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

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

[FFmpeg-devel] [PATCH v1 1/3] tests/fate/filter-video: add fate pixfmts test for lut3d

2019-10-29 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 tests/fate/filter-video.mak |  3 +++
 tests/ref/fate/filter-pixfmts-lut3d | 24 
 2 files changed, 27 insertions(+)
 create mode 100644 tests/ref/fate/filter-pixfmts-lut3d

diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 9e6351be3e..53e9def176 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -678,6 +678,9 @@ fate-filter-pixfmts-kerndeint: CMD = pixfmts "" 
"tinterlace=interleave_top,"
 FATE_FILTER_PIXFMTS-$(CONFIG_LUT_FILTER) += fate-filter-pixfmts-lut
 fate-filter-pixfmts-lut: CMD = pixfmts 
"c0=2*val:c1=2*val:c2=val/2:c3=negval+40"
 
+FATE_FILTER_PIXFMTS-$(CONFIG_LUT_FILTER) += fate-filter-pixfmts-lut3d
+fate-filter-pixfmts-lut3d: CMD = pixfmts
+
 FATE_FILTER_PIXFMTS-$(CONFIG_NULL_FILTER) += fate-filter-pixfmts-null
 fate-filter-pixfmts-null:  CMD = pixfmts
 
diff --git a/tests/ref/fate/filter-pixfmts-lut3d 
b/tests/ref/fate/filter-pixfmts-lut3d
new file mode 100644
index 00..56c294fa86
--- /dev/null
+++ b/tests/ref/fate/filter-pixfmts-lut3d
@@ -0,0 +1,24 @@
+0bgr5087cdbb3da0d014de02fda75618f278
+0rgb9ccde40a857919017558353aaecfa5de
+abgr0505ae7e852cf32ce9e2a0fc06462f48
+argb77e7baba2d8b4389267a2ecb67662c15
+bgr0cded4da42263da5bf0153e8bad09a0de
+bgr24   fef9ee2e37a1d5c1787ffb3ed5dcc3bf
+bgr48le 39fe9f41285f3325833d28ce1611d586
+bgra3433cdbdf07abbd8af4698a3b7a1a189
+bgra64le8f33508d6c0362df83296513ebee3a2d
+gbrap   4227379340c3d822dd6c59263b170972
+gbrap10le   90721f63d6e3d5d7a6bafcefdca5151d
+gbrap12le   e1eee70df0c2578937dcd7a90e22f4b7
+gbrap16le   2fd82ec30573ed65fa23c4d1c150d596
+gbrpe615c8ea180a0358261953812df0aa3d
+gbrp10led61faad75dbd7cbb0271b47fa33d714e
+gbrp12le90c4ec04807bbfbe194eddcc8d7bcb2a
+gbrp14lec424158744f9e16dbfcf00c66ba651f9
+gbrp16le8ccb63f9407cae03b2e061ed1249127d
+gbrp9le 4a267ed7c6535c8829e83e35c51df6bf
+rgb0545f5c4e4a7b7f3e61373149db0b932a
+rgb24   aec4f0a1954823de17024383d6401b75
+rgb48le 1d1e5a1849ed3c326961184bb2f45400
+rgbaecd54389d03bded1e8209f5bdea5
+rgba64leb26c35d221b026304db46014260ed1db
-- 
2.21.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] avformat/hls: Set AVFMT_TS_DISCONT flag on HLS input format

2019-10-29 Thread Dennis Mungai
On Tue, 29 Oct 2019 at 06:07, Steven Liu  wrote:
>
>
>
> > 在 2019年10月29日,01:09,Dennis Mungai  写道:
> >
> > On Mon, 28 Oct 2019 at 05:45, Steven Liu  wrote:
> >>
> >>
> >>
> >>> 在 2019年10月28日,02:39,Philip Langdale  写道:
> >>>
> >>> There have been many reports over the years about problems when
> >>> taking an HLS stream as input to `ffmpeg` where there are timestamp
> >>> discontinuities present. This is explicitly supported in the
> >>> HLS spec (EXT-X-DISCONTINUITY) and often used for ad injection.
> >>>
> >>> Various fixes and work-arounds have been proposed over the years,
> >>> but one step that seems obvious, even if it's not a complete fix,
> >>> is to mark the HLS input format as supporting discontinuities. This
> >>> will prevent timestamp fixup logic in ffmpeg.c kicking in that ends
> >>> up mangling the timestamps unnecessarily.
> >>>
> >>> I've tested this out with an example provided by Joe Koberg early
> >>> last year, and it is sufficient to allow `ffmpeg` to download and
> >>> mux the stream correctly. Joe had briefly suggested that other
> >>> situations can still be handled incorrectly, but this seems like
> >>> a strict improvement.
> >>>
> >>> Joe's example:
> >>>
> >>> https://s3.amazonaws.com/playon-test-videos/discont_test_new/discont_test.m3u8
> >>> ---
> >>> libavformat/hls.c | 2 +-
> >>> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/libavformat/hls.c b/libavformat/hls.c
> >>> index d7f4d5b442..ac151d5ca4 100644
> >>> --- a/libavformat/hls.c
> >>> +++ b/libavformat/hls.c
> >>> @@ -2326,7 +2326,7 @@ AVInputFormat ff_hls_demuxer = {
> >>>.long_name  = NULL_IF_CONFIG_SMALL("Apple HTTP Live Streaming"),
> >>>.priv_class = _class,
> >>>.priv_data_size = sizeof(HLSContext),
> >>> -.flags  = AVFMT_NOGENSEARCH,
> >>> +.flags  = AVFMT_NOGENSEARCH | AVFMT_TS_DISCONT,
> >>>.read_probe = hls_probe,
> >>>.read_header= hls_read_header,
> >>>.read_packet= hls_read_packet,
> >>> --
> >>> 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”.
> >>
> >> LGTM, whatever other more reasons, this can fix one of those problems.
> >>
> >> Thanks
> >> Steven
> >
> > This patch actually fixes the occurence of DTS and PTS discontinuities
> > I've been seeing with (some) HLS inputs that have discontinuities due
> > to ad insertion(s). 10+ hours later without a single discontinuity.
>
> Thanks Dennis, Will push this patch after 24hours if there have no objections.
> > ___
> > 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".
>
> Thanks
> Steven


Looking forward
___
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] configure: fix standalone compilation of mxf muxer

2019-10-29 Thread Lou Logan
Signed-off-by: Lou Logan 
---

Fixes:

./configure --disable-everything --enable-muxer=mxf
...
LD  ffmpeg_g
/usr/bin/ld: libavformat/libavformat.a(mxfenc.o): in function 
`get_ue_golomb_31':
ffmpeg/./libavcodec/golomb.h:140: undefined reference to `ff_ue_golomb_vlc_code'
collect2: error: ld returned 1 exit status
make: *** [Makefile:111: ffmpeg_g] Error 1

---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 7f63eebc9d..875b77fdf1 100755
--- a/configure
+++ b/configure
@@ -3273,6 +3273,7 @@ mp4_muxer_select="mov_muxer"
 mpegts_demuxer_select="iso_media"
 mpegts_muxer_select="adts_muxer latm_muxer"
 mpegtsraw_demuxer_select="mpegts_demuxer"
+mxf_muxer_select="golomb"
 mxf_d10_muxer_select="mxf_muxer"
 mxf_opatom_muxer_select="mxf_muxer"
 nut_muxer_select="riffenc"
-- 
2.23.0

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

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

[FFmpeg-devel] [PATCH 4/4] avformat/vividas: Add EOF check in val_1 loop in track_header()

2019-10-29 Thread Michael Niedermayer
Fixes: Timeout (148sec -> 0.1sec)
Fixes: 
18427/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5682124627116032

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

diff --git a/libavformat/vividas.c b/libavformat/vividas.c
index efe1b8deff..049414a413 100644
--- a/libavformat/vividas.c
+++ b/libavformat/vividas.c
@@ -295,6 +295,8 @@ static int track_header(VividasDemuxContext *viv, 
AVFormatContext *s,  uint8_t *
 for (i=0;ihttps://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH 3/4] avcodec/iff: Move index use after check in decodeplane8()

2019-10-29 Thread Michael Niedermayer
Fixes: index 9 out of bounds for type 'const uint64_t [8][256]'
Fixes: 
18409/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5767030560522240

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

diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index c18bac1ea1..3531799c4a 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -456,11 +456,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
  */
 static void decodeplane8(uint8_t *dst, const uint8_t *buf, int buf_size, int 
plane)
 {
-const uint64_t *lut = plane8_lut[plane];
+const uint64_t *lut;
 if (plane >= 8) {
 av_log(NULL, AV_LOG_WARNING, "Ignoring extra planes beyond 8\n");
 return;
 }
+lut = plane8_lut[plane];
 do {
 uint64_t v = AV_RN64A(dst) | lut[*buf++];
 AV_WN64A(dst, v);
-- 
2.23.0

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

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

[FFmpeg-devel] [PATCH 1/4] avcodec/apedec: Fixes integer overflow of res+*data in do_apply_filter()

2019-10-29 Thread Michael Niedermayer
Fixes: signed integer overflow: 7400 + 2147482786 cannot be represented in type 
'int'
Fixes: 
18405/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5708834760294400

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

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 2dd197a7f2..3880e265ee 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1271,7 +1271,7 @@ static void do_apply_filter(APEContext *ctx, int version, 
APEFilter *f,
  f->adaptcoeffs - order,
  order, APESIGN(*data));
 res = (int)(res + (1U << (fracbits - 1))) >> fracbits;
-res += *data;
+res += (unsigned)*data;
 *data++ = res;
 
 /* Update the output history */
-- 
2.23.0

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

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

[FFmpeg-devel] [PATCH 2/4] avcodec/ra288: Check block_align for the assumed value

2019-10-29 Thread Michael Niedermayer
Fixes: Timeout (224sec -> 1ms)
Fixes: 
18408/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_288_fuzzer-5740382570151936

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

diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index f1b3c8eab5..aa4bd5d90f 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -77,7 +77,7 @@ static av_cold int ra288_decode_init(AVCodecContext *avctx)
 avctx->channel_layout = AV_CH_LAYOUT_MONO;
 avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
 
-if (avctx->block_align <= 0) {
+if (avctx->block_align != 38) {
 av_log(avctx, AV_LOG_ERROR, "unsupported block align\n");
 return AVERROR_PATCHWELCOME;
 }
-- 
2.23.0

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

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

[FFmpeg-devel] [PATCH 2/3] avfilter/vf_fps: reindent

2019-10-29 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_fps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 7c9762864b..993a6be1b9 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -158,8 +158,8 @@ static int config_props(AVFilterLink* outlink)
 outlink->time_base  = av_inv_q(inlink->frame_rate);
 outlink->frame_rate = inlink->frame_rate;
 } else {
-outlink->time_base  = av_inv_q(s->framerate);
-outlink->frame_rate = s->framerate;
+outlink->time_base  = av_inv_q(s->framerate);
+outlink->frame_rate = s->framerate;
 }
 
 av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", outlink->frame_rate.num, 
outlink->frame_rate.den);
-- 
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 3/3] avfilter/vf_fps: add option to change way how frames are duplicated

2019-10-29 Thread Paul B Mahol
Default behaviour is unchanged, and that is always rounding down when
picking which frame to clone.

Signed-off-by: Paul B Mahol 
---
 doc/filters.texi | 19 +++
 libavfilter/vf_fps.c | 23 ---
 2 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 1e815bf940..6b5bf53c6d 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10740,6 +10740,25 @@ The default is @code{round}.
 @item input
 Pick output frame rate from input if it is available. The default is disabled.
 Useful to change input to constant frame rate without needing to know input 
frame rate.
+
+@item frames
+Frames picking rounding method when duplicating frames.
+
+Possible values are:
+@table @option
+@item zero
+round towards 0
+@item inf
+round away from 0
+@item down
+round towards -infinity
+@item up
+round towards +infinity
+@item near
+round to nearest
+@end table
+The default is @code{down}.
+
 @end table
 
 Alternatively, the options can be specified as a flat string:
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 993a6be1b9..3e6f9265af 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -49,6 +49,8 @@ typedef struct FPSContext {
 
 AVRational framerate;   ///< target framerate
 int rounding;   ///< AVRounding method for timestamps
+int frames_rounding;///< AVRounding method for cloning frames
+
 int eof_action; ///< action performed for last frame in FIFO
 
 /* Set during outlink configuration */
@@ -89,6 +91,7 @@ static const AVOption fps_options[] = {
 { "round", "round similar to other frames",  0, AV_OPT_TYPE_CONST, { 
.i64 = EOF_ACTION_ROUND }, 0, 0, V|F, "eof_action" },
 { "pass",  "pass through last frame",0, AV_OPT_TYPE_CONST, { 
.i64 = EOF_ACTION_PASS  }, 0, 0, V|F, "eof_action" },
 { "input", "use input framerate if available", OFFSET(input), 
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|F },
+{ "frames", "set rounding method for frames", OFFSET(frames_rounding), 
AV_OPT_TYPE_INT, { .i64 = AV_ROUND_DOWN }, 0, 5, V|F, "round" },
 { NULL }
 };
 
@@ -252,13 +255,27 @@ static int write_frame(AVFilterContext *ctx, FPSContext 
*s, AVFilterLink *outlin
 *again = 1;
 return 0;
 
-/* Output a copy of the first buffered frame */
+/* Output a copy of the buffered frame depending on frames rounding */
 } else {
-frame = av_frame_clone(s->frames[0]);
+int index;
+
+if (s->frames_count < 2) {
+index = 0;
+} else {
+switch (s->frames_rounding) {
+case AV_ROUND_ZERO: index = (s->next_pts - s->frames[0]->pts) 
>= 0 ? 0 : 1; break;
+case AV_ROUND_INF:  index = (s->next_pts - s->frames[0]->pts) 
<= 0 ? 0 : 1; break;
+case AV_ROUND_DOWN: index = 0; break;
+case AV_ROUND_UP:   index = (s->next_pts - s->frames[0]->pts) 
!= 0 ? 1 : 0; break;
+case AV_ROUND_NEAR_INF: index = (s->next_pts - s->frames[0]->pts) 
> (s->frames[1]->pts - s->frames[0]->pts) / 2 ? 1 : 0; break;
+}
+}
+
+frame = av_frame_clone(s->frames[index]);
 if (!frame)
 return AVERROR(ENOMEM);
 // Make sure Closed Captions will not be duplicated
-av_frame_remove_side_data(s->frames[0], AV_FRAME_DATA_A53_CC);
+av_frame_remove_side_data(s->frames[index], AV_FRAME_DATA_A53_CC);
 frame->pts = s->next_pts++;
 
 av_log(ctx, AV_LOG_DEBUG, "Writing frame with pts %"PRId64" to pts 
%"PRId64"\n",
-- 
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 1/3] avfilter/vf_fps: add way to get CFR output without knowing input frame rate

2019-10-29 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  3 +++
 libavfilter/vf_fps.c | 10 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 11f715319a..1e815bf940 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10737,6 +10737,9 @@ Pass through last frame if input duration has not been 
reached yet.
 @end table
 The default is @code{round}.
 
+@item input
+Pick output frame rate from input if it is available. The default is disabled.
+Useful to change input to constant frame rate without needing to know input 
frame rate.
 @end table
 
 Alternatively, the options can be specified as a flat string:
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index cf1e36726a..7c9762864b 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -70,6 +70,7 @@ typedef struct FPSContext {
 int frames_out;///< number of frames on output
 int dup;   ///< number of frames duplicated
 int drop;  ///< number of framed dropped
+int input; ///< should filter use input framerate if one 
is set
 } FPSContext;
 
 #define OFFSET(x) offsetof(FPSContext, x)
@@ -87,6 +88,7 @@ static const AVOption fps_options[] = {
 { "eof_action", "action performed for last frame", OFFSET(eof_action), 
AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_ROUND }, 0, EOF_ACTION_NB-1, V|F, 
"eof_action" },
 { "round", "round similar to other frames",  0, AV_OPT_TYPE_CONST, { 
.i64 = EOF_ACTION_ROUND }, 0, 0, V|F, "eof_action" },
 { "pass",  "pass through last frame",0, AV_OPT_TYPE_CONST, { 
.i64 = EOF_ACTION_PASS  }, 0, 0, V|F, "eof_action" },
+{ "input", "use input framerate if available", OFFSET(input), 
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|F },
 { NULL }
 };
 
@@ -99,7 +101,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 +154,15 @@ static int config_props(AVFilterLink* outlink)
 AVFilterLink*inlink = ctx->inputs[0];
 FPSContext  *s  = ctx->priv;
 
+if (s->input && inlink->frame_rate.num > 0 && inlink->frame_rate.den > 0) {
+outlink->time_base  = av_inv_q(inlink->frame_rate);
+outlink->frame_rate = inlink->frame_rate;
+} else {
 outlink->time_base  = av_inv_q(s->framerate);
 outlink->frame_rate = s->framerate;
+}
+
+av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", outlink->frame_rate.num, 
outlink->frame_rate.den);
 
 /* Calculate the input and output pts offsets for start_time */
 if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {
-- 
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] Reimbursement request

2019-10-29 Thread Thilo Borgmann
Am 29.10.19 um 09:34 schrieb Steven Liu:
> Hi,
> I'm requesting the reimbursement of travel expenses for the Google Mentor 
> Summit.
> I mentored the Derain project, more details can be found in [1].
> 
> 
> Flight  (CNY) ¥ 7062.00
> One night hotel (CNY) ¥ 632.00
> 
> Total   (CNY)  ¥  7694.00
> Total   (USD)  ≈$  1089.54
> 
> CNY to USD conversion done according to the UnionPay Banks [2]
> on 29st Oct (1 USD = 7.0617 CNY).
> 
> [1] - https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2019/Results
> [2] - http://www.safe.gov.cn/safe/rmbhlzjj/index.html

LGTM.

Thanks!
-Thilo
___
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 1/2] avcodec/dds: simplify the calculation of slice start and end

2019-10-29 Thread Limin Wang

ping

On Mon, Oct 21, 2019 at 08:48:13AM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libavcodec/dds.c | 19 +++
>  1 file changed, 3 insertions(+), 16 deletions(-)
> 
> diff --git a/libavcodec/dds.c b/libavcodec/dds.c
> index 9154f692fa..7c0ad9ee72 100644
> --- a/libavcodec/dds.c
> +++ b/libavcodec/dds.c
> @@ -434,7 +434,7 @@ static int parse_pixel_format(AVCodecContext *avctx)
>  }
>  
>  static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
> - int slice, int thread_nb)
> + int jobnr, int thread_nb)
>  {
>  DDSContext *ctx = avctx->priv_data;
>  AVFrame *frame = arg;
> @@ -442,21 +442,8 @@ static int decompress_texture_thread(AVCodecContext 
> *avctx, void *arg,
>  int w_block = avctx->coded_width / TEXTURE_BLOCK_W;
>  int h_block = avctx->coded_height / TEXTURE_BLOCK_H;
>  int x, y;
> -int start_slice, end_slice;
> -int base_blocks_per_slice = h_block / ctx->slice_count;
> -int remainder_blocks = h_block % ctx->slice_count;
> -
> -/* When the frame height (in blocks) doesn't divide evenly between the
> - * number of slices, spread the remaining blocks evenly between the first
> - * operations */
> -start_slice = slice * base_blocks_per_slice;
> -/* Add any extra blocks (one per slice) that have been added before this 
> slice */
> -start_slice += FFMIN(slice, remainder_blocks);
> -
> -end_slice = start_slice + base_blocks_per_slice;
> -/* Add an extra block if there are still remainder blocks to be 
> accounted for */
> -if (slice < remainder_blocks)
> -end_slice++;
> +int start_slice = (h_block * jobnr) / ctx->slice_count;
> +int end_slice = (h_block * (jobnr+1)) / ctx->slice_count;
>  
>  for (y = start_slice; y < end_slice; y++) {
>  uint8_t *p = frame->data[0] + y * frame->linesize[0] * 
> TEXTURE_BLOCK_H;
> -- 
> 2.21.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 v4 1/4] avfilter/vf_scdet: add filter to detect scene change

2019-10-29 Thread Limin Wang


ping, I have other developing filter is using this metadata, please
feedback whether it's OK to merge.


On Tue, Oct 08, 2019 at 11:28:36PM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Reviewed-by: Paul B Mahol 
> Signed-off-by: Limin Wang 
> ---
>  configure|   1 +
>  doc/filters.texi |  35 
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/vf_scdet.c   | 224 
> +++
>  5 files changed, 262 insertions(+)
>  create mode 100644 libavfilter/vf_scdet.c
> 
> diff --git a/configure b/configure
> index 8413826..e67cfc1 100755
> --- a/configure
> +++ b/configure
> @@ -3520,6 +3520,7 @@ sab_filter_deps="gpl swscale"
>  scale2ref_filter_deps="swscale"
>  scale_filter_deps="swscale"
>  scale_qsv_filter_deps="libmfx"
> +scdet_filter_select="scene_sad"
>  select_filter_select="scene_sad"
>  sharpness_vaapi_filter_deps="vaapi"
>  showcqt_filter_deps="avcodec avformat swscale"
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 0e72cce..4b3eeb1 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -15780,6 +15780,41 @@ Set the initial horizontal scrolling position. 
> Default is 0. Allowed range is fr
>  Set the initial vertical scrolling position. Default is 0. Allowed range is 
> from 0 to 1.
>  @end table
>  
> +@anchor{scdet}
> +@section scdet
> +
> +Detect video scene change.
> +
> +This filter sets frame metadata with mafd between frame, the scene score, and
> +forward the frame to the next filter, so they can use these metadata to 
> detect
> +scene change or others.
> +
> +In addition, this filter logs a message and sets frame metadata when it 
> detects
> +a scene change by @option{threshold}.
> +
> +@code{lavfi.scd.mafd} metadata keys are set with mafd for every frame.
> +
> +@code{lavfi.scd.score} metadata keys are set with scene change score for 
> every frame
> +to detect scene change.
> +
> +@code{lavfi.scd.time} metadata keys are set with current filtered frame time 
> which
> +detect scene change with @option{threshold}.
> +
> +The filter accepts the following options:
> +
> +@table @option
> +@item threshold, t
> +Set the scene change detection threshold as a percentage of maximum change. 
> Good
> +values are in the @code{[8.0, 14.0]} range. The range for @option{threshold} 
> is
> +@code{[0., 100.]}.
> +
> +Default value is @code{10.}.
> +
> +@item sc_pass, s
> +Set the flag to pass scene change frames to the next filter. Default value 
> is @code{0}
> +You can enable it if you want to get snapshot of scene change frames only.
> +@end table
> +
>  @anchor{selectivecolor}
>  @section selectivecolor
>  
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 16bb8cd..13fa000 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -358,6 +358,7 @@ OBJS-$(CONFIG_SCALE_NPP_FILTER)  += 
> vf_scale_npp.o scale.o
>  OBJS-$(CONFIG_SCALE_QSV_FILTER)  += vf_scale_qsv.o
>  OBJS-$(CONFIG_SCALE_VAAPI_FILTER)+= vf_scale_vaapi.o scale.o 
> vaapi_vpp.o
>  OBJS-$(CONFIG_SCALE2REF_FILTER)  += vf_scale.o scale.o
> +OBJS-$(CONFIG_SCDET_FILTER)  += vf_scdet.o
>  OBJS-$(CONFIG_SCROLL_FILTER) += vf_scroll.o
>  OBJS-$(CONFIG_SELECT_FILTER) += f_select.o
>  OBJS-$(CONFIG_SELECTIVECOLOR_FILTER) += vf_selectivecolor.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 4f8b303..38a7bfb 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -340,6 +340,7 @@ extern AVFilter ff_vf_scale_npp;
>  extern AVFilter ff_vf_scale_qsv;
>  extern AVFilter ff_vf_scale_vaapi;
>  extern AVFilter ff_vf_scale2ref;
> +extern AVFilter ff_vf_scdet;
>  extern AVFilter ff_vf_scroll;
>  extern AVFilter ff_vf_select;
>  extern AVFilter ff_vf_selectivecolor;
> diff --git a/libavfilter/vf_scdet.c b/libavfilter/vf_scdet.c
> new file mode 100644
> index 000..b91d91f
> --- /dev/null
> +++ b/libavfilter/vf_scdet.c
> @@ -0,0 +1,224 @@
> +/*
> + * 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
> + */
> +
> +/**
> + * @file
> + * video scene change detection filter
> + */
> +
> +#include 

Re: [FFmpeg-devel] [PATCH v4 3/3] FATE: add a test for freeezedetect

2019-10-29 Thread Limin Wang

ping, the patchset 1 and 2 has been pushed by Michael, but the #3
haven't merged yet.


On Mon, Oct 21, 2019 at 06:12:13PM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  tests/fate/filter-video.mak |   4 +
>  tests/ref/fate/filter-metadata-freezedetect | 251 
>  2 files changed, 255 insertions(+)
>  create mode 100644 tests/ref/fate/filter-metadata-freezedetect
> 
> diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
> index 72d95ae415..83a2739349 100644
> --- a/tests/fate/filter-video.mak
> +++ b/tests/fate/filter-video.mak
> @@ -744,6 +744,10 @@ FATE_METADATA_FILTER-$(call ALLYES, $(CROPDETECT_DEPS)) 
> += fate-filter-metadata-
>  fate-filter-metadata-cropdetect: SRC = 
> $(TARGET_SAMPLES)/filter/cropdetect.mp4
>  fate-filter-metadata-cropdetect: CMD = run $(FILTER_METADATA_COMMAND) 
> "sws_flags=+accurate_rnd+bitexact;movie='$(SRC)',cropdetect=max_outliers=3"
>  
> +FREEZEDETECT_DEPS = FFPROBE AVDEVICE LAVFI_INDEV MPTESTSRC_FILTER 
> SCALE_FILTER FREEZEDETECT_FILTER
> +FATE_METADATA_FILTER-$(call ALLYES, $(FREEZEDETECT_DEPS)) += 
> fate-filter-metadata-freezedetect
> +fate-filter-metadata-freezedetect: CMD = run $(FILTER_METADATA_COMMAND) 
> "sws_flags=+accurate_rnd+bitexact;mptestsrc=r=25:d=10:m=51,freezedetect"
> +
>  SILENCEDETECT_DEPS = FFPROBE AVDEVICE LAVFI_INDEV AMOVIE_FILTER TTA_DEMUXER 
> TTA_DECODER SILENCEDETECT_FILTER
>  FATE_METADATA_FILTER-$(call ALLYES, $(SILENCEDETECT_DEPS)) += 
> fate-filter-metadata-silencedetect
>  fate-filter-metadata-silencedetect: SRC = 
> $(TARGET_SAMPLES)/lossless-audio/inside.tta
> diff --git a/tests/ref/fate/filter-metadata-freezedetect 
> b/tests/ref/fate/filter-metadata-freezedetect
> new file mode 100644
> index 00..a0ee38e458
> --- /dev/null
> +++ b/tests/ref/fate/filter-metadata-freezedetect
> @@ -0,0 +1,251 @@
> +pkt_pts=0
> +pkt_pts=1
> +pkt_pts=2
> +pkt_pts=3
> +pkt_pts=4
> +pkt_pts=5
> +pkt_pts=6
> +pkt_pts=7
> +pkt_pts=8
> +pkt_pts=9
> +pkt_pts=10
> +pkt_pts=11
> +pkt_pts=12
> +pkt_pts=13
> +pkt_pts=14
> +pkt_pts=15
> +pkt_pts=16
> +pkt_pts=17
> +pkt_pts=18
> +pkt_pts=19
> +pkt_pts=20
> +pkt_pts=21
> +pkt_pts=22
> +pkt_pts=23
> +pkt_pts=24
> +pkt_pts=25
> +pkt_pts=26
> +pkt_pts=27
> +pkt_pts=28
> +pkt_pts=29
> +pkt_pts=30
> +pkt_pts=31
> +pkt_pts=32
> +pkt_pts=33
> +pkt_pts=34
> +pkt_pts=35
> +pkt_pts=36
> +pkt_pts=37
> +pkt_pts=38
> +pkt_pts=39
> +pkt_pts=40
> +pkt_pts=41
> +pkt_pts=42
> +pkt_pts=43
> +pkt_pts=44
> +pkt_pts=45
> +pkt_pts=46
> +pkt_pts=47
> +pkt_pts=48
> +pkt_pts=49
> +pkt_pts=50
> +pkt_pts=51
> +pkt_pts=52
> +pkt_pts=53
> +pkt_pts=54
> +pkt_pts=55
> +pkt_pts=56
> +pkt_pts=57
> +pkt_pts=58
> +pkt_pts=59
> +pkt_pts=60
> +pkt_pts=61
> +pkt_pts=62
> +pkt_pts=63
> +pkt_pts=64
> +pkt_pts=65
> +pkt_pts=66
> +pkt_pts=67
> +pkt_pts=68
> +pkt_pts=69
> +pkt_pts=70
> +pkt_pts=71
> +pkt_pts=72
> +pkt_pts=73
> +pkt_pts=74
> +pkt_pts=75
> +pkt_pts=76
> +pkt_pts=77
> +pkt_pts=78
> +pkt_pts=79
> +pkt_pts=80
> +pkt_pts=81
> +pkt_pts=82
> +pkt_pts=83
> +pkt_pts=84
> +pkt_pts=85
> +pkt_pts=86
> +pkt_pts=87
> +pkt_pts=88
> +pkt_pts=89
> +pkt_pts=90
> +pkt_pts=91
> +pkt_pts=92
> +pkt_pts=93
> +pkt_pts=94
> +pkt_pts=95
> +pkt_pts=96
> +pkt_pts=97
> +pkt_pts=98
> +pkt_pts=99
> +pkt_pts=100
> +pkt_pts=101
> +pkt_pts=102
> +pkt_pts=103
> +pkt_pts=104
> +pkt_pts=105
> +pkt_pts=106
> +pkt_pts=107
> +pkt_pts=108
> +pkt_pts=109
> +pkt_pts=110
> +pkt_pts=111
> +pkt_pts=112
> +pkt_pts=113
> +pkt_pts=114
> +pkt_pts=115
> +pkt_pts=116
> +pkt_pts=117
> +pkt_pts=118
> +pkt_pts=119
> +pkt_pts=120
> +pkt_pts=121
> +pkt_pts=122
> +pkt_pts=123
> +pkt_pts=124
> +pkt_pts=125
> +pkt_pts=126
> +pkt_pts=127
> +pkt_pts=128
> +pkt_pts=129
> +pkt_pts=130
> +pkt_pts=131
> +pkt_pts=132
> +pkt_pts=133
> +pkt_pts=134
> +pkt_pts=135
> +pkt_pts=136
> +pkt_pts=137
> +pkt_pts=138
> +pkt_pts=139
> +pkt_pts=140
> +pkt_pts=141
> +pkt_pts=142
> +pkt_pts=143
> +pkt_pts=144
> +pkt_pts=145
> +pkt_pts=146
> +pkt_pts=147
> +pkt_pts=148
> +pkt_pts=149
> +pkt_pts=150
> +pkt_pts=151
> +pkt_pts=152
> +pkt_pts=153|tag:lavfi.freezedetect.freeze_start=4.12|tag:lavfi.freezedetect.freeze_duration=2|tag:lavfi.freezedetect.freeze_end=6.12
> +pkt_pts=154
> +pkt_pts=155
> +pkt_pts=156
> +pkt_pts=157
> +pkt_pts=158
> +pkt_pts=159
> +pkt_pts=160
> +pkt_pts=161
> +pkt_pts=162
> +pkt_pts=163
> +pkt_pts=164
> +pkt_pts=165
> +pkt_pts=166
> +pkt_pts=167
> +pkt_pts=168
> +pkt_pts=169
> +pkt_pts=170
> +pkt_pts=171
> +pkt_pts=172
> +pkt_pts=173
> +pkt_pts=174
> +pkt_pts=175
> +pkt_pts=176
> +pkt_pts=177
> +pkt_pts=178
> +pkt_pts=179
> +pkt_pts=180
> +pkt_pts=181
> +pkt_pts=182
> +pkt_pts=183
> +pkt_pts=184
> +pkt_pts=185
> +pkt_pts=186
> +pkt_pts=187
> +pkt_pts=188
> +pkt_pts=189
> +pkt_pts=190
> +pkt_pts=191
> +pkt_pts=192
> +pkt_pts=193
> +pkt_pts=194
> +pkt_pts=195
> +pkt_pts=196
> +pkt_pts=197
> +pkt_pts=198
> +pkt_pts=199
> +pkt_pts=200
> +pkt_pts=201
> +pkt_pts=202
> +pkt_pts=203
> 

Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_fps: add way to get CFR output without knowing input frame rate

2019-10-29 Thread Moritz Barsnick
On Tue, Oct 29, 2019 at 14:47:43 +0100, Paul B Mahol wrote:
> +{ "input", "use input framerate is available", OFFSET(input), 
> AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|F },

I assume you meant:
is -> if

> -av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, 
> s->framerate.den);
> +if (!s->input)
> +av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, 
> s->framerate.den);

Could it still be reported elsewhere? Like down there:

> +if (s->input && inlink->frame_rate.num > 0 && inlink->frame_rate.den > 
> 0) {
> +outlink->time_base  = av_inv_q(inlink->frame_rate);
> +outlink->frame_rate = inlink->frame_rate;
> +} else {
>  outlink->time_base  = av_inv_q(s->framerate);
>  outlink->frame_rate = s->framerate;
> +}

Now the used framerate is known, could be reported here?

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

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

Re: [FFmpeg-devel] [PATCH] avfilter: remove useless cast

2019-10-29 Thread zhilizhao(赵志立)


> On Oct 29, 2019, at 9:15 PM, Paul B Mahol  wrote:
> 
> On 10/29/19, Michael Niedermayer  wrote:
>> On Mon, Oct 28, 2019 at 11:18:04AM +0800, myp...@gmail.com wrote:
>>> On Mon, Oct 28, 2019 at 12:03 AM Zhao Zhili 
>>> wrote:
 
 ---
 libavfilter/allfilters.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
 index d136734338..6156066028 100644
 --- a/libavfilter/allfilters.c
 +++ b/libavfilter/allfilters.c
 @@ -503,7 +503,7 @@ const AVFilter *avfilter_get_by_name(const char
 *name)
 
 while ((f = av_filter_iterate()))
 if (!strcmp(f->name, name))
 -return (AVFilter *)f;
 +return f;
 
 return NULL;
 }
 --
 2.21.0
>>> LGTM
>> 
>> will apply
>> 
> 
> Breaks ABI.

I don’t get it, would you care to elaborate?

> 
>> thx
>> 
>> [...]
>> 
>> --
>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>> 
>> Good people do not need laws to tell them to act responsibly, while bad
>> people will find a way around the laws. -- Plato
>> 
> ___
> 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] libavcodec/amfenc.h: Added engine selection support for AMFContext initialisation.

2019-10-29 Thread OvchinnikovDmitrii
---
 libavcodec/amfenc.c  | 93 +++-
 libavcodec/amfenc.h  |  8 
 libavcodec/amfenc_h264.c |  6 +++
 libavcodec/amfenc_hevc.c |  6 +++
 4 files changed, 93 insertions(+), 20 deletions(-)

diff --git a/libavcodec/amfenc.c b/libavcodec/amfenc.c
index f66b95645e..a89e14f6cd 100644
--- a/libavcodec/amfenc.c
+++ b/libavcodec/amfenc.c
@@ -210,10 +210,54 @@ static int amf_init_from_dxva2_device(AVCodecContext 
*avctx, AVDXVA2DeviceContex
 }
 #endif
 
-static int amf_init_context(AVCodecContext *avctx)
+static AMF_RESULT amf_context_init_d3d11(AVCodecContext *avctx)
 {
+AMF_RESULT res;
+AmfContext *ctx = avctx->priv_data;
+res = ctx->context->pVtbl->InitDX11(ctx->context, NULL, AMF_DX11_1);
+if (res == AMF_OK) {
+av_log(avctx, AV_LOG_VERBOSE, "AMF initialisation succeeded via 
D3D11.\n");
+}
+return res;
+}
+
+static AMF_RESULT amf_context_init_dxva2(AVCodecContext *avctx)
+{
+AMF_RESULT res;
+AmfContext *ctx = avctx->priv_data;
+res = ctx->context->pVtbl->InitDX9(ctx->context, NULL);
+if (res == AMF_OK) {
+av_log(avctx, AV_LOG_VERBOSE, "AMF initialisation succeeded via 
dxva2.\n");
+}
+return res;
+}
+
+static AMF_RESULT amf_context_init_vulkan(AVCodecContext *avctx)
+{
+AMF_RESULT res;
 AmfContext *ctx = avctx->priv_data;
 AMFContext1 *context1 = NULL;
+AMFGuid guid = IID_AMFContext1();
+
+res = ctx->context->pVtbl->QueryInterface(ctx->context, , 
(void**));
+AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, "CreateContext1() 
failed with error %d\n", res);
+
+res = context1->pVtbl->InitVulkan(context1, NULL);
+context1->pVtbl->Release(context1);
+if (res != AMF_OK) {
+if (res == AMF_NOT_SUPPORTED)
+av_log(avctx, AV_LOG_ERROR, "AMF via Vulkan is not supported on 
the given device.\n");
+else
+av_log(avctx, AV_LOG_ERROR, "AMF failed to initialise on the given 
Vulkan device: %d.\n", res);
+return AMF_FAIL;
+}
+av_log(avctx, AV_LOG_VERBOSE, "AMF initialisation succeeded via 
Vulkan.\n");
+return res;
+}
+
+static int amf_init_context(AVCodecContext *avctx)
+{
+AmfContext *ctx = avctx->priv_data;
 AMF_RESULT  res;
 av_unused int ret;
 
@@ -304,30 +348,39 @@ static int amf_init_context(AVCodecContext *avctx)
 return AVERROR(ENOMEM);
 
 } else {
-res = ctx->context->pVtbl->InitDX11(ctx->context, NULL, AMF_DX11_1);
-if (res == AMF_OK) {
-av_log(avctx, AV_LOG_VERBOSE, "AMF initialisation succeeded via 
D3D11.\n");
-} else {
-res = ctx->context->pVtbl->InitDX9(ctx->context, NULL);
-if (res == AMF_OK) {
-av_log(avctx, AV_LOG_VERBOSE, "AMF initialisation succeeded 
via D3D9.\n");
-} else {
-AMFGuid guid = IID_AMFContext1();
-res = ctx->context->pVtbl->QueryInterface(ctx->context, , 
(void**));
-AMF_RETURN_IF_FALSE(ctx, res == AMF_OK, AVERROR_UNKNOWN, 
"CreateContext1() failed with error %d\n", res);
+res = AMF_FAIL;
+switch (ctx->engine) {
+case AMF_VIDEO_ENCODER_ENGINE_D3D11:
+res = amf_context_init_d3d11(avctx);
+break;
+case AMF_VIDEO_ENCODER_ENGINE_DXVA2:
+res = amf_context_init_dxva2(avctx);
+break;
+case AMF_VIDEO_ENCODER_ENGINE_VULKAN:
+res = amf_context_init_vulkan(avctx);
+break;
+default:
+break;
+}
+if (res != AMF_OK) {
+if (ctx->engine != AMF_VIDEO_ENCODER_ENGINE_DEFAULT)
+av_log(avctx, AV_LOG_ERROR, "AMF failed to initialise via 
preffered engine\n");
+
+if (ctx->engine != AMF_VIDEO_ENCODER_ENGINE_D3D11)
+res = amf_context_init_d3d11(avctx);
 
-res = context1->pVtbl->InitVulkan(context1, NULL);
-context1->pVtbl->Release(context1);
+if (res != AMF_OK) {
+if (ctx->engine != AMF_VIDEO_ENCODER_ENGINE_DXVA2)
+res = amf_context_init_dxva2(avctx);
 if (res != AMF_OK) {
-if (res == AMF_NOT_SUPPORTED)
-av_log(avctx, AV_LOG_ERROR, "AMF via Vulkan is not 
supported on the given device.\n");
-else
-av_log(avctx, AV_LOG_ERROR, "AMF failed to initialise 
on the given Vulkan device: %d.\n", res);
-return AVERROR(ENOSYS);
+if (ctx->engine != AMF_VIDEO_ENCODER_ENGINE_VULKAN)
+res = amf_context_init_vulkan(avctx);
 }
-av_log(avctx, AV_LOG_VERBOSE, "AMF initialisation succeeded 
via Vulkan.\n");
 }
 }
+if (res != AMF_OK) {
+return AVERROR(ENOSYS);
+}
 }
 return 0;
 }
diff --git a/libavcodec/amfenc.h b/libavcodec/amfenc.h
index 

Re: [FFmpeg-devel] [PATCH 1/2] avfilter/vf_fps: add way to get CFR output without knowing input frame rate

2019-10-29 Thread Paul B Mahol
On 10/29/19, Gyan  wrote:
>
>
> On 29-10-2019 07:17 PM, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol 
>> ---
>>   doc/filters.texi |  3 +++
>>   libavfilter/vf_fps.c | 10 +-
>>   2 files changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/doc/filters.texi b/doc/filters.texi
>> index 11f715319a..1e815bf940 100644
>> --- a/doc/filters.texi
>> +++ b/doc/filters.texi
>> @@ -10737,6 +10737,9 @@ Pass through last frame if input duration has not
>> been reached yet.
>>   @end table
>>   The default is @code{round}.
>>
>> +@item input
>> +Pick output frame rate from input if it is available. The default is
>> disabled.
>> +Useful to change input to constant frame rate without needing to know
>> input frame rate.
>>   @end table
>>
>>   Alternatively, the options can be specified as a flat string:
>> diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
>> index cf1e36726a..3561332f0e 100644
>> --- a/libavfilter/vf_fps.c
>> +++ b/libavfilter/vf_fps.c
>> @@ -70,6 +70,7 @@ typedef struct FPSContext {
>>   int frames_out;///< number of frames on output
>>   int dup;   ///< number of frames duplicated
>>   int drop;  ///< number of framed dropped
>> +int input; ///< should filter use input framerate if
>> one is set
>>   } FPSContext;
>>
>>   #define OFFSET(x) offsetof(FPSContext, x)
>> @@ -87,6 +88,7 @@ static const AVOption fps_options[] = {
>>   { "eof_action", "action performed for last frame",
>> OFFSET(eof_action), AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_ROUND }, 0,
>> EOF_ACTION_NB-1, V|F, "eof_action" },
>>   { "round", "round similar to other frames",  0,
>> AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_ROUND }, 0, 0, V|F, "eof_action" },
>>   { "pass",  "pass through last frame",0,
>> AV_OPT_TYPE_CONST, { .i64 = EOF_ACTION_PASS  }, 0, 0, V|F, "eof_action" },
>> +{ "input", "use input framerate is available", OFFSET(input),
>> AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|F },
>>   { NULL }
>>   };
>>
>> @@ -99,7 +101,8 @@ 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);
>> +if (!s->input)
>> +av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num,
>> s->framerate.den);
>>   return 0;
>>   }
>>
>> @@ -153,8 +156,13 @@ static int config_props(AVFilterLink* outlink)
>>   AVFilterLink*inlink = ctx->inputs[0];
>>   FPSContext  *s  = ctx->priv;
>>
>> +if (s->input && inlink->frame_rate.num > 0 && inlink->frame_rate.den
>> > 0) {
>> +outlink->time_base  = av_inv_q(inlink->frame_rate);
>> +outlink->frame_rate = inlink->frame_rate;
>
> Maybe add some sanity checks for very high frame rates e.g. some WebMs
> whose video fps is detected as 1000.

Not needed.

>
>> +} else {
>>   outlink->time_base  = av_inv_q(s->framerate);
>>   outlink->frame_rate = s->framerate;
>> +}
>>
>>   /* Calculate the input and output pts offsets for start_time */
>>   if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {
>
> 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".
___
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/2] avfilter/vf_fps: add way to get CFR output without knowing input frame rate

2019-10-29 Thread Gyan



On 29-10-2019 07:17 PM, Paul B Mahol wrote:

Signed-off-by: Paul B Mahol 
---
  doc/filters.texi |  3 +++
  libavfilter/vf_fps.c | 10 +-
  2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 11f715319a..1e815bf940 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10737,6 +10737,9 @@ Pass through last frame if input duration has not been 
reached yet.
  @end table
  The default is @code{round}.
  
+@item input

+Pick output frame rate from input if it is available. The default is disabled.
+Useful to change input to constant frame rate without needing to know input 
frame rate.
  @end table
  
  Alternatively, the options can be specified as a flat string:

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index cf1e36726a..3561332f0e 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -70,6 +70,7 @@ typedef struct FPSContext {
  int frames_out;///< number of frames on output
  int dup;   ///< number of frames duplicated
  int drop;  ///< number of framed dropped
+int input; ///< should filter use input framerate if one 
is set
  } FPSContext;
  
  #define OFFSET(x) offsetof(FPSContext, x)

@@ -87,6 +88,7 @@ static const AVOption fps_options[] = {
  { "eof_action", "action performed for last frame", OFFSET(eof_action), 
AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_ROUND }, 0, EOF_ACTION_NB-1, V|F, "eof_action" },
  { "round", "round similar to other frames",  0, AV_OPT_TYPE_CONST, { .i64 = 
EOF_ACTION_ROUND }, 0, 0, V|F, "eof_action" },
  { "pass",  "pass through last frame",0, AV_OPT_TYPE_CONST, { .i64 = 
EOF_ACTION_PASS  }, 0, 0, V|F, "eof_action" },
+{ "input", "use input framerate is available", OFFSET(input), 
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|F },
  { NULL }
  };
  
@@ -99,7 +101,8 @@ 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);

+if (!s->input)
+av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, 
s->framerate.den);
  return 0;
  }
  
@@ -153,8 +156,13 @@ static int config_props(AVFilterLink* outlink)

  AVFilterLink*inlink = ctx->inputs[0];
  FPSContext  *s  = ctx->priv;
  
+if (s->input && inlink->frame_rate.num > 0 && inlink->frame_rate.den > 0) {

+outlink->time_base  = av_inv_q(inlink->frame_rate);
+outlink->frame_rate = inlink->frame_rate;


Maybe add some sanity checks for very high frame rates e.g. some WebMs 
whose video fps is detected as 1000.



+} else {
  outlink->time_base  = av_inv_q(s->framerate);
  outlink->frame_rate = s->framerate;
+}
  
  /* Calculate the input and output pts offsets for start_time */

  if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {


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".

[FFmpeg-devel] [PATCH V2] libavformat/flacenc: reject too big picture blocks

2019-10-29 Thread Mattias Wadman
A too big picture will case the muxer to write a truncated block size (uint24)
causing the output file to be corrupt.

How to reproduce:

Write a file with truncated block size:
ffmpeg -y -f lavfi -i sine -f lavfi -i color=red:size=2400x2400 -map
0:a:0 -map 1:v:0 -c:v:0 bmp -disposition:1 attached_pic -t 1 test.flac

Try to decode:
ffmpeg -i test.flac test.wav

Signed-off-by: Mattias Wadman 
---
 libavformat/flacenc.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index 93cc79bbe0..7b51c11404 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -93,7 +93,7 @@ static int flac_write_picture(struct AVFormatContext
*s, AVPacket *pkt)
 AVDictionaryEntry *e;
 const char *mimetype = NULL, *desc = "";
 const AVStream *st = s->streams[pkt->stream_index];
-int i, mimelen, desclen, type = 0;
+int i, mimelen, desclen, type = 0, blocklen;

 if (!pkt->data)
 return 0;
@@ -140,8 +140,14 @@ static int flac_write_picture(struct
AVFormatContext *s, AVPacket *pkt)
 desc = e->value;
 desclen = strlen(desc);

+blocklen = 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 + pkt->size;
+if (blocklen >= 1<<24) {
+ av_log(s, AV_LOG_ERROR, "Picture block too big %d >= %d\n",
blocklen, 1<<24);
+return AVERROR(EINVAL);
+}
+
 avio_w8(pb, 0x06);
-avio_wb24(pb, 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 +
pkt->size);
+avio_wb24(pb, blocklen);

 avio_wb32(pb, type);

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

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

[FFmpeg-devel] [PATCH 2/2] avfilter/vf_fps: reindent

2019-10-29 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_fps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 3561332f0e..da004937d5 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -160,8 +160,8 @@ static int config_props(AVFilterLink* outlink)
 outlink->time_base  = av_inv_q(inlink->frame_rate);
 outlink->frame_rate = inlink->frame_rate;
 } else {
-outlink->time_base  = av_inv_q(s->framerate);
-outlink->frame_rate = s->framerate;
+outlink->time_base  = av_inv_q(s->framerate);
+outlink->frame_rate = s->framerate;
 }
 
 /* Calculate the input and output pts offsets for start_time */
-- 
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 1/2] avfilter/vf_fps: add way to get CFR output without knowing input frame rate

2019-10-29 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 doc/filters.texi |  3 +++
 libavfilter/vf_fps.c | 10 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 11f715319a..1e815bf940 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -10737,6 +10737,9 @@ Pass through last frame if input duration has not been 
reached yet.
 @end table
 The default is @code{round}.
 
+@item input
+Pick output frame rate from input if it is available. The default is disabled.
+Useful to change input to constant frame rate without needing to know input 
frame rate.
 @end table
 
 Alternatively, the options can be specified as a flat string:
diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index cf1e36726a..3561332f0e 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -70,6 +70,7 @@ typedef struct FPSContext {
 int frames_out;///< number of frames on output
 int dup;   ///< number of frames duplicated
 int drop;  ///< number of framed dropped
+int input; ///< should filter use input framerate if one 
is set
 } FPSContext;
 
 #define OFFSET(x) offsetof(FPSContext, x)
@@ -87,6 +88,7 @@ static const AVOption fps_options[] = {
 { "eof_action", "action performed for last frame", OFFSET(eof_action), 
AV_OPT_TYPE_INT, { .i64 = EOF_ACTION_ROUND }, 0, EOF_ACTION_NB-1, V|F, 
"eof_action" },
 { "round", "round similar to other frames",  0, AV_OPT_TYPE_CONST, { 
.i64 = EOF_ACTION_ROUND }, 0, 0, V|F, "eof_action" },
 { "pass",  "pass through last frame",0, AV_OPT_TYPE_CONST, { 
.i64 = EOF_ACTION_PASS  }, 0, 0, V|F, "eof_action" },
+{ "input", "use input framerate is available", OFFSET(input), 
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, V|F },
 { NULL }
 };
 
@@ -99,7 +101,8 @@ 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);
+if (!s->input)
+av_log(ctx, AV_LOG_VERBOSE, "fps=%d/%d\n", s->framerate.num, 
s->framerate.den);
 return 0;
 }
 
@@ -153,8 +156,13 @@ static int config_props(AVFilterLink* outlink)
 AVFilterLink*inlink = ctx->inputs[0];
 FPSContext  *s  = ctx->priv;
 
+if (s->input && inlink->frame_rate.num > 0 && inlink->frame_rate.den > 0) {
+outlink->time_base  = av_inv_q(inlink->frame_rate);
+outlink->frame_rate = inlink->frame_rate;
+} else {
 outlink->time_base  = av_inv_q(s->framerate);
 outlink->frame_rate = s->framerate;
+}
 
 /* Calculate the input and output pts offsets for start_time */
 if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) {
-- 
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] libavcodec/h261dec: Fix keyframe markup and frame skipping.

2019-10-29 Thread Andrey Semashev

On 2019-10-26 14:05, Andrey Semashev wrote:

The decoder never marks pictures as I-frames, which results in no
keyframe indication and incorrect frame skipping, in cases when
keyframes should be decoded.

This commit works around this decoder limitation and marks I-frames
and keyframes based on "freeze picture release" bit in h261 picture
header. This reflects h261enc behavior.


So, is this patch acceptable? If yes, could someone merge it please?


---
  libavcodec/h261.h|  1 +
  libavcodec/h261dec.c | 27 ++-
  2 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/libavcodec/h261.h b/libavcodec/h261.h
index 399a404b2b..6662d38d6d 100644
--- a/libavcodec/h261.h
+++ b/libavcodec/h261.h
@@ -37,6 +37,7 @@
  typedef struct H261Context {
  MpegEncContext s;
  
+int freeze_picture_release; // 1 if freeze picture release bit is set in the picture header

  int current_mba;
  int mba_diff;
  int mtype;
diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c
index 14a874c45d..3b1711a21d 100644
--- a/libavcodec/h261dec.c
+++ b/libavcodec/h261dec.c
@@ -502,9 +502,9 @@ static int h261_decode_picture_header(H261Context *h)
  s->avctx->framerate = (AVRational) { 3, 1001 };
  
  /* PTYPE starts here */

-skip_bits1(>gb); /* split screen off */
-skip_bits1(>gb); /* camera  off */
-skip_bits1(>gb); /* freeze picture release off */
+skip_bits1(>gb); /* split screen indicator */
+skip_bits1(>gb); /* document camera indicator */
+h->freeze_picture_release = get_bits1(>gb); /* freeze picture release */
  
  format = get_bits1(>gb);
  
@@ -532,7 +532,8 @@ static int h261_decode_picture_header(H261Context *h)
  
  /* H.261 has no I-frames, but if we pass AV_PICTURE_TYPE_I for the first

   * frame, the codec crashes if it does not contain all I-blocks
- * (e.g. when a packet is lost). */
+ * (e.g. when a packet is lost). We will fix the picture type in the
+ * output frame based on h->freeze_picture_release later. */
  s->pict_type = AV_PICTURE_TYPE_P;
  
  h->gob_number = 0;

@@ -590,6 +591,7 @@ static int h261_decode_frame(AVCodecContext *avctx, void 
*data,
  H261Context *h = avctx->priv_data;
  MpegEncContext *s  = >s;
  int ret;
+enum AVPictureType pict_type;
  AVFrame *pict = data;
  
  ff_dlog(avctx, "*frame %d size=%d\n", avctx->frame_number, buf_size);

@@ -630,15 +632,17 @@ retry:
  goto retry;
  }
  
-// for skipping the frame

-s->current_picture.f->pict_type = s->pict_type;
-s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+// for skipping the frame and keyframe markup
+pict_type = h->freeze_picture_release ? AV_PICTURE_TYPE_I : s->pict_type;
  
-if ((avctx->skip_frame >= AVDISCARD_NONREF && s->pict_type == AV_PICTURE_TYPE_B) ||

-(avctx->skip_frame >= AVDISCARD_NONKEY && s->pict_type != 
AV_PICTURE_TYPE_I) ||
+if ((avctx->skip_frame >= AVDISCARD_NONREF && pict_type == 
AV_PICTURE_TYPE_B) ||
+(avctx->skip_frame >= AVDISCARD_NONKEY && pict_type != 
AV_PICTURE_TYPE_I) ||
   avctx->skip_frame >= AVDISCARD_ALL)
  return get_consumed_bytes(s, buf_size);
  
+s->current_picture.f->pict_type = s->pict_type;

+s->current_picture.f->key_frame = s->pict_type == AV_PICTURE_TYPE_I;
+
  if (ff_mpv_frame_start(s, avctx) < 0)
  return -1;
  
@@ -660,6 +664,11 @@ retry:
  
  if ((ret = av_frame_ref(pict, s->current_picture_ptr->f)) < 0)

  return ret;
+
+// fix picture type and correctly mark keyframes
+pict->pict_type = pict_type;
+pict->key_frame = pict_type == AV_PICTURE_TYPE_I;
+
  ff_print_debug_info(s, s->current_picture_ptr, pict);
  
  *got_frame = 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/dss: Remove superfluous headers

2019-10-29 Thread Michael Niedermayer
On Sat, Oct 26, 2019 at 06:59:57AM +0200, Andreas Rheinhardt wrote:
> Both attributes.h and bswap.h have been included from the very beginning
> of this muxer without there being any reason to do so.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
> The earlier mail claimed this to be about avformat/ass. Sorry.

will apply

thx

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


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 4/4] avcodec/libvorbisdec: Fix insufficient input checks leading to out of array reads

2019-10-29 Thread Michael Niedermayer
On Sun, Oct 27, 2019 at 01:15:47AM +0200, Michael Niedermayer wrote:
> Fixes: 
> 16144/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_fuzzer-5638618940440576
> Fixes: out of array read
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/libvorbisdec.c | 11 +++
>  1 file changed, 7 insertions(+), 4 deletions(-)

will apply

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

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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 3/4] avcodec/g723_1dec: fix invalid shift with negative sid_gain

2019-10-29 Thread Michael Niedermayer
On Sun, Oct 27, 2019 at 12:55:32PM +0100, Paul B Mahol wrote:
> lgtm

will apply

thx

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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 v2] avfilter/asrc_anoisesrc: change color variable to int

2019-10-29 Thread Michael Niedermayer
On Sat, Oct 26, 2019 at 03:34:04PM +0200, Paul B Mahol wrote:
> OK

will apply

thx

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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 1/3] avcodec/apedec: Only clear the needed buffer space, instead of all

2019-10-29 Thread Michael Niedermayer
On Mon, Oct 28, 2019 at 07:22:31PM +0100, Paul B Mahol wrote:
> probably ok

will apply

thx

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

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



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

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

Re: [FFmpeg-devel] [PATCH 2/3] avcodec/adpcm: Fix invalid shifts in ADPCM DTK

2019-10-29 Thread Michael Niedermayer
On Mon, Oct 28, 2019 at 07:21:42PM +0100, Paul B Mahol wrote:
> Trivial change, LGTM

will apply

thx

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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 3/3] avcodec/wmalosslessdec: Fix some integer anomalies

2019-10-29 Thread Michael Niedermayer
On Mon, Oct 28, 2019 at 07:22:11PM +0100, Paul B Mahol wrote:
> Trivial change, LGTM

will apply

thx

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

It is what and why we do it that matters, not just one of them.


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: remove useless cast

2019-10-29 Thread Paul B Mahol
On 10/29/19, Michael Niedermayer  wrote:
> On Mon, Oct 28, 2019 at 11:18:04AM +0800, myp...@gmail.com wrote:
>> On Mon, Oct 28, 2019 at 12:03 AM Zhao Zhili 
>> wrote:
>> >
>> > ---
>> >  libavfilter/allfilters.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
>> > index d136734338..6156066028 100644
>> > --- a/libavfilter/allfilters.c
>> > +++ b/libavfilter/allfilters.c
>> > @@ -503,7 +503,7 @@ const AVFilter *avfilter_get_by_name(const char
>> > *name)
>> >
>> >  while ((f = av_filter_iterate()))
>> >  if (!strcmp(f->name, name))
>> > -return (AVFilter *)f;
>> > +return f;
>> >
>> >  return NULL;
>> >  }
>> > --
>> > 2.21.0
>> LGTM
>
> will apply
>

Breaks ABI.

> thx
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Good people do not need laws to tell them to act responsibly, while bad
> people will find a way around the laws. -- Plato
>
___
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: remove useless cast

2019-10-29 Thread Michael Niedermayer
On Mon, Oct 28, 2019 at 11:18:04AM +0800, myp...@gmail.com wrote:
> On Mon, Oct 28, 2019 at 12:03 AM Zhao Zhili  wrote:
> >
> > ---
> >  libavfilter/allfilters.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> > index d136734338..6156066028 100644
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -503,7 +503,7 @@ const AVFilter *avfilter_get_by_name(const char *name)
> >
> >  while ((f = av_filter_iterate()))
> >  if (!strcmp(f->name, name))
> > -return (AVFilter *)f;
> > +return f;
> >
> >  return NULL;
> >  }
> > --
> > 2.21.0
> LGTM

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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]Avoid duplicating Closed Captions when increasing frame rate

2019-10-29 Thread Paul B Mahol
On 11/27/18, Carl Eugen Hoyos  wrote:
> 2018-11-23 19:03 GMT+01:00, Carl Eugen Hoyos :
>
>> Attached patches fix Closed Captions when increasing frame rate, both
>> with "-r" and the fps filter, fixes ticket #7506.
>
> Patches applied.
>

Please revert your incorrect change.

You clone frame but do not remove captions from cloned frame but from
original frame.
This is incorrect.

> Carl Eugen
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
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] Slightly update nvenc error messages and warnings

2019-10-29 Thread Timo Rothenpieler

Good oh. Thank you.

"No capable devices found" is briefer, I wonder whether it works for a confused 
user like me :)
I suppose it would, given it would be in combination the other message expanded 
as
"Multiple reference frames are not supported by the device".

On that note, I suppose some or most of the other messages could also have
"by the device" added for clarity ?

Should I submit an updated patch or I guess leave it in your capable hands ?



applied with minor amendments
___
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/utils: fix logic failure

2019-10-29 Thread Paul B Mahol
On 10/29/19, Michael Niedermayer  wrote:
> On Tue, Oct 29, 2019 at 10:45:20AM +0100, Paul B Mahol wrote:
>> Fixes decoding of wav file which is wrongly recognized as mp1 audio.
>>
>> Signed-off-by: Paul B Mahol 
>> ---
>>  libavformat/utils.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/utils.c b/libavformat/utils.c
>> index cfb6d03397..bf27531ed0 100644
>> --- a/libavformat/utils.c
>> +++ b/libavformat/utils.c
>> @@ -370,7 +370,7 @@ static int set_codec_from_probe_data(AVFormatContext
>> *s, AVStream *st,
>>  if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
>>  st->codecpar->sample_rate)
>>  continue;
>> -if (st->request_probe > score &&
>> +if (st->request_probe > score ||
>>  st->codecpar->codec_id != fmt_id_type[i].id)
>>  continue;
>
> this change is wrong and would break fate,
> the 2nd term could be removed if it causes problems but they cannot
> be run as "||"
>
> how can this issue be reproduced ?
>

https://0x0.st/zYLx.wav

> thx
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Freedom in capitalist society always remains about the same as it was in
> ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
>
___
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/tiff: check denominator values in tiff_decode_tag()

2019-10-29 Thread Michael Niedermayer
On Sun, Oct 27, 2019 at 10:26:45AM -0300, James Almer wrote:
> Fixes ticket #8327.
> 
> Signed-off-by: James Almer 
> ---
> The first case may be for either black level or SAR, so i decided to use a
> generic error message.
> 
>  libavcodec/tiff.c | 9 +
>  1 file changed, 9 insertions(+)

LGTM

thx

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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] libavformat/flacenc: reject too big picture blocks

2019-10-29 Thread Michael Niedermayer
On Sun, Oct 27, 2019 at 10:06:11PM +0100, Mattias Wadman wrote:
> Think i messed up the formatting of the in-line patch somehow. Ill send the
> patch as an attachment instead. Hope reply and attach is ok?
> 
> On Sun, Oct 27, 2019 at 8:22 PM Mattias Wadman 
> wrote:
> 
> > A too big picture will case the muxer to write a truncated block size
> > (uint24)
> > causing the output file to be corrupt.
> >
> > How to reproduce:
> >
> > Write a file with truncated block size:
> > ffmpeg -y -f lavfi -i sine -f lavfi -i color=red:size=2400x2400 -map 0:a:0
> > -map 1:v:0 -c:v:0 bmp -disposition:1 attached_pic -t 1 test.flac
> >
> > Try to decode:
> > ffmpeg -i test.flac test.wav
> >
> > Signed-off-by: Mattias Wadman 
> > ---
> >  libavformat/flacenc.c | 10 --
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git libavformat/flacenc.c libavformat/flacenc.c
> > index 93cc79bbe0..957bcb1123 100644
> > --- libavformat/flacenc.c
> > +++ libavformat/flacenc.c
> > @@ -93,7 +93,7 @@ static int flac_write_picture(struct AVFormatContext *s,
> > AVPacket *pkt)
> >  AVDictionaryEntry *e;
> >  const char *mimetype = NULL, *desc = "";
> >  const AVStream *st = s->streams[pkt->stream_index];
> > -int i, mimelen, desclen, type = 0;
> > +int i, mimelen, desclen, type = 0, blocklen = 0;
> >
> >  if (!pkt->data)
> >  return 0;
> > @@ -140,8 +140,14 @@ static int flac_write_picture(struct AVFormatContext
> > *s, AVPacket *pkt)
> >  desc = e->value;
> >  desclen = strlen(desc);
> >
> > +blocklen = 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 +
> > pkt->size;
> > +if (blocklen >= 1<<24) {
> > + av_log(s, AV_LOG_ERROR, "Picture block too big %d >= %d\n",
> > blocklen, 1<<24);
> > +return AVERROR(EINVAL);
> > +}
> > +
> >  avio_w8(pb, 0x06);
> > -avio_wb24(pb, 4 + 4 + mimelen + 4 + desclen + 4 + 4 + 4 + 4 + 4 +
> > pkt->size);
> > +avio_wb24(pb, blocklen);
> >
> >  avio_wb32(pb, type);
> >
> > --
> > 2.22.0
> >

>  flacenc.c |   10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 4b8ce8290f9727383c669467ba5c8358ac12b156  
> 0001-libavformat-flacenc-reject-too-large-picture-blocks.patch
> From ea7cfb4fde056fbfdc9c7970453176281a16df27 Mon Sep 17 00:00:00 2001
> From: Mattias Wadman 
> Date: Sun, 27 Oct 2019 20:00:06 +0100
> Subject: [PATCH] libavformat/flacenc: reject too large picture blocks
> 
> A large picture will case the muxer to write a truncated block size (uint24)
> causing the output file to be corrupt.
> 
> How to reproduce:
> 
> Write a file with truncated block size:
> ffmpeg -y -f lavfi -i sine -f lavfi -i color=red:size=2400x2400 -map 0:a:0 
> -map 1:v:0 -c:v:0 bmp -disposition:1 attached_pic -t 1 test.flac
> 
> Try to decode:
> ffmpeg -i test.flac test.wav
> 
> Signed-off-by: Mattias Wadman 
> ---
>  libavformat/flacenc.c | 10 --
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git libavformat/flacenc.c libavformat/flacenc.c
> index 93cc79bbe0..957bcb1123 100644
> --- libavformat/flacenc.c
> +++ libavformat/flacenc.c
> @@ -93,7 +93,7 @@ static int flac_write_picture(struct AVFormatContext *s, 
> AVPacket *pkt)
>  AVDictionaryEntry *e;
>  const char *mimetype = NULL, *desc = "";
>  const AVStream *st = s->streams[pkt->stream_index];
> -int i, mimelen, desclen, type = 0;
> +int i, mimelen, desclen, type = 0, blocklen = 0;

The initialization to 0 is useless


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2



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] avformat/utils: fix logic failure

2019-10-29 Thread Michael Niedermayer
On Tue, Oct 29, 2019 at 10:45:20AM +0100, Paul B Mahol wrote:
> Fixes decoding of wav file which is wrongly recognized as mp1 audio.
> 
> Signed-off-by: Paul B Mahol 
> ---
>  libavformat/utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index cfb6d03397..bf27531ed0 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -370,7 +370,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
> AVStream *st,
>  if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
>  st->codecpar->sample_rate)
>  continue;
> -if (st->request_probe > score &&
> +if (st->request_probe > score ||
>  st->codecpar->codec_id != fmt_id_type[i].id)
>  continue;

this change is wrong and would break fate,
the 2nd term could be removed if it causes problems but they cannot
be run as "||"

how can this issue be reproduced ?

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


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] examples: set GOP size to 10 seconds

2019-10-29 Thread Steven Liu
Alfred E. Heggestad  于2019年10月29日周二 下午6:08写道:
>
> On 29/10/2019 10:34, Steven Liu wrote:
> >
> >
> >> 在 2019年10月29日,17:25,Alfred E. Heggestad  写道:
> >>
> >> using a gop_size of 10 in the example code is very misleading.
> >> in practice this means around 2 keyframes per second.
> >>
> >> a normal video encoder should not send keyframes so frequent,
> >> a better interval is 10 seconds.
> >
> > 10 seconds is too long. i think 10 frames maybe ok for a sample.
> > but usually set to 2s one GOP here, for publish stream to rtmp server.
> > This is just a sample, so i think 10 second is too long.
>
> Hi Steven,
>
> I think we should make it clear in the code that the GOP size
> depends on the framerate. Keep in mind that many people just copy
> the example code to use in their applications, and does not
> necessarily try to understand all the small details.
>
>
> I am sure we can agree on a nice value for the keyframe interval,
> but my point is that the value should be in seconds and not frames.

Yes i get your point, but the comment of the gop_size is:

/**
 * the number of pictures in a group of pictures, or 0 for intra_only
 * - encoding: Set by user.
 * - decoding: unused
 */
int gop_size;
Maybe user should read the document or the API's comments before they
use it, not only copy & paste.

>
> For example 5 seconds:
>
>
>c->gop_size = 5 * FPS;
>
>
>
>
> /alfred
> ___
> 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] examples: set GOP size to 10 seconds

2019-10-29 Thread Alfred E. Heggestad

On 29/10/2019 10:34, Steven Liu wrote:




在 2019年10月29日,17:25,Alfred E. Heggestad  写道:

using a gop_size of 10 in the example code is very misleading.
in practice this means around 2 keyframes per second.

a normal video encoder should not send keyframes so frequent,
a better interval is 10 seconds.


10 seconds is too long. i think 10 frames maybe ok for a sample.
but usually set to 2s one GOP here, for publish stream to rtmp server.
This is just a sample, so i think 10 second is too long.


Hi Steven,

I think we should make it clear in the code that the GOP size
depends on the framerate. Keep in mind that many people just copy
the example code to use in their applications, and does not
necessarily try to understand all the small details.


I am sure we can agree on a nice value for the keyframe interval,
but my point is that the value should be in seconds and not frames.

For example 5 seconds:


  c->gop_size = 5 * FPS;




/alfred
___
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/utils: fix logic failure

2019-10-29 Thread Paul B Mahol
Fixes decoding of wav file which is wrongly recognized as mp1 audio.

Signed-off-by: Paul B Mahol 
---
 libavformat/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index cfb6d03397..bf27531ed0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -370,7 +370,7 @@ static int set_codec_from_probe_data(AVFormatContext *s, 
AVStream *st,
 if (fmt_id_type[i].type != AVMEDIA_TYPE_AUDIO &&
 st->codecpar->sample_rate)
 continue;
-if (st->request_probe > score &&
+if (st->request_probe > score ||
 st->codecpar->codec_id != fmt_id_type[i].id)
 continue;
 st->codecpar->codec_id   = fmt_id_type[i].id;
-- 
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] examples: set GOP size to 10 seconds

2019-10-29 Thread Steven Liu


> 在 2019年10月29日,17:25,Alfred E. Heggestad  写道:
> 
> using a gop_size of 10 in the example code is very misleading.
> in practice this means around 2 keyframes per second.
> 
> a normal video encoder should not send keyframes so frequent,
> a better interval is 10 seconds.

10 seconds is too long. i think 10 frames maybe ok for a sample.
but usually set to 2s one GOP here, for publish stream to rtmp server.
This is just a sample, so i think 10 second is too long.
> 
> Signed-off-by: Alfred E. Heggestad 
> ---
> doc/examples/encode_video.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/examples/encode_video.c b/doc/examples/encode_video.c
> index d9ab409908..8c5ee9818e 100644
> --- a/doc/examples/encode_video.c
> +++ b/doc/examples/encode_video.c
> @@ -110,13 +110,13 @@ int main(int argc, char **argv)
> c->time_base = (AVRational){1, 25};
> c->framerate = (AVRational){25, 1};
> 
> -/* emit one intra frame every ten frames
> +/* emit one intra frame every ten seconds
>  * check frame pict_type before passing frame
>  * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
>  * then gop_size is ignored and the output of encoder
>  * will always be I frame irrespective to gop_size
>  */
> -c->gop_size = 10;
> +c->gop_size = 10 * 25;
> c->max_b_frames = 1;
> c->pix_fmt = AV_PIX_FMT_YUV420P;
> 
> -- 
> 2.20.1 (Apple Git-117)
> 
> ___
> 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".

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] [PATCH] examples: set GOP size to 10 seconds

2019-10-29 Thread Alfred E. Heggestad

using a gop_size of 10 in the example code is very misleading.
in practice this means around 2 keyframes per second.

a normal video encoder should not send keyframes so frequent,
a better interval is 10 seconds.

Signed-off-by: Alfred E. Heggestad 
---
 doc/examples/encode_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/examples/encode_video.c b/doc/examples/encode_video.c
index d9ab409908..8c5ee9818e 100644
--- a/doc/examples/encode_video.c
+++ b/doc/examples/encode_video.c
@@ -110,13 +110,13 @@ int main(int argc, char **argv)
 c->time_base = (AVRational){1, 25};
 c->framerate = (AVRational){25, 1};

-/* emit one intra frame every ten frames
+/* emit one intra frame every ten seconds
  * check frame pict_type before passing frame
  * to encoder, if frame->pict_type is AV_PICTURE_TYPE_I
  * then gop_size is ignored and the output of encoder
  * will always be I frame irrespective to gop_size
  */
-c->gop_size = 10;
+c->gop_size = 10 * 25;
 c->max_b_frames = 1;
 c->pix_fmt = AV_PIX_FMT_YUV420P;

--
2.20.1 (Apple Git-117)

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

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

Re: [FFmpeg-devel] Reimbursement request

2019-10-29 Thread Paul B Mahol
On 10/29/19, Steven Liu  wrote:
> Hi,
> I'm requesting the reimbursement of travel expenses for the Google Mentor
> Summit.
> I mentored the Derain project, more details can be found in [1].
>
>
> Flight  (CNY) ¥ 7062.00
> One night hotel (CNY) ¥ 632.00
>
> Total   (CNY)  ¥  7694.00
> Total   (USD)  ≈$  1089.54
>
> CNY to USD conversion done according to the UnionPay Banks [2]
> on 29st Oct (1 USD = 7.0617 CNY).
>
> [1] - https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2019/Results
> [2] - http://www.safe.gov.cn/safe/rmbhlzjj/index.html
>

Carl and Michael took all the remaining money, sorry.

>
> 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".

[FFmpeg-devel] Reimbursement request

2019-10-29 Thread Steven Liu
Hi,
I'm requesting the reimbursement of travel expenses for the Google Mentor 
Summit.
I mentored the Derain project, more details can be found in [1].


Flight  (CNY) ¥ 7062.00
One night hotel (CNY) ¥ 632.00

Total   (CNY)  ¥  7694.00
Total   (USD)  ≈$  1089.54

CNY to USD conversion done according to the UnionPay Banks [2]
on 29st Oct (1 USD = 7.0617 CNY).

[1] - https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2019/Results
[2] - http://www.safe.gov.cn/safe/rmbhlzjj/index.html


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".