[FFmpeg-cvslog] lavf/movenc: fix tmcd writing for non-MP4/MOV modes

2019-04-03 Thread Gyan Doshi
ffmpeg | branch: master | Gyan Doshi  | Sun Mar 31 00:18:50 
2019 +0530| [8161ac2902836032b6f6684aa48275325f8ca9ef] | committer: Gyan Doshi

lavf/movenc: fix tmcd writing for non-MP4/MOV modes

write_tmcd allows tmcd track to be created with any mode but in
mov_write_header, index for first tmcd track is only set for modes
MP4 or MOV, causing a crash if tmcd creation is attempted with other
modes.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8161ac2902836032b6f6684aa48275325f8ca9ef
---

 libavformat/movenc.c  | 2 +-
 tests/fate/lavf-container.mak | 2 +-
 tests/ref/lavf/ismv   | 8 
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7f5dcd703e..c67f909608 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6381,7 +6381,7 @@ static int mov_write_header(AVFormatContext *s)
 nb_tracks++;
 }
 
-if (mov->mode == MODE_MOV || mov->mode == MODE_MP4)
+if (mov->nb_meta_tmcd)
 tmcd_track = nb_tracks;
 
 for (i = 0; i < s->nb_streams; i++) {
diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
index a531914aad..22387d04d8 100644
--- a/tests/fate/lavf-container.mak
+++ b/tests/fate/lavf-container.mak
@@ -34,7 +34,7 @@ fate-lavf-flm: CMD = lavf_container "" "-pix_fmt rgba"
 fate-lavf-gxf: CMD = lavf_container "-ar 48000" "-r 25 -s pal -ac 1 -threads 1"
 fate-lavf-gxf_pal: CMD = lavf_container_timecode_nodrop "-ar 48000 -r 25 -s 
pal -ac 1 -threads 1 -f gxf"
 fate-lavf-gxf_ntsc: CMD = lavf_container_timecode_drop "-ar 48000 -s ntsc -ac 
1 -threads 1 -f gxf"
-fate-lavf-ismv: CMD = lavf_container_timecode "-an -c:v mpeg4 -threads 1"
+fate-lavf-ismv: CMD = lavf_container_timecode "-an -write_tmcd 1 -c:v mpeg4 
-threads 1"
 fate-lavf-mkv: CMD = lavf_container "" "-c:a mp2 -c:v mpeg4 -ar 44100 -threads 
1"
 fate-lavf-mkv_attachment: CMD = lavf_container_attach "-c:a mp2 -c:v mpeg4 
-threads 1 -f matroska"
 fate-lavf-mov: CMD = lavf_container_timecode "-movflags +faststart -c:a 
pcm_alaw -c:v mpeg4 -threads 1"
diff --git a/tests/ref/lavf/ismv b/tests/ref/lavf/ismv
index 96dc8c1c9d..865a6913cf 100644
--- a/tests/ref/lavf/ismv
+++ b/tests/ref/lavf/ismv
@@ -1,8 +1,8 @@
-96053075a3f60d271131fe2d0765c267 *tests/data/lavf/lavf.ismv
-312542 tests/data/lavf/lavf.ismv
+bd88b50defa57766619c092ea89f25a6 *tests/data/lavf/lavf.ismv
+313165 tests/data/lavf/lavf.ismv
 tests/data/lavf/lavf.ismv CRC=0x9d9a638a
-7022701b4c693bc4ffe1e9f96dd82a02 *tests/data/lavf/lavf.ismv
-321448 tests/data/lavf/lavf.ismv
+805a2557bf952c84835f3c10b6893e15 *tests/data/lavf/lavf.ismv
+322071 tests/data/lavf/lavf.ismv
 tests/data/lavf/lavf.ismv CRC=0xe8130120
 96053075a3f60d271131fe2d0765c267 *tests/data/lavf/lavf.ismv
 312542 tests/data/lavf/lavf.ismv

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

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

[FFmpeg-cvslog] lavc/qsvenc: enable hevc gpb option

2019-04-03 Thread Zhong Li
ffmpeg | branch: master | Zhong Li  | Fri Jan 11 15:09:07 
2019 +0800| [1125277bc64ebef1a7a6bee7349c7a8fab7fdcc7] | committer: Zhong Li

lavc/qsvenc: enable hevc gpb option

GPB is the default type, just contains forward references but the
slice_type is B slice with higher encoding efficiency than regular P
slice, but lower performance.

Add an option to allow user to set regular P slice.

Fix ticket#6870

Test data on Intel Kabylake (i7-7567U CPU @ 3.50GHz):
1. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 
-vsync passthrough
-vframes 1000  -c:v hevc_qsv -gpb 0 -bf 0 -q 25 test_gpb_off_bf0_kbl.mp4

transcoding fps: 85
encoded file size of test_gpb_off_bf0_kbl.mp4: 21960100 (bytes)

2. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 
-vsync passthrough
-vframes 1000  -c:v hevc_qsv -gpb 1 -bf 0 -q 25 test_gpb_on_bf0_kbl.mp4

transcoding fps: 79
encoded file size oftest_gpb_on_bf0_kbl.mp4:  21211449 (bytes)

In this case, enable gpb can bring about 7% performance drop but 3.4% encoding 
efficiency improvment.

Signed-off-by: Zhong Li 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1125277bc64ebef1a7a6bee7349c7a8fab7fdcc7
---

 libavcodec/qsvenc.c  | 9 +
 libavcodec/qsvenc.h  | 3 +++
 libavcodec/qsvenc_hevc.c | 2 ++
 3 files changed, 14 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 55f1223f02..a03ab69590 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -267,6 +267,11 @@ static void dump_video_param(AVCodecContext *avctx, 
QSVEncContext *q,
 #endif
 #endif
 
+#if QSV_HAVE_GPB
+if (avctx->codec_id == AV_CODEC_ID_HEVC)
+av_log(avctx, AV_LOG_VERBOSE,"GPB: %s\n", print_threestate(co3->GPB));
+#endif
+
 if (avctx->codec_id == AV_CODEC_ID_H264) {
 av_log(avctx, AV_LOG_VERBOSE, "Entropy coding: %s; 
MaxDecFrameBuffering: %"PRIu16"\n",
co->CAVLC == MFX_CODINGOPTION_ON ? "CAVLC" : "CABAC", 
co->MaxDecFrameBuffering);
@@ -748,6 +753,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #if QSV_HAVE_CO3
 q->extco3.Header.BufferId  = MFX_EXTBUFF_CODING_OPTION3;
 q->extco3.Header.BufferSz  = sizeof(q->extco3);
+#if QSV_HAVE_GPB
+if (avctx->codec_id == AV_CODEC_ID_HEVC)
+q->extco3.GPB  = q->gpb ? MFX_CODINGOPTION_ON : 
MFX_CODINGOPTION_OFF;
+#endif
 q->extparam_internal[q->nb_extparam_internal++] = (mfxExtBuffer 
*)&q->extco3;
 #endif
 }
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index f6d53d44cd..f2f4d38503 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -47,6 +47,8 @@
 #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
 #define QSV_HAVE_VDENC  QSV_VERSION_ATLEAST(1, 15)
 
+#define QSV_HAVE_GPBQSV_VERSION_ATLEAST(1, 18)
+
 #if defined(_WIN32) || defined(__CYGWIN__)
 #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)
 #define QSV_HAVE_ICQQSV_VERSION_ATLEAST(1, 8)
@@ -173,6 +175,7 @@ typedef struct QSVEncContext {
 
 int repeat_pps;
 int low_power;
+int gpb;
 
 int a53_cc;
 
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index 4c2592355e..da64b4c21b 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -241,6 +241,8 @@ static const AVOption options[] = {
 { "main10",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAIN10  
}, INT_MIN, INT_MAX, VE, "profile" },
 { "mainsp",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAINSP  
}, INT_MIN, INT_MAX, VE, "profile" },
 
+{ "gpb", "1: GPB (generalized P/B frame); 0: regular P frame", 
OFFSET(qsv.gpb), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, VE},
+
 { NULL },
 };
 

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

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

[FFmpeg-cvslog] lavc/qsvenc: enable hevc coding options configuration

2019-04-03 Thread Zhong Li
ffmpeg | branch: master | Zhong Li  | Wed Mar 27 14:33:36 
2019 +0800| [c745bedd18afea19e3eb75da3d094d542b02a88b] | committer: Zhong Li

lavc/qsvenc: enable hevc coding options configuration

Signed-off-by: Zhong Li 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c745bedd18afea19e3eb75da3d094d542b02a88b
---

 libavcodec/qsvenc.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index e76c580b4a..55f1223f02 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -629,9 +629,10 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 #endif
 }
 
-// the HEVC encoder plugin currently fails if coding options
-// are provided
-if (avctx->codec_id != AV_CODEC_ID_HEVC) {
+// The HEVC encoder plugin currently fails with some old libmfx version if 
coding options
+// are provided. Can't find the extract libmfx version which fixed it, 
just enable it from
+// V1.28 in order to keep compatibility security.
+if ((avctx->codec_id != AV_CODEC_ID_HEVC) || 
QSV_RUNTIME_VERSION_ATLEAST(q->ver, 1, 28)) {
 q->extco.Header.BufferId  = MFX_EXTBUFF_CODING_OPTION;
 q->extco.Header.BufferSz  = sizeof(q->extco);
 

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

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

[FFmpeg-cvslog] lavc/qsvenc: no need to include h264.h for jpeg encoder

2019-04-03 Thread Zhong Li
ffmpeg | branch: master | Zhong Li  | Mon Apr  1 12:18:57 
2019 +0800| [6f9d7c556d5f466c604fe76723950b834c5d1af4] | committer: Zhong Li

lavc/qsvenc: no need to include h264.h for jpeg encoder

Signed-off-by: Zhong Li 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6f9d7c556d5f466c604fe76723950b834c5d1af4
---

 libavcodec/qsvenc_jpeg.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c
index 1e7785a826..1619a335c7 100644
--- a/libavcodec/qsvenc_jpeg.c
+++ b/libavcodec/qsvenc_jpeg.c
@@ -29,7 +29,6 @@
 
 #include "avcodec.h"
 #include "internal.h"
-#include "h264.h"
 #include "qsv.h"
 #include "qsv_internal.h"
 #include "qsvenc.h"

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

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

[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 0812910 web/security: Add CVE-2019-9718 and CVE-2019-9721

2019-04-03 Thread ffmpeg-git
The branch, master has been updated
   via  081291060b9267f88003e5d81d6820a229878d89 (commit)
  from  b2448554b06cfdaaa37f65644a9a8750589c4551 (commit)


- Log -
commit 081291060b9267f88003e5d81d6820a229878d89
Author: Michael Niedermayer 
AuthorDate: Wed Apr 3 17:47:28 2019 +0200
Commit: Michael Niedermayer 
CommitDate: Wed Apr 3 17:47:28 2019 +0200

web/security: Add CVE-2019-9718 and CVE-2019-9721

Signed-off-by: Michael Niedermayer 

diff --git a/src/security b/src/security
index c755a2e..8615685 100644
--- a/src/security
+++ b/src/security
@@ -3,6 +3,15 @@
 
 FFmpeg 4.1
 
+4.1.2
+
+Fixes following vulnerabilities:
+
+
+CVE-2019-9718, cc5361ed18ab0f69cfbead7afc88fb81ed4b36ae / 
1f00c97bc3475c477f3c468cf2d924d5761d0982
+CVE-2019-9721, f7f3937494f6734d27fc3d0081c9c7a9a19614a8 / 
894995c41e0795c7a44f81adc4838dedc3932e65
+
+
 4.1
 
 Fixes following vulnerabilities:
@@ -29,6 +38,15 @@ CVE-2018-15822, 6b67d7f05918f7a1ee8fc6ff21355d7e8736aa10
 Fixes following vulnerabilities:
 
 
+CVE-2019-9718, 381fa4a29d38e4ddef2a83876fb8f76e96f45a5d / 
1f00c97bc3475c477f3c468cf2d924d5761d0982
+CVE-2019-9721, 7dc5c930354c4339ce36a6cc4f2113c9cfd294f5 / 
894995c41e0795c7a44f81adc4838dedc3932e65
+
+
+4.0.3
+
+Fixes following vulnerabilities:
+
+
 CVE-2018-15822, 386975d7a4aa4f41451f5895a689aedbf83c4ecd / 
6b67d7f05918f7a1ee8fc6ff21355d7e8736aa10
 
 
@@ -69,6 +87,15 @@ CVE-2018-10001, 47b7c68ae54560e2308bdb6be4fb076c73b93081
 
 FFmpeg 3.4
 
+3.4.6
+
+Fixes following vulnerabilities:
+
+
+CVE-2019-9718, 9191218d11684a5a283fcf387fc85af62ceef9bb / 
1f00c97bc3475c477f3c468cf2d924d5761d0982
+CVE-2019-9721, e2ae3419ff47b66a2a9a93c0cdf81155c70f2b3c / 
894995c41e0795c7a44f81adc4838dedc3932e65
+
+
 3.4.5
 
 Fixes following vulnerabilities:

---

Summary of changes:
 src/security | 27 +++
 1 file changed, 27 insertions(+)


hooks/post-receive
-- 

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

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

[FFmpeg-cvslog] avcodec/av1_metadata: add an option to remove Padding OBUs

2019-04-03 Thread James Almer
ffmpeg | branch: master | James Almer  | Mon Mar 25 00:27:23 
2019 -0300| [ee16d14b0a29317f6118a209c4d0737b97b7f58f] | committer: James Almer

avcodec/av1_metadata: add an option to remove Padding OBUs

Reviewed-by: Mark Thompson 
Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ee16d14b0a29317f6118a209c4d0737b97b7f58f
---

 doc/bitstream_filters.texi|  3 +++
 libavcodec/av1_metadata_bsf.c | 19 +++
 libavcodec/version.h  |  2 +-
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi
index 076b910e40..25bbf8372b 100644
--- a/doc/bitstream_filters.texi
+++ b/doc/bitstream_filters.texi
@@ -87,6 +87,9 @@ the timing info in the sequence header.
 Set the number of ticks in each picture, to indicate that the stream
 has a fixed framerate.  Ignored if @option{tick_rate} is not also set.
 
+@item delete_padding
+Deletes Padding OBUs.
+
 @end table
 
 @section chomp
diff --git a/libavcodec/av1_metadata_bsf.c b/libavcodec/av1_metadata_bsf.c
index 2b74b697e4..fe208feaf5 100644
--- a/libavcodec/av1_metadata_bsf.c
+++ b/libavcodec/av1_metadata_bsf.c
@@ -46,6 +46,8 @@ typedef struct AV1MetadataContext {
 
 AVRational tick_rate;
 int num_ticks_per_picture;
+
+int delete_padding;
 } AV1MetadataContext;
 
 
@@ -158,6 +160,19 @@ static int av1_metadata_filter(AVBSFContext *bsf, AVPacket 
*out)
 }
 }
 
+if (ctx->delete_padding) {
+for (i = 0; i < frag->nb_units; i++) {
+if (frag->units[i].type == AV1_OBU_PADDING) {
+err = ff_cbs_delete_unit(ctx->cbc, frag, i);
+if (err < 0) {
+av_log(bsf, AV_LOG_ERROR, "Failed to delete Padding 
OBU.\n");
+goto fail;
+}
+--i;
+}
+}
+}
+
 err = ff_cbs_write_packet(ctx->cbc, out, frag);
 if (err < 0) {
 av_log(bsf, AV_LOG_ERROR, "Failed to write packet.\n");
@@ -275,6 +290,10 @@ static const AVOption av1_metadata_options[] = {
 OFFSET(num_ticks_per_picture), AV_OPT_TYPE_INT,
 { .i64 = -1 }, -1, INT_MAX, FLAGS },
 
+{ "delete_padding", "Delete all Padding OBUs",
+OFFSET(delete_padding), AV_OPT_TYPE_BOOL,
+{ .i64 = 0 }, 0, 1, FLAGS},
+
 { NULL }
 };
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index d1cd356524..02cb5c3ec1 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  58
 #define LIBAVCODEC_VERSION_MINOR  48
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \

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

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