[FFmpeg-devel] [PATCH] avformat/dashenc: Support HTTP Persistent for master.mu8 as well
--- libavformat/dashenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 3f5f290e25..15b84a0f3b 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final) snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", filename_hls); set_http_options(&opts, c); -ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, NULL, &opts); +ret = dashenc_io_open(s, &c->m3u8_out, temp_filename, &opts); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); return ret; } av_dict_free(&opts); -ff_hls_write_playlist_version(out, 7); +ff_hls_write_playlist_version(c->m3u8_out, 7); for (i = 0; i < s->nb_streams; i++) { char playlist_file[64]; @@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final) if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) continue; get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); -ff_hls_write_audio_rendition(out, (char *)audio_group, +ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group, playlist_file, i, is_default); max_audio_bitrate = FFMAX(st->codecpar->bit_rate + os->muxer_overhead, max_audio_bitrate); @@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final) av_strlcat(codec_str, audio_codec_str, sizeof(codec_str)); } get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); -ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, agroup, +ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate, + playlist_file, agroup, codec_str, NULL); } -avio_close(out); +dashenc_io_close(s, &c->m3u8_out, temp_filename); if (use_rename) if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0) return ret; -- 2.17.1 (Apple Git-112) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2] avformat/dashenc: Support HTTP Persistent for master.m3u8 as well
--- libavformat/dashenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 3f5f290e25..15b84a0f3b 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final) snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", filename_hls); set_http_options(&opts, c); -ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, NULL, &opts); +ret = dashenc_io_open(s, &c->m3u8_out, temp_filename, &opts); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); return ret; } av_dict_free(&opts); -ff_hls_write_playlist_version(out, 7); +ff_hls_write_playlist_version(c->m3u8_out, 7); for (i = 0; i < s->nb_streams; i++) { char playlist_file[64]; @@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final) if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) continue; get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); -ff_hls_write_audio_rendition(out, (char *)audio_group, +ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group, playlist_file, i, is_default); max_audio_bitrate = FFMAX(st->codecpar->bit_rate + os->muxer_overhead, max_audio_bitrate); @@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final) av_strlcat(codec_str, audio_codec_str, sizeof(codec_str)); } get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); -ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, agroup, +ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate, + playlist_file, agroup, codec_str, NULL); } -avio_close(out); +dashenc_io_close(s, &c->m3u8_out, temp_filename); if (use_rename) if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0) return ret; -- 2.17.1 (Apple Git-112) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/dashenc: Support HTTP Persistent for master.mu8 as well
--- libavformat/dashenc.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 3f5f290e25..15b84a0f3b 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -878,14 +878,14 @@ static int write_manifest(AVFormatContext *s, int final) snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", filename_hls); set_http_options(&opts, c); -ret = avio_open2(&out, temp_filename, AVIO_FLAG_WRITE, NULL, &opts); +ret = dashenc_io_open(s, &c->m3u8_out, temp_filename, &opts); if (ret < 0) { av_log(s, AV_LOG_ERROR, "Unable to open %s for writing\n", temp_filename); return ret; } av_dict_free(&opts); -ff_hls_write_playlist_version(out, 7); +ff_hls_write_playlist_version(c->m3u8_out, 7); for (i = 0; i < s->nb_streams; i++) { char playlist_file[64]; @@ -894,7 +894,7 @@ static int write_manifest(AVFormatContext *s, int final) if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) continue; get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); -ff_hls_write_audio_rendition(out, (char *)audio_group, +ff_hls_write_audio_rendition(c->m3u8_out, (char *)audio_group, playlist_file, i, is_default); max_audio_bitrate = FFMAX(st->codecpar->bit_rate + os->muxer_overhead, max_audio_bitrate); @@ -923,10 +923,11 @@ static int write_manifest(AVFormatContext *s, int final) av_strlcat(codec_str, audio_codec_str, sizeof(codec_str)); } get_hls_playlist_name(playlist_file, sizeof(playlist_file), NULL, i); -ff_hls_write_stream_info(st, out, stream_bitrate, playlist_file, agroup, +ff_hls_write_stream_info(st, c->m3u8_out, stream_bitrate, + playlist_file, agroup, codec_str, NULL); } -avio_close(out); +dashenc_io_close(s, &c->m3u8_out, temp_filename); if (use_rename) if ((ret = avpriv_io_move(temp_filename, filename_hls)) < 0) return ret; -- 2.17.1 (Apple Git-112) ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/dashenc: Dont ignore the codec tag from codec parameters
>On 10/10/18, 4:55 PM, "Jeyapal, Karthick" wrote: > >My git send-email is not working. Hence attaching the patch. Patch Pushed. > >Regards, >Karthick ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/h264_cavlc: Check mb_skip_run
On Fri, Oct 05, 2018 at 03:31:44AM +0200, Michael Niedermayer wrote: > Fixes: > 10300/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-6292205497483264 > Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type > 'int' > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/h264_cavlc.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] avcodec/ra144: Fix integer overflow in add_wav()
On Thu, Oct 11, 2018 at 01:45:29AM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: -2144033225 + -5208934 cannot be represented > in type 'int' > Fixes: > 10633/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-5679133791617024 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer > --- > libavcodec/ra144.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply patchset [...] -- 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 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/utils: Never store negative values in last_IP_duration
On Sat, Oct 13, 2018 at 03:13:10AM +0200, Michael Niedermayer wrote: > Fixes: integer overflow compute_pkt_fields() > Fixes: compute_pkt_usan > > Reported-by: Thomas Guilbert > Signed-off-by: Michael Niedermayer > --- > libavformat/utils.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "I am not trying to be anyone's saviour, I'm trying to think about the future and not be sad" - Elon Musk signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] avformat/utils: Fix integer overflow in discontinuity check
On Fri, Oct 12, 2018 at 03:40:20AM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 7738135736989908991 - -7954308516317364223 > cannot be represented in type 'long' > Fixes: find_stream_info_usan > > Reported-by: Thomas Guilbert > Signed-off-by: Michael Niedermayer > --- > libavformat/utils.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I have often repented speaking, but never of holding my tongue. -- Xenocrates signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avcodec/mpeg4videodec: Fix typo in sprite delta check
Fixes: Integer overflow Fixes: 10890/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5636062181851136 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mpeg4videodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index f435a520c8..233b8525ce 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -402,7 +402,7 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g llabs(sprite_offset[0][i] + sprite_delta[i][1] * (h+16LL)) >= INT_MAX || llabs(sprite_offset[0][i] + sprite_delta[i][0] * (w+16LL) + sprite_delta[i][1] * (h+16LL)) >= INT_MAX || llabs(sprite_delta[i][0] * (w+16LL)) >= INT_MAX || -llabs(sprite_delta[i][1] * (w+16LL)) >= INT_MAX || +llabs(sprite_delta[i][1] * (h+16LL)) >= INT_MAX || llabs(sd[0]) >= INT_MAX || llabs(sd[1]) >= INT_MAX || llabs(sprite_offset[0][i] + sd[0] * (w+16LL)) >= INT_MAX || -- 2.19.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2] web/documentation: add new book about FFmpeg in China
Signed-off-by: Steven Liu --- src/documentation | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/documentation b/src/documentation index debca83..69b02f2 100644 --- a/src/documentation +++ b/src/documentation @@ -130,6 +130,8 @@ http://ffmpeg.tv";>FFmpeg Basics by Frantisek Korbel, describes various FFmpeg features and common tasks. +http://book.chinaffmpeg.com";>FFmpeg Beginner's handbook Chinese Version by Steven Liu, +describes FFmpeg common use method in Chinese, from command line to API usage. -- 2.15.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Support 2:3 subsampling
2018-10-17 22:12 GMT+02:00, Michael Niedermayer : > On Wed, Oct 17, 2018 at 09:01:30PM +0200, Carl Eugen Hoyos wrote: >> 2018-10-17 17:51 GMT+02:00, Michael Niedermayer : >> > On Wed, Oct 17, 2018 at 12:22:51AM +0200, Carl Eugen Hoyos wrote: >> >> Hi! >> >> >> >> Attached patch allows decoding the sample from ticket #7495. >> >> >> >> Please review, Carl Eugen >> > >> >> mjpegdec.c | 17 ++--- >> >> 1 file changed, 14 insertions(+), 3 deletions(-) >> >> 8f0d03a533b42c35f2bd8d5bdae4dabd24b18f4c >> >> 0001-lavc-mjpegdec-Support-2-3-subsampling.patch >> >> From 0e9d2ec4e0cba36ba03a6b7470a707c0a3f88b8c Mon Sep 17 00:00:00 2001 >> >> From: Carl Eugen Hoyos >> >> Date: Wed, 17 Oct 2018 00:21:26 +0200 >> >> Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. >> >> >> >> Fixes ticket #7495. >> >> --- >> >> libavcodec/mjpegdec.c | 17 ++--- >> >> 1 file changed, 14 insertions(+), 3 deletions(-) >> > >> > breaks >> > make -j12 fate-tdsc >> >> New patch attached, please review. >> >> Thank you, Carl Eugen > >> mjpegdec.c | 11 --- >> 1 file changed, 8 insertions(+), 3 deletions(-) >> 45ffa2918d1236d99637c96f84803a646e757cab >> 0001-lavc-mjpegdec-Support-2-3-subsampling.patch >> From 2a8917ad5f82184c10e41be776bf3d138b676a85 Mon Sep 17 00:00:00 2001 >> From: Carl Eugen Hoyos >> Date: Wed, 17 Oct 2018 21:00:37 +0200 >> Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. >> >> Fixes ticket #7495. >> --- >> libavcodec/mjpegdec.c | 11 --- >> 1 file changed, 8 insertions(+), 3 deletions(-) >> >> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c >> index 35ee10d..cfc5de8 100644 >> --- a/libavcodec/mjpegdec.c >> +++ b/libavcodec/mjpegdec.c >> @@ -594,6 +594,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) >> s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : >> AVCOL_RANGE_JPEG; >> break; >> case 0x2200: >> +case 0x2300: >> case 0x4200: >> case 0x2400: >> if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? >> AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P; >> @@ -607,6 +608,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) >> if (s->bits > 8) >> goto unk_pixfmt; >> s->upscale_v[1] = s->upscale_v[2] = 1; >> +} else if (pix_fmt_id == 0x2300) { >> +if (s->bits > 8) >> +goto unk_pixfmt; >> +s->upscale_v[1] = s->upscale_v[2] = 2; >> } >> break; >> case 0x4100: > > there remains code which does: > if (s->upscale_v[p]) > h = (h+1)>>1; > > didnt deeply check but doesnt this need an update or a assert upscale_v == 1 > ? I updated the condition. > no more comments from me about this patch Patch applied. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH V2] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs
2018-10-17 18:41 GMT+02:00, Guo, Yejun : > +short* outg = (short*)out->data[0]; > +short* outb = (short*)out->data[1]; > +short* outr = (short*)out->data[2]; I believe this should use "int16_t", there is no guarantee that short is smaller than 128 bit. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH]lavf/dump: Fix a typo: comentary -> commentary
Hi! Is there a reason to keep the wrong spelling? Please comment, Carl Eugen From 80a6b2f5d4a61e8a1fd198adfdd059c2d6bce1fa Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Thu, 18 Oct 2018 00:13:38 +0200 Subject: [PATCH] lavf/dump: Fix a typo: comentary -> commentary. Fixes ticket #7499. --- libavformat/dump.c|2 +- libavformat/version.h |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dump.c b/libavformat/dump.c index bc0f401..bb8c72f 100644 --- a/libavformat/dump.c +++ b/libavformat/dump.c @@ -293,7 +293,7 @@ static void dump_audioservicetype(void *ctx, AVPacketSideData *sd) av_log(ctx, AV_LOG_INFO, "dialogue"); break; case AV_AUDIO_SERVICE_TYPE_COMMENTARY: -av_log(ctx, AV_LOG_INFO, "comentary"); +av_log(ctx, AV_LOG_INFO, "commentary"); break; case AV_AUDIO_SERVICE_TYPE_EMERGENCY: av_log(ctx, AV_LOG_INFO, "emergency"); diff --git a/libavformat/version.h b/libavformat/version.h index e4a6907..e2d0cfd 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -33,7 +33,7 @@ // Also please add any ticket numbers that you believe might be affected here #define LIBAVFORMAT_VERSION_MAJOR 58 #define LIBAVFORMAT_VERSION_MINOR 19 -#define LIBAVFORMAT_VERSION_MICRO 100 +#define LIBAVFORMAT_VERSION_MICRO 101 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ -- 1.7.10.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Support 2:3 subsampling
On Wed, Oct 17, 2018 at 09:01:30PM +0200, Carl Eugen Hoyos wrote: > 2018-10-17 17:51 GMT+02:00, Michael Niedermayer : > > On Wed, Oct 17, 2018 at 12:22:51AM +0200, Carl Eugen Hoyos wrote: > >> Hi! > >> > >> Attached patch allows decoding the sample from ticket #7495. > >> > >> Please review, Carl Eugen > > > >> mjpegdec.c | 17 ++--- > >> 1 file changed, 14 insertions(+), 3 deletions(-) > >> 8f0d03a533b42c35f2bd8d5bdae4dabd24b18f4c > >> 0001-lavc-mjpegdec-Support-2-3-subsampling.patch > >> From 0e9d2ec4e0cba36ba03a6b7470a707c0a3f88b8c Mon Sep 17 00:00:00 2001 > >> From: Carl Eugen Hoyos > >> Date: Wed, 17 Oct 2018 00:21:26 +0200 > >> Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. > >> > >> Fixes ticket #7495. > >> --- > >> libavcodec/mjpegdec.c | 17 ++--- > >> 1 file changed, 14 insertions(+), 3 deletions(-) > > > > breaks > > make -j12 fate-tdsc > > New patch attached, please review. > > Thank you, Carl Eugen > mjpegdec.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) > 45ffa2918d1236d99637c96f84803a646e757cab > 0001-lavc-mjpegdec-Support-2-3-subsampling.patch > From 2a8917ad5f82184c10e41be776bf3d138b676a85 Mon Sep 17 00:00:00 2001 > From: Carl Eugen Hoyos > Date: Wed, 17 Oct 2018 21:00:37 +0200 > Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. > > Fixes ticket #7495. > --- > libavcodec/mjpegdec.c | 11 --- > 1 file changed, 8 insertions(+), 3 deletions(-) > > diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c > index 35ee10d..cfc5de8 100644 > --- a/libavcodec/mjpegdec.c > +++ b/libavcodec/mjpegdec.c > @@ -594,6 +594,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) > s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : > AVCOL_RANGE_JPEG; > break; > case 0x2200: > +case 0x2300: > case 0x4200: > case 0x2400: > if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? > AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P; > @@ -607,6 +608,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) > if (s->bits > 8) > goto unk_pixfmt; > s->upscale_v[1] = s->upscale_v[2] = 1; > +} else if (pix_fmt_id == 0x2300) { > +if (s->bits > 8) > +goto unk_pixfmt; > +s->upscale_v[1] = s->upscale_v[2] = 2; > } > break; > case 0x4100: there remains code which does: if (s->upscale_v[p]) h = (h+1)>>1; didnt deeply check but doesnt this need an update or a assert upscale_v == 1 ? no more comments from me about this patch thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
Il 17/10/2018 21:48, Hendrik Leppkes ha scritto: On Wed, Oct 17, 2018 at 9:45 PM Moritz Barsnick wrote: On Wed, Oct 17, 2018 at 21:40:58 +0200, Giulio Benetti wrote: PS: do I need to remove your e-mail on TO field every time I reply to you? It's not a problem, only to know. This mailing list uses a Reply-To: header, pointing at the list address. Your Thuderbird should honor that automatically (or even properly support lists). I wonder why it doesn't, it may be misconfigured. Basically, stop using "Reply to All", and trust the list. It confuses my client as well when I get CC'ed or To'ed in ML responses, because then my client wants to send a personal response. Yes, I think I've understood now. I will use "Answer to List" instead of "Reply to All". Sorry for the inconvenience to Everybody. Thanks Best regards -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
Il 17/10/2018 21:45, Moritz Barsnick ha scritto: On Wed, Oct 17, 2018 at 21:40:58 +0200, Giulio Benetti wrote: PS: do I need to remove your e-mail on TO field every time I reply to you? It's not a problem, only to know. This mailing list uses a Reply-To: header, pointing at the list address. Your Thuderbird should honor that automatically (or even properly support lists). I wonder why it doesn't, it may be misconfigured. Thanks for pointing me, I only need to "Answer to List". So it uses to do its job as I understand. Never used something like this in: Buildroot Linux UBoot This is why I've replied to all. Best regards -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
On Wed, Oct 17, 2018 at 9:45 PM Moritz Barsnick wrote: > > On Wed, Oct 17, 2018 at 21:40:58 +0200, Giulio Benetti wrote: > > PS: do I need to remove your e-mail on TO field every time I reply to > > you? It's not a problem, only to know. > > This mailing list uses a Reply-To: header, pointing at the list > address. Your Thuderbird should honor that automatically (or even > properly support lists). I wonder why it doesn't, it may be > misconfigured. > Basically, stop using "Reply to All", and trust the list. It confuses my client as well when I get CC'ed or To'ed in ML responses, because then my client wants to send a personal response. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
On Wed, Oct 17, 2018 at 21:40:58 +0200, Giulio Benetti wrote: > PS: do I need to remove your e-mail on TO field every time I reply to > you? It's not a problem, only to know. This mailing list uses a Reply-To: header, pointing at the list address. Your Thuderbird should honor that automatically (or even properly support lists). I wonder why it doesn't, it may be misconfigured. Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
Il 17/10/2018 21:23, Carl Eugen Hoyos ha scritto: 2018-10-17 21:20 GMT+02:00, Giulio Benetti : Il 17/10/2018 18:51, Carl Eugen Hoyos ha scritto: I just meant that it was a mistake that above patch was backported although it neither fixes a security issue nor a regression. Ok, I understand, so please discard this patch. I was under the impression that as long as there is no release for 3.4.5, your patch would make sense or do I misunderstand? That makes sense for correcteness. I mean, the previous I've submitted didn't take care about the difference of Libs: and Libs.private: in libavutil.pc This takes care. So another chance would be that I produce a patch to improve that. But then I don't know if Buildroot would accept 2 patches to correct 1 bug. On Buildroot we will use a not upstreamed patch then. Sorry if I was misleading: It is of course even worse not to upstream patches, Sure it is! I was only mentioning backports of random patches in general. Ok, so how can I proceed? PS: do I need to remove your e-mail on TO field every time I reply to you? It's not a problem, only to know. Thanks Best regards -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
2018-10-17 21:20 GMT+02:00, Giulio Benetti : > Il 17/10/2018 18:51, Carl Eugen Hoyos ha scritto: >> I just meant that it was a mistake that above patch was backported >> although it neither fixes a security issue nor a regression. > > Ok, I understand, so please discard this patch. I was under the impression that as long as there is no release for 3.4.5, your patch would make sense or do I misunderstand? > On Buildroot we will use a not upstreamed patch then. Sorry if I was misleading: It is of course even worse not to upstream patches, I was only mentioning backports of random patches in general. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
Il 17/10/2018 18:51, Carl Eugen Hoyos ha scritto: I just meant that it was a mistake that above patch was backported although it neither fixes a security issue nor a regression. Ok, I understand, so please discard this patch. On Buildroot we will use a not upstreamed patch then. Please don't add me in CC or TO, this confuses me and my email client;-) Ok, no problem. Thank you Best regards -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Support 2:3 subsampling
2018-10-17 17:51 GMT+02:00, Michael Niedermayer : > On Wed, Oct 17, 2018 at 12:22:51AM +0200, Carl Eugen Hoyos wrote: >> Hi! >> >> Attached patch allows decoding the sample from ticket #7495. >> >> Please review, Carl Eugen > >> mjpegdec.c | 17 ++--- >> 1 file changed, 14 insertions(+), 3 deletions(-) >> 8f0d03a533b42c35f2bd8d5bdae4dabd24b18f4c >> 0001-lavc-mjpegdec-Support-2-3-subsampling.patch >> From 0e9d2ec4e0cba36ba03a6b7470a707c0a3f88b8c Mon Sep 17 00:00:00 2001 >> From: Carl Eugen Hoyos >> Date: Wed, 17 Oct 2018 00:21:26 +0200 >> Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. >> >> Fixes ticket #7495. >> --- >> libavcodec/mjpegdec.c | 17 ++--- >> 1 file changed, 14 insertions(+), 3 deletions(-) > > breaks > make -j12 fate-tdsc New patch attached, please review. Thank you, Carl Eugen From 2a8917ad5f82184c10e41be776bf3d138b676a85 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 17 Oct 2018 21:00:37 +0200 Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. Fixes ticket #7495. --- libavcodec/mjpegdec.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 35ee10d..cfc5de8 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -594,6 +594,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; case 0x2200: +case 0x2300: case 0x4200: case 0x2400: if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P; @@ -607,6 +608,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) if (s->bits > 8) goto unk_pixfmt; s->upscale_v[1] = s->upscale_v[2] = 1; +} else if (pix_fmt_id == 0x2300) { +if (s->bits > 8) +goto unk_pixfmt; +s->upscale_v[1] = s->upscale_v[2] = 2; } break; case 0x4100: @@ -2592,9 +2597,9 @@ the_end: } dst = &((uint8_t *)s->picture_ptr->data[p])[(h - 1) * s->linesize[p]]; for (i = h - 1; i; i--) { -uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]]; -uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]]; -if (src1 == src2 || i == h - 1) { +uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; +uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) * s->upscale_v[p] / (s->upscale_v[p] + 1) * s->linesize[p]]; +if (s->upscale_v[p] != 2 && (src1 == src2 || i == h - 1)) { memcpy(dst, src1, w); } else { for (index = 0; index < w; index++) -- 1.7.10.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxfenc: Remove a write-only variable
2018-10-17 20:28 GMT+02:00, Baptiste Coudurier : > Hi Carl, > > On Tue, Oct 16, 2018 at 3:00 PM Carl Eugen Hoyos wrote: > >> 2018-10-13 13:12 GMT+02:00, Carl Eugen Hoyos : >> >> > Attached patch fixes a warning, I wonder if the value is actually >> > supposed to use somewhere... >> >> Ping. >> > > LGTM. Patch applied. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avformat/xwma: fix WMAv2 with incorrect bit rate
On 10/4/18, Paul B Mahol wrote: > On 10/3/18, bananaman...@gmail.com wrote: >> From: bnnm >> >> Fixes trac issue #7215 >> >> Output for files created by xWMAEncode and various videogames is correct >> now. >> >> 1ch 32000hz files are still broken, would need fixes in WMA decoder. >> >> Signed-off-by: bnnm >> --- >> libavformat/xwma.c | 38 +++--- >> 1 file changed, 31 insertions(+), 7 deletions(-) >> > > lgtm > applied ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavf/mxfenc: Remove a write-only variable
Hi Carl, On Tue, Oct 16, 2018 at 3:00 PM Carl Eugen Hoyos wrote: > 2018-10-13 13:12 GMT+02:00, Carl Eugen Hoyos : > > > Attached patch fixes a warning, I wonder if the value is actually > > supposed to use somewhere... > > Ping. > LGTM. -- Baptiste Coudurier ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH V2] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs
Hi, How hard is it to support the native backend? which operations are missing or any other limitations? Em qua, 17 de out de 2018 às 05:47, Guo, Yejun escreveu: > > see the algorithm's paper and code below. > > the filter's parameter looks like: > sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmt=gbrp10le > > The input of the deep CNN model is RGB24 while the output is float > for each color channel. This is the filter's default behavior to > output format with gbrpf32le. And gbrp10le is also supported as the > output, so we can see the rendering result in a player, as a reference. > > To generate the model file, we need modify the original script a little. > - set name='y' for y_final within script at > https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py > - add the following code to the script at > https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict.py > > graph = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, > ["y"]) > tf.train.write_graph(graph, '.', 'graph.pb', as_text=False) > > The filter only works when tensorflow C api is supported in the system, > native backend is not supported since there are some different types of > layers in the deep CNN model, besides CONV and DEPTH_TO_SPACE. > > https://arxiv.org/pdf/1710.07480.pdf: > author = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy > and Mantiuk, Rafał and Unger, Jonas", > title= "HDR image reconstruction from a single exposure using deep > CNNs", > journal = "ACM Transactions on Graphics (TOG)", > number = "6", > volume = "36", > articleno= "178", > year = "2017" > > https://github.com/gabrieleilertsen/hdrcnn > > btw, as a whole solution, metadata should also be generated from > the sdr video, so to be encoded as a HDR video. Not supported yet. > This patch just focuses on this paper. > > v2: use AV_OPT_TYPE_PIXEL_FMT for filter option > remove some unnecessary code > Use in->linesize[0] and FFMAX/FFMIN > remove flag AVFILTER_FLAG_SLICE_THREADS > add av_log message when error > > Signed-off-by: Guo, Yejun > --- > libavfilter/Makefile | 1 + > libavfilter/allfilters.c | 1 + > libavfilter/vf_sdr2hdr.c | 266 > +++ > 3 files changed, 268 insertions(+) > create mode 100644 libavfilter/vf_sdr2hdr.c > > diff --git a/libavfilter/Makefile b/libavfilter/Makefile > index 62cc2f5..88e7da6 100644 > --- a/libavfilter/Makefile > +++ b/libavfilter/Makefile > @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER) += > vf_convolution_opencl.o opencl.o > OBJS-$(CONFIG_SPLIT_FILTER) += split.o > OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o > OBJS-$(CONFIG_SR_FILTER) += vf_sr.o > +OBJS-$(CONFIG_SDR2HDR_FILTER)+= vf_sdr2hdr.o > OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o framesync.o > OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o > OBJS-$(CONFIG_STREAMSELECT_FILTER) += f_streamselect.o framesync.o > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c > index 5e72803..1645c0f 100644 > --- a/libavfilter/allfilters.c > +++ b/libavfilter/allfilters.c > @@ -319,6 +319,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_sdr2hdr; > extern AVFilter ff_vf_select; > extern AVFilter ff_vf_selectivecolor; > extern AVFilter ff_vf_sendcmd; > diff --git a/libavfilter/vf_sdr2hdr.c b/libavfilter/vf_sdr2hdr.c > new file mode 100644 > index 000..fa61bfa > --- /dev/null > +++ b/libavfilter/vf_sdr2hdr.c > @@ -0,0 +1,266 @@ > +/* > + * Copyright (c) 2018 Guo Yejun > + * > + * 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 > + * Filter implementing HDR image reconstruction from a single exposure using > deep CNNs. > + * https://arxiv.org/pdf/1710.07480.pdf > + */ > + > +#include "avfilter.h" > +#include "formats.h" > +#include "internal.h" > +#include "libavutil/opt.h" > +#include "libavutil/qsort.h" > +#include "libavformat/avio.h" > +#include "libswscale/s
Re: [FFmpeg-devel] [PATCH] web/documentation: add new book about FFmpeg in China
On Wed, 17 Oct 2018, 04:28 Steven Liu, wrote: > Signed-off-by: Steven Liu > --- > src/documentation | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/documentation b/src/documentation > index e3bbf4c..7569e86 100644 > --- a/src/documentation > +++ b/src/documentation > @@ -131,6 +131,8 @@ > > http://ffmpeg.tv";>FFmpeg Basics by Frantisek > Korbel, >describes various FFmpeg features and common tasks. > +http://book.chinaffmpeg.com";>FFmpeg Beginner's > handbook Chinese Version by Steven Liu, > + describes FFmpeg common use method in China, from command line > to API usage. > Should this be Chinese instead of China? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] download: change OS X to macOS
2018-10-16 4:11 GMT+02:00, Helmut K. C. Tessarek : > --- > src/download | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/download b/src/download > index 0bda5a0..40f4706 100644 > --- a/src/download > +++ b/src/download > @@ -95,7 +95,7 @@ > > > href="https://evermeet.cx/ffmpeg/";> > -Static builds for OS X Intel 64-bit > +Static builds for macOS 64-bit Patch applied. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
2018-10-17 15:54 GMT+02:00, Giulio Benetti : > Re-add everybody in Cc > > Il 17/10/2018 15:08, Carl Eugen Hoyos ha scritto: >> 2018-10-17 14:02 GMT+02:00, Giulio Benetti >> : >>> Commit c50dc77ac708e98d02da7c422a6b9cbf9f565aa5 has a pitfall, it >>> appends -ldrm to "Libs:" instead of "Libs.private:" in avutil.pc. >> >> Assuming this was not a regression before: >> This should not have been backported, it's bad enough to maintain >> security issues and regressions, if a distribution wants this, they >> should take of it themselves. > > So you mean I should send a patch to improve this instead of reverting > the previous patch and adding a new one including corrected points? I just meant that it was a mistake that above patch was backported although it neither fixes a security issue nor a regression. Please don't add me in CC or TO, this confuses me and my email client;-) Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Support 2:3 subsampling
On Wed, Oct 17, 2018 at 12:22:51AM +0200, Carl Eugen Hoyos wrote: > Hi! > > Attached patch allows decoding the sample from ticket #7495. > > Please review, Carl Eugen > mjpegdec.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > 8f0d03a533b42c35f2bd8d5bdae4dabd24b18f4c > 0001-lavc-mjpegdec-Support-2-3-subsampling.patch > From 0e9d2ec4e0cba36ba03a6b7470a707c0a3f88b8c Mon Sep 17 00:00:00 2001 > From: Carl Eugen Hoyos > Date: Wed, 17 Oct 2018 00:21:26 +0200 > Subject: [PATCH] lavc/mjpegdec: Support 2:3 subsampling. > > Fixes ticket #7495. > --- > libavcodec/mjpegdec.c | 17 ++--- > 1 file changed, 14 insertions(+), 3 deletions(-) breaks make -j12 fate-tdsc TESTtdsc --- ./tests/ref/fate/tdsc 2018-10-13 04:06:44.053253996 +0200 +++ tests/data/fate/tdsc2018-10-17 17:49:41.575647118 +0200 @@ -3,44 +3,44 @@ #codec_id 0: rawvideo #dimensions 0: 1440x900 #sar 0: 0/1 -0, 0, 0,1, 3888000, 0x9c498657 -0, 7, 7,1, 3888000, 0x72a2ae22 -0, 8, 8,1, 3888000, 0x72a2ae22 -0, 10, 10,1, 3888000, 0x72a2ae22 -0, 16, 16,1, 3888000, 0x72a2ae22 ... [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you think the mosad wants you dead since a long time then you are either wrong or dead since a long time. signature.asc Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
Re-add everybody in Cc Il 17/10/2018 15:08, Carl Eugen Hoyos ha scritto: 2018-10-17 14:02 GMT+02:00, Giulio Benetti : Commit c50dc77ac708e98d02da7c422a6b9cbf9f565aa5 has a pitfall, it appends -ldrm to "Libs:" instead of "Libs.private:" in avutil.pc. Assuming this was not a regression before: This should not have been backported, it's bad enough to maintain security issues and regressions, if a distribution wants this, they should take of it themselves. So you mean I should send a patch to improve this instead of reverting the previous patch and adding a new one including corrected points? If the new patch gets committed and backported, please do it before 3.4.5 gets released. Sure I will if I understand how to work this out. Sorry but I'm pretty new to this workflow and I'm discovering step-by-step how to make it work correctly. Thank you and Best regards -- Giulio Benetti CTO MICRONOVA SRL Sede: Via A. Niedda 3 - 35010 Vigonza (PD) Tel. 049/8931563 - Fax 049/8931346 Cod.Fiscale - P.IVA 02663420285 Capitale Sociale € 26.000 i.v. Iscritta al Reg. Imprese di Padova N. 02663420285 Numero R.E.A. 258642 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3.4 2/2] configure: add LIBDRM to Libs.private introducing privatelibs_avutil
When static linking programs using ffmpeg libraries, if linking against libavutil, -ldrm is listed before -lavutil. This leads to linking failure due to undefined reference of drmGetVersion() and drmFreeVersion(). This is because when pkg-config creates libavutil.pc it doesn't append -ldrm to Libs.private:. - Create LIBDRM and add -ldrm to it in case libdrm is enabled. - Add privatelibs_avutil variable for explicit private libraries to be appended to Libs.private: in pkgconfig_generate.sh. - Add $LIBDRM to privatelibs_avutil. Signed-off-by: Giulio Benetti --- configure | 3 ++- ffbuild/pkgconfig_generate.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 7377046d0a..0996d8a85d 100755 --- a/configure +++ b/configure @@ -5919,7 +5919,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new -enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h drmGetVersion +enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h drmGetVersion && LIBDRM="-ldrm" enabled libfdk_aac&& { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && warn "using libfdk without pkg-config"; } } @@ -7097,6 +7097,7 @@ LIBPREF=${LIBPREF} LIBSUF=${LIBSUF} extralibs_avutil="$LIBRT $LIBM" +privatelibs_avutil="$LIBDRM" extralibs_avcodec="$extralibs" extralibs_avformat="$extralibs" extralibs_avdevice="$extralibs" diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh index e5de6716d2..b86486a107 100755 --- a/ffbuild/pkgconfig_generate.sh +++ b/ffbuild/pkgconfig_generate.sh @@ -13,6 +13,7 @@ name=lib${shortname} fullname=${name}${build_suffix} comment=$2 libs=$(eval echo \$extralibs_${shortname}) +privatelibs=$(eval echo \$privatelibs_${shortname}) deps=$(eval echo \$${shortname}_deps) for dep in $deps; do @@ -39,7 +40,7 @@ Requires: $($shared || echo $requires) Requires.private: $($shared && echo $requires) Conflicts: Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs) -Libs.private: $($shared && echo $libs) +Libs.private: $($shared && echo $libs) ${privatelibs} Cflags: -I\${includedir} EOF -- 2.17.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3.4 0/2] configure: fix LIBDRM handling for static linking
Commit c50dc77ac708e98d02da7c422a6b9cbf9f565aa5 has a pitfall, it appends -ldrm to "Libs:" instead of "Libs.private:" in avutil.pc. This leads to append -ldrm to link library list tail in shared build too and this doesn't make sense. So revert the commit above and add a patch to handle explicit private libraries introducing privatelibs_avutil and handle it in pkgconfig_generate.sh. Giulio Benetti (2): Revert "configure: add LIBDRM to extralibs_avutil" configure: add LIBDRM to Libs.private introducing privatelibs_avutil configure | 3 ++- ffbuild/pkgconfig_generate.sh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.17.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3.4 1/2] Revert "configure: add LIBDRM to extralibs_avutil"
This reverts commit c50dc77ac708e98d02da7c422a6b9cbf9f565aa5. The offending commit appends -ldrm to "Libs:" instead of "Libs.private:" in libavutil.pc. This makes no sense, since -ldrm must be listed in linking libraries list only when static linking. Signed-off-by: Giulio Benetti --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 9fe7760822..7377046d0a 100755 --- a/configure +++ b/configure @@ -5919,7 +5919,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new -enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h drmGetVersion && LIBDRM="-ldrm" +enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h drmGetVersion enabled libfdk_aac&& { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && warn "using libfdk without pkg-config"; } } @@ -7096,7 +7096,7 @@ source_path=${source_path} LIBPREF=${LIBPREF} LIBSUF=${LIBSUF} -extralibs_avutil="$LIBRT $LIBDRM $LIBM" +extralibs_avutil="$LIBRT $LIBM" extralibs_avcodec="$extralibs" extralibs_avformat="$extralibs" extralibs_avdevice="$extralibs" -- 2.17.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH V2] libavcodec/vp8dec: fix the multi-thread HWAccel decode error
Fix the issue: https://github.com/intel/media-driver/issues/317 the root cause is update_dimensions call get_pixel_format will trigger the hwaccel_uninit/hwaccel_init , in current context, there are 3 situations in the update_dimensions(): 1. First time calling. No matter single thread or multithread, get_pixel_format() should be called after dimensions were set; 2. Dimention changed at the runtime. Dimention need to be updated when macroblocks_base is already allocated, get_pixel_format() should be called to recreate new frames according to updated dimention; 3. Multithread first time calling. After decoder init, the other threads will call update_dimensions() at first time to allocate macroblocks_base and set dimensions. But get_pixel_format() is shouldn't be called due to low level frames and context are already created. In this fix, we only call update_dimensions as need. Signed-off-by: Wang, Shaofei Reviewed-by: Jun, Zhao Reviewed-by: Haihao Xiang --- libavcodec/vp8.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index a06692c..c205868 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -187,7 +187,7 @@ static av_always_inline int update_dimensions(VP8Context *s, int width, int height, int is_vp7) { AVCodecContext *avctx = s->avctx; -int i, ret; +int i, ret, dim_reset = 0; if (width != s->avctx->width || ((width+15)/16 != s->mb_width || (height+15)/16 != s->mb_height) && s->macroblocks_base || height != s->avctx->height) { @@ -196,9 +196,12 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7) ret = ff_set_dimensions(s->avctx, width, height); if (ret < 0) return ret; + +dim_reset = (s->macroblocks_base != NULL); } -if (!s->actually_webp && !is_vp7) { +if ((s->pix_fmt == AV_PIX_FMT_NONE || dim_reset) && + !s->actually_webp && !is_vp7) { s->pix_fmt = get_pixel_format(s); if (s->pix_fmt < 0) return AVERROR(EINVAL); -- 1.7.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] download: change OS X to macOS
On Tue, Oct 16, 2018, at 4:33 PM, Helmut K. C. Tessarek wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > I've changed the commit message as James suggested. > > Do I have to do anything else to get someone to commit it? I can push this in about a week unless someone else does first. Ping if I forget after 25 Oct. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] ffmpeg: release the last_frame before the decoders are closed
On Wed, Oct 17, 2018 at 10:14 AM Steve Lhomme wrote: > > On 17/10/2018 09:43, Steve Lhomme wrote: > > On 16/10/2018 18:04, James Almer wrote: > >> On 10/16/2018 12:34 PM, Steve Lhomme wrote: > >>> On 16/10/2018 16:59, Hendrik Leppkes wrote: > On Tue, Oct 16, 2018 at 4:02 PM James Almer wrote: > > On 10/16/2018 9:16 AM, Steve Lhomme wrote: > >> If the decoder provides its own buffers it might not be able to > >> release its > >> buffers once it has been closed. (this is the case with dav1d). > >> --- > >>fftools/ffmpeg.c | 1 + > >>1 file changed, 1 insertion(+) > >> > >> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c > >> index da4259a9a8..faf62475a2 100644 > >> --- a/fftools/ffmpeg.c > >> +++ b/fftools/ffmpeg.c > >> @@ -4738,6 +4738,7 @@ static int transcode(void) > >>if (ost->encoding_needed) { > >> av_freep(&ost->enc_ctx->stats_in); > >>} > >> +av_frame_unref(ost->last_frame); > >>total_packets_written += ost->packets_written; > >>} > > I'm not against this change, but this issue should be solved within > > dav1d as well. Either the caller fully owns the picture returned by > > dav1d, or it doesn't. "Partially owns it while some other context is > > still valid" is not really acceptable. > >>> You can't ask any library to own content even after you have closed it > >>> (and potentially unloaded the DLL). > >> As i said in dav1d's merge request, with libavcodec i can open an > >> encoder, generate an AVPacket, close the encoder, open a bitstream > >> filter, filter the packet i got from the encoder, close the bitstream > >> filter, and still fully own the packet without having in it any dangling > >> pointer to some callback stored in a long dead context. Same thing with > >> AVFrames. > > > > It generally works because it's usually used statically and with no > > external decoder, loaded dynamically. > > > >> This patch prevents ffmpeg.c closing the decoder (and thus the > >> Dav1dContext) before a reference to one AVFrame, owned by ffmpeg.c and > >> supposedly standalone, was freed. That's ok, but ffmpeg.c is just one > >> libavcodec user, and we have no control whatsoever of what other > >> libavcodec users will do with a returned AVFrame from > >> avcodec_receive_frame(). > >> And as Hendrik said, they are guaranteed to remain valid regardless of > >> the component they came out of, so this is not acceptable. > > > > I'd be curious to see how it works with DXVA2/D3D11VA where a DLL > > needs to be loaded and the buffers come for that DLL. If last_frame > > holds a DXVA2/D3D11 texture and tries to free it after the DLL has > > been unloaded it shouldn't work well. > > I had a quick look. It turns out that the DLLs are loaded but never > unloaded. So of course it will never execute code in unloaded DLLs. > Unloading DLLs, at least system DLLs on Windows, is mostly pointless anyway. For dav1d, it would be linked by the linker to avcodec, and thus you wouldn't unload it unless you unload avcodec, which you really shouldn't do unless you destroyed all objects from it anyway. Basically, DLL unloading is not really a factor to worry about much. - Hendrik ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH V2] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs
see the algorithm's paper and code below. the filter's parameter looks like: sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmt=gbrp10le The input of the deep CNN model is RGB24 while the output is float for each color channel. This is the filter's default behavior to output format with gbrpf32le. And gbrp10le is also supported as the output, so we can see the rendering result in a player, as a reference. To generate the model file, we need modify the original script a little. - set name='y' for y_final within script at https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py - add the following code to the script at https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict.py graph = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ["y"]) tf.train.write_graph(graph, '.', 'graph.pb', as_text=False) The filter only works when tensorflow C api is supported in the system, native backend is not supported since there are some different types of layers in the deep CNN model, besides CONV and DEPTH_TO_SPACE. https://arxiv.org/pdf/1710.07480.pdf: author = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy and Mantiuk, Rafał and Unger, Jonas", title= "HDR image reconstruction from a single exposure using deep CNNs", journal = "ACM Transactions on Graphics (TOG)", number = "6", volume = "36", articleno= "178", year = "2017" https://github.com/gabrieleilertsen/hdrcnn btw, as a whole solution, metadata should also be generated from the sdr video, so to be encoded as a HDR video. Not supported yet. This patch just focuses on this paper. v2: use AV_OPT_TYPE_PIXEL_FMT for filter option remove some unnecessary code Use in->linesize[0] and FFMAX/FFMIN remove flag AVFILTER_FLAG_SLICE_THREADS add av_log message when error Signed-off-by: Guo, Yejun --- libavfilter/Makefile | 1 + libavfilter/allfilters.c | 1 + libavfilter/vf_sdr2hdr.c | 266 +++ 3 files changed, 268 insertions(+) create mode 100644 libavfilter/vf_sdr2hdr.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 62cc2f5..88e7da6 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER) += vf_convolution_opencl.o opencl.o OBJS-$(CONFIG_SPLIT_FILTER) += split.o OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o OBJS-$(CONFIG_SR_FILTER) += vf_sr.o +OBJS-$(CONFIG_SDR2HDR_FILTER)+= vf_sdr2hdr.o OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o framesync.o OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o OBJS-$(CONFIG_STREAMSELECT_FILTER) += f_streamselect.o framesync.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 5e72803..1645c0f 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -319,6 +319,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_sdr2hdr; extern AVFilter ff_vf_select; extern AVFilter ff_vf_selectivecolor; extern AVFilter ff_vf_sendcmd; diff --git a/libavfilter/vf_sdr2hdr.c b/libavfilter/vf_sdr2hdr.c new file mode 100644 index 000..fa61bfa --- /dev/null +++ b/libavfilter/vf_sdr2hdr.c @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2018 Guo Yejun + * + * 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 + * Filter implementing HDR image reconstruction from a single exposure using deep CNNs. + * https://arxiv.org/pdf/1710.07480.pdf + */ + +#include "avfilter.h" +#include "formats.h" +#include "internal.h" +#include "libavutil/opt.h" +#include "libavutil/qsort.h" +#include "libavformat/avio.h" +#include "libswscale/swscale.h" +#include "dnn_interface.h" +#include + +typedef struct SDR2HDRContext { +const AVClass *class; + +char* model_filename; +enum AVPixelFormat out_fmt; +DNNModule* dnn_module; +DNNModel* model; +DNNData input, output; +} SDR2HDRContext; + +#define OFFSET(x) offsetof(SDR2HDRContext, x) +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM +static const
Re: [FFmpeg-devel] [PATCH] ffmpeg: release the last_frame before the decoders are closed
On 17/10/2018 09:43, Steve Lhomme wrote: On 16/10/2018 18:04, James Almer wrote: On 10/16/2018 12:34 PM, Steve Lhomme wrote: On 16/10/2018 16:59, Hendrik Leppkes wrote: On Tue, Oct 16, 2018 at 4:02 PM James Almer wrote: On 10/16/2018 9:16 AM, Steve Lhomme wrote: If the decoder provides its own buffers it might not be able to release its buffers once it has been closed. (this is the case with dav1d). --- fftools/ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index da4259a9a8..faf62475a2 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -4738,6 +4738,7 @@ static int transcode(void) if (ost->encoding_needed) { av_freep(&ost->enc_ctx->stats_in); } + av_frame_unref(ost->last_frame); total_packets_written += ost->packets_written; } I'm not against this change, but this issue should be solved within dav1d as well. Either the caller fully owns the picture returned by dav1d, or it doesn't. "Partially owns it while some other context is still valid" is not really acceptable. You can't ask any library to own content even after you have closed it (and potentially unloaded the DLL). As i said in dav1d's merge request, with libavcodec i can open an encoder, generate an AVPacket, close the encoder, open a bitstream filter, filter the packet i got from the encoder, close the bitstream filter, and still fully own the packet without having in it any dangling pointer to some callback stored in a long dead context. Same thing with AVFrames. It generally works because it's usually used statically and with no external decoder, loaded dynamically. This patch prevents ffmpeg.c closing the decoder (and thus the Dav1dContext) before a reference to one AVFrame, owned by ffmpeg.c and supposedly standalone, was freed. That's ok, but ffmpeg.c is just one libavcodec user, and we have no control whatsoever of what other libavcodec users will do with a returned AVFrame from avcodec_receive_frame(). And as Hendrik said, they are guaranteed to remain valid regardless of the component they came out of, so this is not acceptable. I'd be curious to see how it works with DXVA2/D3D11VA where a DLL needs to be loaded and the buffers come for that DLL. If last_frame holds a DXVA2/D3D11 texture and tries to free it after the DLL has been unloaded it shouldn't work well. I had a quick look. It turns out that the DLLs are loaded but never unloaded. So of course it will never execute code in unloaded DLLs. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs
thanks for the review, see in line. > -Original Message- > From: myp...@gmail.com [mailto:myp...@gmail.com] > Sent: Wednesday, October 17, 2018 7:18 AM > To: FFmpeg development discussions and patches de...@ffmpeg.org> > Cc: Guo, Yejun ; g...@ffbox0-bg.ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH] Add a filter implementing HDR image > reconstruction from a single exposure using deep CNNs > > On Tue, Oct 16, 2018 at 4:26 PM Guo, Yejun wrote: > > > > see the algorithm's paper and code below. > > > > the filter's parameter looks like: > > > sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmtname=gb > rp10 > > le > > > > The input of the deep CNN model is RGB24 while the output is float for > > each color channel. This is the filter's default behavior to output > > format with gbrpf32le. And gbrp10le is also supported as the output, > > so we can see the rendering result in a player, as a reference. > > > > To generate the model file, we need modify the original script a little. > > - set name='y' for y_final within script at > > https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py > > - add the following code to the script at > > https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict. > > py > > > > graph = tf.graph_util.convert_variables_to_constants(sess, > > sess.graph_def, ["y"]) tf.train.write_graph(graph, '.', 'graph.pb', > > as_text=False) > > > > The filter only works when tensorflow C api is supported in the > > system, native backend is not supported since there are some different > > types of layers in the deep CNN model, besides CONV and > DEPTH_TO_SPACE. > > > > btw, as a whole solution, metadata should also be generated from the > > sdr video, so to be encoded as a HDR video. Not supported yet. > > This patch just focuses on this paper. > > > > https://arxiv.org/pdf/1710.07480.pdf: > > author = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy > and Mantiuk, Rafał and Unger, Jonas", > > title= "HDR image reconstruction from a single exposure using deep > CNNs", > > journal = "ACM Transactions on Graphics (TOG)", > > number = "6", > > volume = "36", > > articleno= "178", > > year = "2017" > > > > https://github.com/gabrieleilertsen/hdrcnn > > Signed-off-by: Guo, Yejun > > --- > > libavfilter/Makefile | 1 + > > libavfilter/allfilters.c | 1 + > > libavfilter/vf_sdr2hdr.c | 283 > > +++ > > 3 files changed, 285 insertions(+) > > create mode 100644 libavfilter/vf_sdr2hdr.c > > > > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index > > 62cc2f5..88e7da6 100644 > > --- a/libavfilter/Makefile > > +++ b/libavfilter/Makefile > > @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER) += > vf_convolution_opencl.o opencl.o > > OBJS-$(CONFIG_SPLIT_FILTER) += split.o > > OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o > > OBJS-$(CONFIG_SR_FILTER) += vf_sr.o > > +OBJS-$(CONFIG_SDR2HDR_FILTER)+= vf_sdr2hdr.o > > OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o framesync.o > > OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o > > OBJS-$(CONFIG_STREAMSELECT_FILTER) += f_streamselect.o > framesync.o > > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index > > 5e72803..1645c0f 100644 > > --- a/libavfilter/allfilters.c > > +++ b/libavfilter/allfilters.c > > @@ -319,6 +319,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_sdr2hdr; > > extern AVFilter ff_vf_select; > > extern AVFilter ff_vf_selectivecolor; extern AVFilter ff_vf_sendcmd; > > diff --git a/libavfilter/vf_sdr2hdr.c b/libavfilter/vf_sdr2hdr.c new > > file mode 100644 index 000..52f408e > > --- /dev/null > > +++ b/libavfilter/vf_sdr2hdr.c > > @@ -0,0 +1,283 @@ > > +/* > > + * Copyright (c) 2018 Guo Yejun > > + * > > + * 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 > > + * Filter implementing HDR image reconstruction fr
Re: [FFmpeg-devel] [PATCH] ffmpeg: release the last_frame before the decoders are closed
On 16/10/2018 18:04, James Almer wrote: On 10/16/2018 12:34 PM, Steve Lhomme wrote: On 16/10/2018 16:59, Hendrik Leppkes wrote: On Tue, Oct 16, 2018 at 4:02 PM James Almer wrote: On 10/16/2018 9:16 AM, Steve Lhomme wrote: If the decoder provides its own buffers it might not be able to release its buffers once it has been closed. (this is the case with dav1d). --- fftools/ffmpeg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index da4259a9a8..faf62475a2 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -4738,6 +4738,7 @@ static int transcode(void) if (ost->encoding_needed) { av_freep(&ost->enc_ctx->stats_in); } + av_frame_unref(ost->last_frame); total_packets_written += ost->packets_written; } I'm not against this change, but this issue should be solved within dav1d as well. Either the caller fully owns the picture returned by dav1d, or it doesn't. "Partially owns it while some other context is still valid" is not really acceptable. You can't ask any library to own content even after you have closed it (and potentially unloaded the DLL). As i said in dav1d's merge request, with libavcodec i can open an encoder, generate an AVPacket, close the encoder, open a bitstream filter, filter the packet i got from the encoder, close the bitstream filter, and still fully own the packet without having in it any dangling pointer to some callback stored in a long dead context. Same thing with AVFrames. It generally works because it's usually used statically and with no external decoder, loaded dynamically. This patch prevents ffmpeg.c closing the decoder (and thus the Dav1dContext) before a reference to one AVFrame, owned by ffmpeg.c and supposedly standalone, was freed. That's ok, but ffmpeg.c is just one libavcodec user, and we have no control whatsoever of what other libavcodec users will do with a returned AVFrame from avcodec_receive_frame(). And as Hendrik said, they are guaranteed to remain valid regardless of the component they came out of, so this is not acceptable. I'd be curious to see how it works with DXVA2/D3D11VA where a DLL needs to be loaded and the buffers come for that DLL. If last_frame holds a DXVA2/D3D11 texture and tries to free it after the DLL has been unloaded it shouldn't work well. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] Add a filter implementing HDR image reconstruction from a single exposure using deep CNNs
thanks for your comments, please see inline. > -Original Message- > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf > Of Paul B Mahol > Sent: Tuesday, October 16, 2018 5:00 PM > To: FFmpeg development discussions and patches de...@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH] Add a filter implementing HDR image > reconstruction from a single exposure using deep CNNs > > On 10/16/18, Guo, Yejun wrote: > > see the algorithm's paper and code below. > > > > the filter's parameter looks like: > > > sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmtname=gb > rp10 > > le > > > > The input of the deep CNN model is RGB24 while the output is float for > > each color channel. This is the filter's default behavior to output > > format with gbrpf32le. And gbrp10le is also supported as the output, > > so we can see the rendering result in a player, as a reference. > > > > To generate the model file, we need modify the original script a little. > > - set name='y' for y_final within script at > > https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py > > - add the following code to the script at > > https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict. > > py > > > > graph = tf.graph_util.convert_variables_to_constants(sess, > > sess.graph_def, > > ["y"]) > > tf.train.write_graph(graph, '.', 'graph.pb', as_text=False) > > > > The filter only works when tensorflow C api is supported in the > > system, native backend is not supported since there are some different > > types of layers in the deep CNN model, besides CONV and > DEPTH_TO_SPACE. > > > > btw, as a whole solution, metadata should also be generated from the > > sdr video, so to be encoded as a HDR video. Not supported yet. > > This patch just focuses on this paper. > > > > https://arxiv.org/pdf/1710.07480.pdf: > > author = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy > > and Mantiuk, Rafal/ and Unger, Jonas", > > title= "HDR image reconstruction from a single exposure using deep > > CNNs", > > journal = "ACM Transactions on Graphics (TOG)", > > number = "6", > > volume = "36", > > articleno= "178", > > year = "2017" > > > > https://github.com/gabrieleilertsen/hdrcnn > > Signed-off-by: Guo, Yejun > > --- > > libavfilter/Makefile | 1 + > > libavfilter/allfilters.c | 1 + > > libavfilter/vf_sdr2hdr.c | 283 > > +++ > > 3 files changed, 285 insertions(+) > > create mode 100644 libavfilter/vf_sdr2hdr.c > > > > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index > > 62cc2f5..88e7da6 100644 > > --- a/libavfilter/Makefile > > +++ b/libavfilter/Makefile > > @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER) += > > vf_convolution_opencl.o opencl.o > > OBJS-$(CONFIG_SPLIT_FILTER) += split.o > > OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o > > OBJS-$(CONFIG_SR_FILTER) += vf_sr.o > > +OBJS-$(CONFIG_SDR2HDR_FILTER)+= vf_sdr2hdr.o > > Alphabetical order please. Looks that this file is not strictly in alphabetical order, I added here because that sdr2hdr is implemented with the reference to vf_sr which firstly introduced tensorflow C API support. (I noticed that allfilters.c is in alphabetical order, and had followed) > > > OBJS-$(CONFIG_SSIM_FILTER) += vf_ssim.o framesync.o > > OBJS-$(CONFIG_STEREO3D_FILTER) += vf_stereo3d.o > > OBJS-$(CONFIG_STREAMSELECT_FILTER) += f_streamselect.o > > framesync.o > > diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index > > 5e72803..1645c0f 100644 > > --- a/libavfilter/allfilters.c > > +++ b/libavfilter/allfilters.c > > @@ -319,6 +319,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_sdr2hdr; > > extern AVFilter ff_vf_select; > > extern AVFilter ff_vf_selectivecolor; extern AVFilter ff_vf_sendcmd; > > diff --git a/libavfilter/vf_sdr2hdr.c b/libavfilter/vf_sdr2hdr.c new > > file mode 100644 index 000..52f408e > > --- /dev/null > > +++ b/libavfilter/vf_sdr2hdr.c > > @@ -0,0 +1,283 @@ > > +/* > > + * Copyright (c) 2018 Guo Yejun > > + * > > + * 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 receive