Re: [FFmpeg-devel] [PATCH v2 5/5] avcodec/x86/hevc_mc: add qpel_h64_8_avx512icl
On Wed, 2022-04-20 at 15:13 +, Xiang, Haihao wrote: > On Thu, 2022-04-14 at 11:23 +, Wu Jianhua wrote: > > Ping! > > Wu Jianhua: > > > Henrik Gramner: > > > > Sent: Friday, March 11, 2022 10:51 PM > > > > To: FFmpeg development discussions and patches > > > devel at ffmpeg.org> > > > > Subject: Re: [FFmpeg-devel] [PATCH v2 5/5] avcodec/x86/hevc_mc: add > > > > qpel_h64_8_avx512icl > > > > > > > > All 5/5 LGTM. > > > > > > > > > > Hi there, > > > > > > Are there any more comments or objections here? > > > If not, could someone help push this patchset? > > > > > > Many thanks! > > > Jianhua > > Ping, the patchset works well for me. I'll apply this patchset in a few days > if > no more comment. > Applied, thx -Haihao ___ 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] FFmpeg 5.0 LTS vs 5.1 LTS
On 2022-04-23 10:06 pm, Michael Niedermayer wrote: Hi all Do people prefer that 5.0 becomes LTS or the next (5.1) ? Or something else ? A LTS release should be prospectively designated. That way, devs can prioritze their efforts and enterprise users can plan a roadmap for deployment. So, not 5.0. Regards, Gyan ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] FFmpeg 5.0 LTS vs 5.1 LTS
> 2022年4月24日 00:36,Michael Niedermayer 写道: > > Hi all > > Do people prefer that 5.0 becomes LTS or the next (5.1) ? > Or something else ? I think 5.0 or 5.1 is ok. Because LTS is just for stable, I am looking at maillist, There have lots of patch will change lots of code every version, So whatever of them, I think 5.0 has removed the main deprecated warning message, so this maybe the first LTS version. > > Thanks > > -- > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB > > Nations do behave wisely once they have exhausted all other alternatives. > -- Abba Eban > ___ > 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 Liu ___ 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] proposal for a minor change in the behavior of the drawtext filter
Francesco Carusi (12022-04-22): > I'm working on an enhanced version of the drawtext filter and would like to > discuss with you about a minor change in its behavior related to line > spacing management. > In the current implementation the space between two lines of text is set > equal to the height of the highest glyph found in the text plus the optional > user defined "line_spacing" parameter (which defaults to 0): > > line_height = max_glyph_h + line_spacing > > This has some drawbacks: > 1) the line height depends on the text > See image "line_height-old.png" (the blue lines where added by me) > The filter is applied three times with tree slightly different texts: > the line_spacing parameter was not specified, > but the actual line height changes due to the different heights of the > glyphs > 2) the line height is not consistent between the same text being rendered by > the filter and by external tools > > The proposed change is: > 1) the default line height is set to the font-defined line height > 2) the line_spacing parameter, if specified, sets the actual line height > (line_height = line_spacing) > 3) the default value of line_spacing is set to -1 (which means: use the > default line height) > > The image "line_height-new.png" shows the effect of the new behavior. > > Which is the impact of the change? > A) users using the line_spacing parameter would see less space between lines > B) users not using the line_spacing parameter would see (in most cases) more > space between lines > > Can the impact be mitigated? > Well, yes, we may add a new parameter named 'line_height' and deprecate > 'line_spacing', in this way anyone using line_spacing explicitly would not > see any change in the filter behavior. I don't like this solution but it may > help reducing the impact of the change. Hi. While your proposal shows merit in itself, it also feels like the first towards re-inventing a layout engine. The problem with line spacing is the tiniest of drawtext problems: look for right-to-left, ligatures and so much more. If you want to enhance the output of drawtext, I think it would be more efficient to choose a good layout engine library, Libre and portable, and to make it use it optionally. Regards, -- Nicolas George 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] libavcodec/videotoolboxenc.c: add option to hevc encoder to prioritize speed.
Am 23.04.22 um 22:51 schrieb Simone Karin Lehmann: Am 23.04.2022 um 21:56 schrieb Thilo Borgmann : Am 23.04.22 um 17:42 schrieb Simone Karin Lehmann: Am 23.04.2022 um 17:07 schrieb Thilo Borgmann : If that works I'd be happy. Does not apply for me anymore (on HEAD), though? hhmm, the patch applies for me on current HEAD. I’ve tested it a few moments ago on a fresh downloaded git snapshot. Maybe a former patch from me still there in your source tree? Also cloned into a new one, but corrupt @75: Weird. Apple Mail seems to somehow change the encoding of the mail and I couldn’t get the *.eml to apply correctly too. Never encountered that before. I've attached the patch as a file. Hope that’s ok on this mailing list. Sorry for the inconvenience. It is and patch LGTM. I CC'd the maintainers as they didn't comment yet. 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".
[FFmpeg-devel] [PATCH v2 0/7] Add UUID functionality to libavutil
This patchset adds functions for handling UUIDs to libavutil, under the av_uuid_* prefix, and refactors the various ad-hoc handling to use it. This was proposed in [1]. This is _heavily_ based off libuuid with various parts of the code simplified to remove unnecessary functionality (e.g. generation, and v1 UUIDs). v2: - Removed unnecessary license header in libavutil/uuid.h - Cosmetic fixes [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-January/291917.html Pierre-Anthony Lemieux (6): avutil/tests/uuid: add uuid tests avformat/mov: refactor to use avutil/uuid avformat/smoothstreamingenc: refactor to use avutil/uuid avcodec/cbs_sei: refactor to use avutil/uuid avformat/imf: refactor to use avutil/uuid avfilter/showinfo: refactor to use avutil/uuid Zane van Iperen (1): avutil/uuid: add utility library for manipulating UUIDs as specified in RFC 4122 libavcodec/cbs_sei.h | 3 +- libavcodec/vaapi_encode_h264.c | 8 +- libavfilter/vf_showinfo.c| 17 +--- libavformat/imf.h| 18 +--- libavformat/imf_cpl.c| 60 +--- libavformat/imfdec.c | 34 +++ libavformat/mov.c| 25 ++--- libavformat/movenc.c | 9 +- libavformat/smoothstreamingenc.c | 7 +- libavformat/tests/imf.c | 18 ++-- libavutil/Makefile | 3 + libavutil/tests/.gitignore | 1 + libavutil/tests/uuid.c | 139 +++ libavutil/uuid.c | 155 +++ libavutil/uuid.h | 137 +++ tests/fate/libavutil.mak | 5 + 16 files changed, 525 insertions(+), 114 deletions(-) create mode 100644 libavutil/tests/uuid.c create mode 100644 libavutil/uuid.c create mode 100644 libavutil/uuid.h -- 2.35.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 v2 6/7] avformat/imf: refactor to use avutil/uuid
From: Pierre-Anthony Lemieux --- libavformat/imf.h | 18 - libavformat/imf_cpl.c | 60 +++-- libavformat/imfdec.c| 34 +++ libavformat/tests/imf.c | 18 ++--- 4 files changed, 52 insertions(+), 78 deletions(-) diff --git a/libavformat/imf.h b/libavformat/imf.h index 62c4468ce9..4271cd9582 100644 --- a/libavformat/imf.h +++ b/libavformat/imf.h @@ -58,17 +58,9 @@ #include "avformat.h" #include "libavformat/avio.h" #include "libavutil/rational.h" +#include "libavutil/uuid.h" #include -#define FF_IMF_UUID_FORMAT\ -"urn:uuid:%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-" \ -"%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" - -/** - * UUID as defined in IETF RFC 422 - */ -typedef uint8_t FFIMFUUID[16]; - /** * IMF Composition Playlist Base Resource */ @@ -84,7 +76,7 @@ typedef struct FFIMFBaseResource { */ typedef struct FFIMFTrackFileResource { FFIMFBaseResource base; -FFIMFUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */ +AVUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */ } FFIMFTrackFileResource; /** @@ -109,7 +101,7 @@ typedef struct FFIMFMarkerResource { * IMF Composition Playlist Virtual Track */ typedef struct FFIMFBaseVirtualTrack { -FFIMFUUID id_uuid; /**< TrackId associated with the Virtual Track */ +AVUUID id_uuid; /**< TrackId associated with the Virtual Track */ } FFIMFBaseVirtualTrack; /** @@ -135,7 +127,7 @@ typedef struct FFIMFMarkerVirtualTrack { * IMF Composition Playlist */ typedef struct FFIMFCPL { -FFIMFUUID id_uuid; /**< CompositionPlaylist/Id element */ +AVUUID id_uuid; /**< CompositionPlaylist/Id element */ xmlChar *content_title_utf8; /**< CompositionPlaylist/ContentTitle element */ AVRational edit_rate;/**< CompositionPlaylist/EditRate element */ FFIMFMarkerVirtualTrack *main_markers_track; /**< Main Marker Virtual Track */ @@ -196,7 +188,7 @@ int ff_imf_xml_read_rational(xmlNodePtr element, AVRational *rational); * Reads a UUID from an XML element * @return 0 on success, < 0 AVERROR code on error. */ -int ff_imf_xml_read_uuid(xmlNodePtr element, uint8_t uuid[16]); +int ff_imf_xml_read_uuid(xmlNodePtr element, AVUUID uuid); /** * Returns the first child element with the specified local name diff --git a/libavformat/imf_cpl.c b/libavformat/imf_cpl.c index 102a6b4549..c0d43cbfad 100644 --- a/libavformat/imf_cpl.c +++ b/libavformat/imf_cpl.c @@ -70,32 +70,14 @@ xmlNodePtr ff_imf_xml_get_child_element_by_name(xmlNodePtr parent, const char *n return NULL; } -int ff_imf_xml_read_uuid(xmlNodePtr element, uint8_t uuid[16]) +int ff_imf_xml_read_uuid(xmlNodePtr element, AVUUID uuid) { xmlChar *element_text = NULL; -int scanf_ret; int ret = 0; element_text = xmlNodeListGetString(element->doc, element->xmlChildrenNode, 1); -scanf_ret = sscanf(element_text, - FF_IMF_UUID_FORMAT, - &uuid[0], - &uuid[1], - &uuid[2], - &uuid[3], - &uuid[4], - &uuid[5], - &uuid[6], - &uuid[7], - &uuid[8], - &uuid[9], - &uuid[10], - &uuid[11], - &uuid[12], - &uuid[13], - &uuid[14], - &uuid[15]); -if (scanf_ret != 16) { +ret = av_uuid_urn_parse(element_text, uuid); +if (ret) { av_log(NULL, AV_LOG_ERROR, "Invalid UUID\n"); ret = AVERROR_INVALIDDATA; } @@ -370,7 +352,7 @@ static int fill_marker_resource(xmlNodePtr marker_resource_elem, static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl) { int ret = 0; -uint8_t uuid[16]; +AVUUID uuid; xmlNodePtr resource_list_elem = NULL; xmlNodePtr resource_elem = NULL; xmlNodePtr track_id_elem = NULL; @@ -388,8 +370,8 @@ static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl) } av_log(NULL, AV_LOG_DEBUG, - "Processing IMF CPL Marker Sequence for Virtual Track " FF_IMF_UUID_FORMAT "\n", - UID_ARG(uuid)); + "Processing IMF CPL Marker Sequence for Virtual Track " AV_PRI_UUID "\n", + AV_UUID_ARG(uuid)); /* create main marker virtual track if it does not exist */ if (!cpl->main_markers_track) { @@ -397,9 +379,9 @@ static int push_marker_sequence(xmlNodePtr marker_sequence_elem, FFIMFCPL *cpl) if (!cpl->main_markers_track) return AVERROR(ENOMEM); imf_marker_virtual_track_init(cpl->main_markers_track); -
[FFmpeg-devel] [PATCH v2 2/7] avutil/tests/uuid: add uuid tests
From: Pierre-Anthony Lemieux --- libavutil/Makefile | 1 + libavutil/tests/.gitignore | 1 + libavutil/tests/uuid.c | 139 + tests/fate/libavutil.mak | 5 ++ 4 files changed, 146 insertions(+) create mode 100644 libavutil/tests/uuid.c diff --git a/libavutil/Makefile b/libavutil/Makefile index 29742668b8..fef726b39a 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -260,6 +260,7 @@ TESTPROGS = adler32 \ tree\ twofish \ utf8\ +uuid\ xtea\ tea \ diff --git a/libavutil/tests/.gitignore b/libavutil/tests/.gitignore index 9d90827954..919010e4fc 100644 --- a/libavutil/tests/.gitignore +++ b/libavutil/tests/.gitignore @@ -48,4 +48,5 @@ /tree /twofish /utf8 +/uuid /xtea diff --git a/libavutil/tests/uuid.c b/libavutil/tests/uuid.c new file mode 100644 index 00..0a7a0eb07d --- /dev/null +++ b/libavutil/tests/uuid.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2022 Pierre-Anthony Lemieux + *Zane van Iperen + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "libavutil/uuid.h" +#include "libavutil/log.h" + +static const char *UUID_1= "6021b21e-894e-43ff-8317-1ca891c1c49b"; +static const char *UUID_1_UC = "6021B21E-894E-43FF-8317-1CA891C1C49B"; +static const char *UUID_1_MIXED = "6021b21e-894E-43fF-8317-1CA891C1c49b"; +static const char *UUID_1_URN= "urn:uuid:6021b21e-894e-43ff-8317-1ca891c1c49b"; +static const AVUUID UUID_1_BYTES = {0x60, 0x21, 0xb2, 0x1e, 0x89, 0x4e, 0x43, 0xff, +0x83, 0x17, 0x1c, 0xa8, 0x91, 0xc1, 0xc4, 0x9b}; + +static const AVUUID UUID_NIL = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + +static const char *UUID_BAD_1 = "16a2c9f8-afbc-4767-8621-8cb2b27599"; +static const char *UUID_BAD_2 = "75df62c2999b4bd38c9d8058fcde9123"; +static const char *UUID_BAD_3 = "a1b9a05e-f1d1-464g-a951-1ba0a374f02"; +static const char *UUID_BAD_4 = "279c66d432-7b39-41d5-966f-5e8138265c20"; + +int main(int argc, char **argv) +{ +AVUUID uuid; +AVUUID uuid2 = {0x32, 0xc7, 0x00, 0xc4, 0xd5, 0xd7, 0x42, 0x0, +0x93, 0xc0, 0x3b, 0x6d, 0xea, 0x1b, 0x20, 0x5b}; + +/* test parsing */ + +if (av_uuid_parse(UUID_1, uuid)) +return 1; + +if (!av_uuid_equal(uuid, UUID_1_BYTES)) +return 1; + +/* test nil */ + +av_uuid_nil_set(uuid); + +if (!av_uuid_equal(uuid, UUID_NIL)) +return 1; + +/* test equality */ + +if (av_uuid_equal(UUID_1_BYTES, uuid2)) +return 1; + +/* test copy */ + +av_uuid_copy(uuid2, UUID_1_BYTES); + +if (!av_uuid_equal(uuid2, UUID_1_BYTES)) +return 1; + +/* test uppercase parsing */ + +if (av_uuid_parse(UUID_1_UC, uuid)) +return 1; + +if (!av_uuid_equal(uuid, UUID_1_BYTES)) +return 1; + +/* test mixed-case parsing */ + +if (av_uuid_parse(UUID_1_MIXED, uuid)) +return 1; + +if (!av_uuid_equal(uuid, UUID_1_BYTES)) +return 1; + +/* test URN uuid parse */ + +if (av_uuid_urn_parse(UUID_1_URN, uuid)) +return 1; + +if (!av_uuid_equal(uuid, UUID_1_BYTES)) +return 1; + +/* test parse range */ + +if (av_uuid_parse_range(UUID_1_URN + 9, UUID_1_URN + 45, uuid)) +return 1; + +if (!av_uuid_equal(uuid, UUID_1_BYTES)) +return 1; + +/* test bad parse range */ + +if (!av_uuid_parse_range(UUID_1_URN + 9, UUID_1_URN + 44, uuid)) +return 1; + +/* test bad parse range 2 */ + +if (!av_uuid_parse_range(UUID_1_URN + 8, UUID_1_URN + 44, uuid)) +return 1; + +/* test bad parse range 2 */ + +if (!av_uuid_parse_range(UUID_1_URN + 8, UUID_1_URN + 45, uuid)) +return
[FFmpeg-devel] [PATCH v2 4/7] avformat/smoothstreamingenc: refactor to use avutil/uuid
From: Pierre-Anthony Lemieux --- libavformat/smoothstreamingenc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c index c67f0cba43..3d857b932e 100644 --- a/libavformat/smoothstreamingenc.c +++ b/libavformat/smoothstreamingenc.c @@ -38,6 +38,7 @@ #include "libavutil/file.h" #include "libavutil/mathematics.h" #include "libavutil/intreadwrite.h" +#include "libavutil/uuid.h" typedef struct Fragment { int64_t start_time, duration; @@ -420,13 +421,13 @@ static int parse_fragment(AVFormatContext *s, const char *filename, int64_t *sta if (len < 8 || len >= *moof_size) goto fail; if (tag == MKTAG('u','u','i','d')) { -static const uint8_t tfxd[] = { +static const AVUUID tfxd = { 0x6d, 0x1d, 0x9b, 0x05, 0x42, 0xd5, 0x44, 0xe6, 0x80, 0xe2, 0x14, 0x1d, 0xaf, 0xf7, 0x57, 0xb2 }; -uint8_t uuid[16]; +AVUUID uuid; avio_read(in, uuid, 16); -if (!memcmp(uuid, tfxd, 16) && len >= 8 + 16 + 4 + 16) { +if (av_uuid_equal(uuid, tfxd) && len >= 8 + 16 + 4 + 16) { avio_seek(in, 4, SEEK_CUR); *start_ts = avio_rb64(in); *duration = avio_rb64(in); -- 2.35.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 v2 3/7] avformat/mov: refactor to use avutil/uuid
From: Pierre-Anthony Lemieux --- libavformat/mov.c| 25 + libavformat/movenc.c | 9 + 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 3e83e54a77..cb6b49d98e 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -50,6 +50,7 @@ #include "libavutil/stereo3d.h" #include "libavutil/timecode.h" #include "libavutil/dovi_meta.h" +#include "libavutil/uuid.h" #include "libavcodec/ac3tab.h" #include "libavcodec/flac.h" #include "libavcodec/hevc.h" @@ -5960,21 +5961,21 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) AVStream *st; MOVStreamContext *sc; int64_t ret; -uint8_t uuid[16]; -static const uint8_t uuid_isml_manifest[] = { +AVUUID uuid; +static const AVUUID uuid_isml_manifest = { 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd, 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }; -static const uint8_t uuid_xmp[] = { +static const AVUUID uuid_xmp = { 0xbe, 0x7a, 0xcf, 0xcb, 0x97, 0xa9, 0x42, 0xe8, 0x9c, 0x71, 0x99, 0x94, 0x91, 0xe3, 0xaf, 0xac }; -static const uint8_t uuid_spherical[] = { +static const AVUUID uuid_spherical = { 0xff, 0xcc, 0x82, 0x63, 0xf8, 0x55, 0x4a, 0x93, 0x88, 0x14, 0x58, 0x7a, 0x02, 0x52, 0x1f, 0xdd, }; -if (atom.size < sizeof(uuid) || atom.size >= FFMIN(INT_MAX, SIZE_MAX)) +if (atom.size < AV_UUID_LEN || atom.size >= FFMIN(INT_MAX, SIZE_MAX)) return AVERROR_INVALIDDATA; if (c->fc->nb_streams < 1) @@ -5982,13 +5983,13 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) st = c->fc->streams[c->fc->nb_streams - 1]; sc = st->priv_data; -ret = ffio_read_size(pb, uuid, sizeof(uuid)); +ret = ffio_read_size(pb, uuid, AV_UUID_LEN); if (ret < 0) return ret; -if (!memcmp(uuid, uuid_isml_manifest, sizeof(uuid))) { +if (av_uuid_equal(uuid, uuid_isml_manifest)) { uint8_t *buffer, *ptr; char *endptr; -size_t len = atom.size - sizeof(uuid); +size_t len = atom.size - AV_UUID_LEN; if (len < 4) { return AVERROR_INVALIDDATA; @@ -6026,9 +6027,9 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) } av_free(buffer); -} else if (!memcmp(uuid, uuid_xmp, sizeof(uuid))) { +} else if (av_uuid_equal(uuid, uuid_xmp)) { uint8_t *buffer; -size_t len = atom.size - sizeof(uuid); +size_t len = atom.size - AV_UUID_LEN; if (c->export_xmp) { buffer = av_mallocz(len + 1); if (!buffer) { @@ -6048,8 +6049,8 @@ static int mov_read_uuid(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (ret < 0) return ret; } -} else if (!memcmp(uuid, uuid_spherical, sizeof(uuid))) { -size_t len = atom.size - sizeof(uuid); +} else if (av_uuid_equal(uuid, uuid_spherical)) { +size_t len = atom.size - AV_UUID_LEN; ret = mov_parse_uuid_spherical(sc, pb, len); if (ret < 0) return ret; diff --git a/libavformat/movenc.c b/libavformat/movenc.c index b9956e699c..b4de843e49 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -57,6 +57,7 @@ #include "libavutil/timecode.h" #include "libavutil/dovi_meta.h" #include "libavutil/color_utils.h" +#include "libavutil/uuid.h" #include "hevc.h" #include "rtpenc.h" #include "mov_chan.h" @@ -4319,14 +4320,14 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat int64_t pos = avio_tell(pb); int i; -static const uint8_t uuid[] = { +static const AVUUID uuid = { 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd, 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }; avio_wb32(pb, 0); ffio_wfourcc(pb, "uuid"); -avio_write(pb, uuid, sizeof(uuid)); +avio_write(pb, uuid, AV_UUID_LEN); avio_wb32(pb, 0); avio_printf(pb, "\n"); @@ -4585,7 +4586,7 @@ static int mov_write_tfxd_tag(AVIOContext *pb, MOVTrack *track) avio_wb32(pb, 0); /* size placeholder */ ffio_wfourcc(pb, "uuid"); -avio_write(pb, uuid, sizeof(uuid)); +avio_write(pb, uuid, AV_UUID_LEN); avio_w8(pb, 1); avio_wb24(pb, 0); avio_wb64(pb, track->cluster[0].dts + track->cluster[0].cts); @@ -4611,7 +4612,7 @@ static int mov_write_tfrf_tag(AVIOContext *pb, MOVMuxContext *mov, avio_seek(pb, track->frag_info[entry].tfrf_offset, SEEK_SET); avio_wb32(pb, size); ffio_wfourcc(pb, "uuid"); -avio_write(pb, uuid, sizeof(uuid)); +avio_write(pb, uuid, AV_UUID_LEN); avio_w8(pb, 1); avio_wb24(pb, 0); avio_w8(pb, n); -- 2.35.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or em
[FFmpeg-devel] [PATCH v2 7/7] avfilter/showinfo: refactor to use avutil/uuid
From: Pierre-Anthony Lemieux --- libavfilter/vf_showinfo.c | 17 + 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index 12d39310ef..0d6f2805bb 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -42,6 +42,7 @@ #include "libavutil/mastering_display_metadata.h" #include "libavutil/video_enc_params.h" #include "libavutil/detection_bbox.h" +#include "libavutil/uuid.h" #include "avfilter.h" #include "internal.h" @@ -421,29 +422,21 @@ static void dump_video_enc_params(AVFilterContext *ctx, const AVFrameSideData *s static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSideData *sd) { -const int uuid_size = 16; const uint8_t *user_data = sd->data; int i; -if (sd->size < uuid_size) { +if (sd->size < AV_UUID_LEN) { av_log(ctx, AV_LOG_ERROR, "invalid data(%"SIZE_SPECIFIER" < " - "UUID(%d-bytes))\n", sd->size, uuid_size); + "UUID(%d-bytes))\n", sd->size, AV_UUID_LEN); return; } av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n"); -av_log(ctx, AV_LOG_INFO, "UUID="); -for (i = 0; i < uuid_size; i++) { -av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]); -if (i == 3 || i == 5 || i == 7 || i == 9) -av_log(ctx, AV_LOG_INFO, "-"); -} -av_log(ctx, AV_LOG_INFO, "\n"); +av_log(ctx, AV_LOG_INFO, "UUID=" AV_PRI_UUID "\n", AV_UUID_ARG(user_data)); av_log(ctx, AV_LOG_INFO, "User Data="); -for (; i < sd->size; i++) { +for (i = 16; i < sd->size; i++) av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]); -} av_log(ctx, AV_LOG_INFO, "\n"); } -- 2.35.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 v2 1/7] avutil/uuid: add utility library for manipulating UUIDs as specified in RFC 4122
Co-authored-by: Pierre-Anthony Lemieux Signed-off-by: Zane van Iperen --- libavutil/Makefile | 2 + libavutil/uuid.c | 155 + libavutil/uuid.h | 137 +++ 3 files changed, 294 insertions(+) create mode 100644 libavutil/uuid.c create mode 100644 libavutil/uuid.h diff --git a/libavutil/Makefile b/libavutil/Makefile index 81df3b0640..29742668b8 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -82,6 +82,7 @@ HEADERS = adler32.h \ timestamp.h \ tree.h\ twofish.h \ + uuid.h\ version.h \ video_enc_params.h\ xtea.h\ @@ -174,6 +175,7 @@ OBJS = adler32.o \ tx_float.o \ tx_double.o \ tx_int32.o \ + uuid.o \ video_enc_params.o \ film_grain_params.o \ diff --git a/libavutil/uuid.c b/libavutil/uuid.c new file mode 100644 index 00..6cf7a20c23 --- /dev/null +++ b/libavutil/uuid.c @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2022 Pierre-Anthony Lemieux + *Zane van Iperen + * + * 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 + */ + +/* + * Copyright (C) 1996, 1997 Theodore Ts'o. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, and the entire permission notice in its entirety, + *including the disclaimer of warranties. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote + *products derived from this software without specific prior + *written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF + * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + */ + +/** + * @file + * UUID parsing and serialization utilities. + * The library treat the UUID as an opaque sequence of 16 unsigned bytes, + * i.e. ignoring the internal layout of the UUID, which depends on the type + * of the UUID. + * + * @author Pierre-Anthony Lemieux + * @author Zane van Iperen + */ + +#include "uuid.h" +#include "error.h" +#include "avstring.h" +#include +#include + +int av_uuid_parse(const char *in, AVUUID uu) +{ +if (strlen(in) != 36) +return AVERROR(EINVAL); + +return av_uuid_parse_range(in, in + 36, uu); +} + +int av_uuid_parse_range(const char *in_start, const char *in_end, AVUUID uu) +{ +int i; +const char *cp; +char buf[3]; + +if ((in_end - in_start) != 36) +return -1; + +for (i = 0,
[FFmpeg-devel] [PATCH v2 5/7] avcodec/cbs_sei: refactor to use avutil/uuid
From: Pierre-Anthony Lemieux --- libavcodec/cbs_sei.h | 3 ++- libavcodec/vaapi_encode_h264.c | 8 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libavcodec/cbs_sei.h b/libavcodec/cbs_sei.h index c7a7a95be0..67c6e6cbbd 100644 --- a/libavcodec/cbs_sei.h +++ b/libavcodec/cbs_sei.h @@ -23,6 +23,7 @@ #include #include "libavutil/buffer.h" +#include "libavutil/uuid.h" #include "cbs.h" #include "sei.h" @@ -41,7 +42,7 @@ typedef struct SEIRawUserDataRegistered { } SEIRawUserDataRegistered; typedef struct SEIRawUserDataUnregistered { -uint8_t uuid_iso_iec_11578[16]; +AVUUID uuid_iso_iec_11578; uint8_t *data; AVBufferRef *data_ref; size_t data_length; diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 7a6b54ab6f..b3105d6ccc 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -25,6 +25,7 @@ #include "libavutil/common.h" #include "libavutil/internal.h" #include "libavutil/opt.h" +#include "libavutil/uuid.h" #include "avcodec.h" #include "cbs.h" @@ -43,7 +44,7 @@ enum { }; // Random (version 4) ISO 11578 UUID. -static const uint8_t vaapi_encode_h264_sei_identifier_uuid[16] = { +static const AVUUID vaapi_encode_h264_sei_identifier_uuid = { 0x59, 0x94, 0x8b, 0x28, 0x11, 0xec, 0x45, 0xaf, 0x96, 0x75, 0x19, 0xd4, 0x1f, 0xea, 0xa9, 0x4d, }; @@ -1089,9 +1090,8 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx) const char *driver; int len; -memcpy(priv->sei_identifier.uuid_iso_iec_11578, - vaapi_encode_h264_sei_identifier_uuid, - sizeof(priv->sei_identifier.uuid_iso_iec_11578)); +av_uuid_copy(priv->sei_identifier.uuid_iso_iec_11578, + vaapi_encode_h264_sei_identifier_uuid); driver = vaQueryVendorString(ctx->hwctx->display); if (!driver) -- 2.35.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] avfilter: add ambisonic decoder
Signed-off-by: Paul B Mahol --- libavfilter/Makefile |1 + libavfilter/af_ambisonic.c | 2292 libavfilter/allfilters.c |1 + 3 files changed, 2294 insertions(+) create mode 100644 libavfilter/af_ambisonic.c diff --git a/libavfilter/Makefile b/libavfilter/Makefile index c6b02d8703..7efde1e7f7 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -67,6 +67,7 @@ OBJS-$(CONFIG_ALATENCY_FILTER) += f_latency.o OBJS-$(CONFIG_ALIMITER_FILTER) += af_alimiter.o OBJS-$(CONFIG_ALLPASS_FILTER)+= af_biquads.o OBJS-$(CONFIG_ALOOP_FILTER) += f_loop.o +OBJS-$(CONFIG_AMBISONIC_FILTER) += af_ambisonic.o OBJS-$(CONFIG_AMERGE_FILTER) += af_amerge.o OBJS-$(CONFIG_AMETADATA_FILTER) += f_metadata.o OBJS-$(CONFIG_AMIX_FILTER) += af_amix.o diff --git a/libavfilter/af_ambisonic.c b/libavfilter/af_ambisonic.c new file mode 100644 index 00..2b42cc9035 --- /dev/null +++ b/libavfilter/af_ambisonic.c @@ -0,0 +1,2292 @@ +/* + * Copyright (c) 2022 Paul B Mahol + * Copyright (c) 2017 Sanchit Sinha + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include "libavutil/avstring.h" +#include "libavutil/channel_layout.h" +#include "libavutil/float_dsp.h" +#include "libavutil/opt.h" +#include "libavutil/avassert.h" +#include "audio.h" +#include "avfilter.h" +#include "formats.h" +#include "internal.h" + +#define EVEN 0 +#define ODD 1 +#define MAX_ORDER 3 +#define SQR(x) ((x) * (x)) +#define MAX_CHANNELS SQR(MAX_ORDER + 1) + +enum A_NAME { +A_W, A_Y, A_Z, A_X, A_V, A_T, A_R, A_S, A_U, A_Q, A_O, A_M, A_K, A_L, A_N, A_P, +}; + +enum NearFieldType { +NF_AUTO = -1, +NF_NONE, +NF_IN, +NF_OUT, +NB_NFTYPES, +}; + +enum PrecisionType { +P_AUTO = -1, +P_SINGLE, +P_DOUBLE, +NB_PTYPES, +}; + +enum PTypes { +PT_AMP, +PT_RMS, +PT_ENERGY, +PT_NBTYPES, +}; + +enum NormType { +N3D, +SN3D, +FUMA, +NB_NTYPES, +}; + +enum DirectionType { +D_X, +D_Y, +D_Z, +D_C, +NB_DTYPES, +}; + +enum SequenceType { +M_ACN, +M_FUMA, +M_SID, +NB_MTYPES, +}; + +enum Layouts { +MONO, +STEREO, +STEREO_DOWNMIX, +SURROUND, +L2_1, +TRIANGLE, +QUAD, +SQUARE, +L4_0, +L5_0, +L5_0_SIDE, +L6_0, +L7_0, +TETRA, +CUBE, +NB_LAYOUTS, +}; + +typedef struct NearField { +double d[MAX_ORDER]; +double z[MAX_ORDER]; +} NearField; + +typedef struct Xover { +double b[3]; +double a[3]; +double w[2]; +} Xover; + +static const double gains_2d[][4] = +{ +{ 1 }, +{ 1, 0.707107 }, +{ 1, 0.866025, 0.5 }, +{ 1, 0.92388, 0.707107, 0.382683 }, +}; + +static const double gains_3d[][4] = +{ +{ 1 }, +{ 1, 0.57735027 }, +{ 1, 0.774597, 0.4 }, +{ 1, 0.861136, 0.612334, 0.304747 }, +}; + +static const double same_distance[] = +{ +1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, +}; + +static const double cube_azimuth[] = +{ +315, 45, 135, 225, 315, 45, 135, 225, +}; + +static const double cube_elevation[] = +{ + 35.26439, 35.26439, 35.26439, 35.26439, +-35.26439, -35.26439, -35.26439, -35.26439 +}; + +static const struct { +const int order; +const int inputs; +const int speakers; +const int near_field; +const int type; +const double xover; +const AVChannelLayout outlayout; +const double *speakers_azimuth; +const double *speakers_elevation; +const double *speakers_distance; +} ambisonic_tab[] = { +[MONO] = { +.order = 0, +.inputs = 1, +.speakers = 1, +.near_field = NF_NONE, +.xover = 0., +.outlayout = (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO, +.speakers_azimuth = (const double[1]){ 0. }, +.speakers_distance = (const double[1]){ 1. }, +}, +[STEREO] = { +.order = 1, +.inputs = 4, +.speakers = 2, +.near_field = NF_NONE, +.xover = 0., +.outlayout = (AVChannelLayout)AV_CHANNEL_L
Re: [FFmpeg-devel] [PATCH 7/7] avcodec/xfacedec: Add AV_CODEC_CAP_DR1
lgtm ___ 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/7] avcodec/pgxdec: Fix issue with negative linesizes
lgtm ___ 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 6/7] avcodec/pgxdec: Use unsigned types for unsigned values
lgtm ___ 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 5/7] avcodec/pgxdec: Hoist branch out of loop
lgtm ___ 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/7] avcodec/pgxdec: Remove pointless checks
probably fine ___ 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/7] avcodec/pgxdec: Make better use of size check
lgtm if tested ___ 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/7] avcodec/pgxdec: Avoid always-false checks
lgtm ___ 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 v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi
> 1. Patch 3/6 - Replace LoadLibraryExA with LoadLibraryExW > What's the point in making changes to library loading? What does it fix? From the commit https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295571.html: ... the path length limitation is only lifted for file APIs that pass paths as wchar_t... > 2. Patches 5/6 and 6/6 - Add Fusion Manifest > ... > Both of these manifest attributes are affecting the runtime behavior of > an application running on Windows - but only starting from a certain > OS version. > ... > ... you would need to check the operating system version > before using to make sure that you are providing parameters in the "right" > way - I'm not sure whether that would make much sense. The same can be said about e.g. DirectX 11 hardware acceleration, which is available only starting with Windows 7; and you have to check OS version before providing parameters that enable it. Does not mean implementing that feature made no sense, since it made FFmpeg inconsistent with previous versions of Windows. Consistency with the greatest common denominator does not make much sense. Considering that people from yt-dlp and StaxRip projects requested long paths feature, looks like it does make sense to the users. > 3. All Patches x/6 - Remove MAX_PATH limit > The punch line sounds compelling. But how is the current situation and > what exactly would be the benefit? All patches with that line replace MAX_PATH-sized buffers with dynamically-allocated buffers of potentially arbitrary size. If application continues to use fixed-size buffers, it's not long path aware, regardless of the manifest. > As an example, the following command runs without issue on Windows > with a normal current ffmpeg build: It simply moves the burden of long path support from FFmpeg to FFmpeg clients. > All this is working in a predictable and reliable way on all common Windows > versions. It is neither predictable nor reliable. Please check https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html for things like “I actually exploited this behaviour to create arbitrary named pipes from the Chrome sandbox awhile back.” > 1. Windows version needs to be >= 1903 > (for being able to have both attributes in effect) For all intents and purposes, versions of Windows < 1903 have EOLed. Exceptions: - Windows 8.1 will EOL in January 2023, - LTSB/LTSC branches of Windows 10 before 21H2. None of these exceptions are particularly popular with users. > 2. Application needs to be compiled with and manifest file as resource Which is exactly what these patches are doing. > 3. A registry key or group policy needs to be set on Windows to enable this > ´ (in both cases, administrative permission/UAC is required to set it) > 4. Even when registry key or group policy is set, it might still be pending > a reboot Is it a big deal to change a registry and reboot? > On the other side, there's a risk of regressions by adding those manifest > attributes. Adding anything risks regressions, how manifest is supposed to be different from any other patch? > I wonder whether it wouldn’t be a better idea, to simply auto-add this prefix > in the ffmpeg file handling code if: Every command line argument that supplies a path needs to be updated. Every filter with a file argument needs to be updated. Code in https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295568.html normalises a path to use '/' instead of '\\' for whatever reason, and it cannot use \\?\ since it requires backslashes. How adding a prefix \\?\ is supposed to be simpler than replacing a couple of buffers? > This would work on all common Windows versions and would be predictable and > reliable. See https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide-on-win32-to-nt.html for predictability and reliability. ___ 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] 2nd ping
On 4/21/2022 10:55 AM, MCC CS wrote: It would be great if anyone who reads this could review this small patch (original: https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295351.html): This is a repost of the patch by Chris Snowhill who originally sent this patch on 31 December - which didn't receive any replies. As you can see on https://trac.ffmpeg.org/ticket/9564 the patch is needed and works perfectly. I have rebased it and recompiled it. Original commit description: Monterey needs mBytesPerFrame and mBytesPerPacket to be set, and I'm surprised this didn't break any previous system versions. Fixes bug #9564: Cannot decode xHE-AAC with audiotoolbox (aac_at) on Mac OS Monterey. Fixes likely bug that none of the AudioToolbox decoders work on Monterey. --- libavcodec/audiotoolboxdec.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index b8d0e868f7..daccf4abf8 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -375,6 +375,11 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; avctx->ch_layout.nb_channels = out_format.mChannelsPerFrame = in_format.mChannelsPerFrame; +out_format.mBytesPerFrame = +out_format.mChannelsPerFrame * (out_format.mBitsPerChannel / 8); +out_format.mBytesPerPacket = +out_format.mBytesPerFrame * out_format.mFramesPerPacket; + if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_QT) in_format.mFramesPerPacket = 64; -- 2.35.1 Will apply. Thanks. ___ 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 1/2] doc/examples/transcode_aac: Don't ignore last encoded frame
Am 11.04.2022 um 08:46 schrieb Paul B Mahol: On Tue, Mar 22, 2022 at 6:47 PM Andreas Unterweger wrote: The last encoded frame is now fetched on EOF. It was previously left in the encoder and caused a "1 frame left in queue" warning. Signed-off-by: Andreas Unterweger --- doc/examples/transcode_aac.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 9102e55f16..c9b93f6439 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -377,6 +377,8 @@ static int decode_audio_frame(AVFrame *frame, if (error < 0) return error; +*data_present = 0; +*finished = 0; /* Read one audio frame from the input file into a temporary packet. */ if ((error = av_read_frame(input_format_context, input_packet)) < 0) { /* If we are at the end of the file, flush the decoder below. */ @@ -555,7 +557,7 @@ static int read_decode_convert_and_store(AVAudioFifo *fifo, AVFrame *input_frame = NULL; /* Temporary storage for the converted input samples. */ uint8_t **converted_input_samples = NULL; -int data_present = 0; +int data_present; int ret = AVERROR_EXIT; /* Initialize temporary storage for one input frame. */ @@ -675,18 +677,17 @@ static int encode_audio_frame(AVFrame *frame, frame->pts = pts; pts += frame->nb_samples; } - + +*data_present = 0; /* Send the audio frame stored in the temporary packet to the encoder. * The output audio stream encoder is used to do this. */ error = avcodec_send_frame(output_codec_context, frame); -/* The encoder signals that it has nothing more to encode. */ -if (error == AVERROR_EOF) { -error = 0; -goto cleanup; -} else if (error < 0) { -fprintf(stderr, "Could not send packet for encoding (error '%s')\n", -av_err2str(error)); -goto cleanup; +/* Check for errors, but proceed with fetching encoded samples if the + * encoder signals that it has nothing more to encode. */ +if (error < 0 && error != AVERROR_EOF) { + fprintf(stderr, "Could not send packet for encoding (error '%s')\n", + av_err2str(error)); + goto cleanup; } /* Receive one encoded frame from the encoder. */ @@ -857,7 +858,6 @@ int main(int argc, char **argv) int data_written; /* Flush the encoder as it may have delayed frames. */ do { -data_written = 0; if (encode_audio_frame(NULL, output_format_context, output_codec_context, &data_written)) goto cleanup; -- 2.30.2 LGTM. can someone apply this? Ping again ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH v2 1/2] doc/examples/transcode_aac: Don't ignore last encoded frame
On 4/24/2022 9:36 AM, Andreas Unterweger wrote: Am 11.04.2022 um 08:46 schrieb Paul B Mahol: On Tue, Mar 22, 2022 at 6:47 PM Andreas Unterweger wrote: The last encoded frame is now fetched on EOF. It was previously left in the encoder and caused a "1 frame left in queue" warning. Signed-off-by: Andreas Unterweger --- doc/examples/transcode_aac.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 9102e55f16..c9b93f6439 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -377,6 +377,8 @@ static int decode_audio_frame(AVFrame *frame, if (error < 0) return error; + *data_present = 0; + *finished = 0; /* Read one audio frame from the input file into a temporary packet. */ if ((error = av_read_frame(input_format_context, input_packet)) < 0) { /* If we are at the end of the file, flush the decoder below. */ @@ -555,7 +557,7 @@ static int read_decode_convert_and_store(AVAudioFifo *fifo, AVFrame *input_frame = NULL; /* Temporary storage for the converted input samples. */ uint8_t **converted_input_samples = NULL; - int data_present = 0; + int data_present; int ret = AVERROR_EXIT; /* Initialize temporary storage for one input frame. */ @@ -675,18 +677,17 @@ static int encode_audio_frame(AVFrame *frame, frame->pts = pts; pts += frame->nb_samples; } - + + *data_present = 0; /* Send the audio frame stored in the temporary packet to the encoder. * The output audio stream encoder is used to do this. */ error = avcodec_send_frame(output_codec_context, frame); - /* The encoder signals that it has nothing more to encode. */ - if (error == AVERROR_EOF) { - error = 0; - goto cleanup; - } else if (error < 0) { - fprintf(stderr, "Could not send packet for encoding (error '%s')\n", - av_err2str(error)); - goto cleanup; + /* Check for errors, but proceed with fetching encoded samples if the + * encoder signals that it has nothing more to encode. */ + if (error < 0 && error != AVERROR_EOF) { + fprintf(stderr, "Could not send packet for encoding (error '%s')\n", + av_err2str(error)); + goto cleanup; } /* Receive one encoded frame from the encoder. */ @@ -857,7 +858,6 @@ int main(int argc, char **argv) int data_written; /* Flush the encoder as it may have delayed frames. */ do { - data_written = 0; if (encode_audio_frame(NULL, output_format_context, output_codec_context, &data_written)) goto cleanup; -- 2.30.2 LGTM. can someone apply this? Ping again See the reply about the patch no longer applying. ___ 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 1/2] doc/examples/transcode_aac: Don't ignore last encoded frame
Am 24.04.2022 um 14:38 schrieb James Almer: On 4/24/2022 9:36 AM, Andreas Unterweger wrote: Am 11.04.2022 um 08:46 schrieb Paul B Mahol: On Tue, Mar 22, 2022 at 6:47 PM Andreas Unterweger wrote: The last encoded frame is now fetched on EOF. It was previously left in the encoder and caused a "1 frame left in queue" warning. Signed-off-by: Andreas Unterweger --- doc/examples/transcode_aac.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/examples/transcode_aac.c b/doc/examples/transcode_aac.c index 9102e55f16..c9b93f6439 100644 --- a/doc/examples/transcode_aac.c +++ b/doc/examples/transcode_aac.c @@ -377,6 +377,8 @@ static int decode_audio_frame(AVFrame *frame, if (error < 0) return error; + *data_present = 0; + *finished = 0; /* Read one audio frame from the input file into a temporary packet. */ if ((error = av_read_frame(input_format_context, input_packet)) < 0) { /* If we are at the end of the file, flush the decoder below. */ @@ -555,7 +557,7 @@ static int read_decode_convert_and_store(AVAudioFifo *fifo, AVFrame *input_frame = NULL; /* Temporary storage for the converted input samples. */ uint8_t **converted_input_samples = NULL; - int data_present = 0; + int data_present; int ret = AVERROR_EXIT; /* Initialize temporary storage for one input frame. */ @@ -675,18 +677,17 @@ static int encode_audio_frame(AVFrame *frame, frame->pts = pts; pts += frame->nb_samples; } - + + *data_present = 0; /* Send the audio frame stored in the temporary packet to the encoder. * The output audio stream encoder is used to do this. */ error = avcodec_send_frame(output_codec_context, frame); - /* The encoder signals that it has nothing more to encode. */ - if (error == AVERROR_EOF) { - error = 0; - goto cleanup; - } else if (error < 0) { - fprintf(stderr, "Could not send packet for encoding (error '%s')\n", - av_err2str(error)); - goto cleanup; + /* Check for errors, but proceed with fetching encoded samples if the + * encoder signals that it has nothing more to encode. */ + if (error < 0 && error != AVERROR_EOF) { + fprintf(stderr, "Could not send packet for encoding (error '%s')\n", + av_err2str(error)); + goto cleanup; } /* Receive one encoded frame from the encoder. */ @@ -857,7 +858,6 @@ int main(int argc, char **argv) int data_written; /* Flush the encoder as it may have delayed frames. */ do { - data_written = 0; if (encode_audio_frame(NULL, output_format_context, output_codec_context, &data_written)) goto cleanup; -- 2.30.2 LGTM. can someone apply this? Ping again See the reply about the patch no longer applying. I did already rebase the patch in v2. There have been no changes to the file since. ___ 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 2/2] lavfi: Add blurriness filter
Am 23.04.22 um 15:32 schrieb Thilo Borgmann: Hi, v3 updated to current HEAD. Named blurdetect filter now. Minor fixes on allocation and removed -f option. Please make this per plane filtering, with default to measure only first plane. done in v4. (Will add Changelog, version.h and fate test once the filter itself looks ok) Ping. v5 according to IRC comments. v6 (1/2 and 2/2) according to IRC comments. LGTM'd there, applying soon. Added Changelog, version.h, FATE. Thanks! ThiloFrom c90120255bff305ce76c7677c9063d94c3bb99f7 Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Tue, 30 Nov 2021 00:16:52 +0100 Subject: [PATCH v6 1/2] lafi/vf_edgedetect: Move some common functions into seperate file --- libavfilter/Makefile| 2 +- libavfilter/edge_common.c | 181 +++ libavfilter/edge_common.h | 107 + libavfilter/vf_edgedetect.c | 183 ++-- 4 files changed, 296 insertions(+), 177 deletions(-) create mode 100644 libavfilter/edge_common.c create mode 100644 libavfilter/edge_common.h diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 32521a4836..38ca379e5a 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -266,7 +266,7 @@ OBJS-$(CONFIG_DRAWBOX_FILTER)+= vf_drawbox.o OBJS-$(CONFIG_DRAWGRAPH_FILTER) += f_drawgraph.o OBJS-$(CONFIG_DRAWGRID_FILTER) += vf_drawbox.o OBJS-$(CONFIG_DRAWTEXT_FILTER) += vf_drawtext.o -OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o +OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o edge_common.o OBJS-$(CONFIG_ELBG_FILTER) += vf_elbg.o OBJS-$(CONFIG_ENTROPY_FILTER)+= vf_entropy.o OBJS-$(CONFIG_EPX_FILTER)+= vf_epx.o diff --git a/libavfilter/edge_common.c b/libavfilter/edge_common.c new file mode 100644 index 00..d72e8521cd --- /dev/null +++ b/libavfilter/edge_common.c @@ -0,0 +1,181 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "edge_common.h" + +// Internal helper for ff_sobel() +static int get_rounded_direction(int gx, int gy) +{ +/* reference angles: + * tan( pi/8) = sqrt(2)-1 + * tan(3pi/8) = sqrt(2)+1 + * Gy/Gx is the tangent of the angle (theta), so Gy/Gx is compared against + * , or more simply Gy against *Gx + * + * Gx and Gy bounds = [-1020;1020], using 16-bit arithmetic: + * round((sqrt(2)-1) * (1<<16)) = 27146 + * round((sqrt(2)+1) * (1<<16)) = 158218 + */ +if (gx) { +int tanpi8gx, tan3pi8gx; + +if (gx < 0) +gx = -gx, gy = -gy; +gy *= (1 << 16); +tanpi8gx = 27146 * gx; +tan3pi8gx = 158218 * gx; +if (gy > -tan3pi8gx && gy < -tanpi8gx) return DIRECTION_45UP; +if (gy > -tanpi8gx && gy < tanpi8gx) return DIRECTION_HORIZONTAL; +if (gy > tanpi8gx && gy < tan3pi8gx) return DIRECTION_45DOWN; +} +return DIRECTION_VERTICAL; +} + +// Simple sobel operator to get rounded gradients +void ff_sobel(int w, int h, +uint16_t *dst, int dst_linesize, +int8_t *dir, int dir_linesize, +const uint8_t *src, int src_linesize) +{ +int i, j; + +for (j = 1; j < h - 1; j++) { +dst += dst_linesize; +dir += dir_linesize; +src += src_linesize; +for (i = 1; i < w - 1; i++) { +const int gx = +-1*src[-src_linesize + i-1] + 1*src[-src_linesize + i+1] +-2*src[i-1] + 2*src[i+1] +-1*src[ src_linesize + i-1] + 1*src[ src_linesize + i+1]; +const int gy = +-1*src[-src_linesize + i-1] + 1*src[ src_linesize + i-1] +-2*src[-src_linesize + i ] + 2*src[ src_linesize + i ] +-1*src[-src_linesize + i+1] + 1*src[ src_linesize + i+1]; + +dst[i] = FFABS(gx) + FFABS(gy); +dir[i] = get_rounded_direction(gx, gy); +} +} +} + +// Filters rounded gradients to drop all non-maxima +// Expects gradients generated by ff_sobel() +// Expects zero's destination buffer +void ff_non_maximum
Re: [FFmpeg-devel] [PATCH] avdevice/dshow: reuse unused variables.
Ping for the below. On Tue, Apr 19, 2022 at 10:13 AM Diederick Niehorster wrote: > > Fix for f125c504d8fece6420bb97767f9e72414c26312a, requested_sample_rate > and such should be used. > > Signed-off-by: Diederick Niehorster > --- > libavdevice/dshow.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c > index 1e69620880..5946a72cc2 100644 > --- a/libavdevice/dshow.c > +++ b/libavdevice/dshow.c > @@ -1003,9 +1003,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum > dshowDeviceType devtype, > continue; > } > if ( > -(ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) > || > -(ctx->sample_size && ctx->sample_size != fx->wBitsPerSample) > || > -(ctx->channels&& ctx->channels!= fx->nChannels ) > +(requested_sample_rate && requested_sample_rate != > fx->nSamplesPerSec) || > +(requested_sample_size && requested_sample_size != > fx->wBitsPerSample) || > +(requested_channels&& requested_channels!= > fx->nChannels ) > ) { > goto next; > } > -- > 2.28.0.windows.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] avformat/mov: Only read the primary item for AVIF
Update the still AVIF parser to only read the primary item. With this patch, AVIF still images with exif/icc/alpha channel will no longer fail to parse. For example, this patch enables parsing of files in: https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Microsoft Partially fixes trac ticket #7621 Signed-off-by: Vignesh Venkatasubramanian --- libavformat/isom.h | 1 + libavformat/mov.c | 41 + 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/libavformat/isom.h b/libavformat/isom.h index cf36f04d5b..f05c2d9c28 100644 --- a/libavformat/isom.h +++ b/libavformat/isom.h @@ -317,6 +317,7 @@ typedef struct MOVContext { uint32_t mfra_size; uint32_t max_stts_delta; int is_still_picture_avif; +int primary_item_id; } MOVContext; int ff_mp4_read_descr_len(AVIOContext *pb); diff --git a/libavformat/mov.c b/libavformat/mov.c index 3e83e54a77..6be0f317ca 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7449,6 +7449,13 @@ static int rb_size(AVIOContext *pb, uint64_t* value, int size) return size; } +static int mov_read_pitm(MOVContext *c, AVIOContext *pb, MOVAtom atom) +{ +avio_rb32(pb); // version & flags. +c->primary_item_id = avio_rb16(pb); +return atom.size; +} + static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) { int version, offset_size, length_size, base_offset_size, index_size; @@ -7505,34 +7512,25 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) return AVERROR_PATCHWELCOME; } item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); -if (item_count > 1) { -// For still AVIF images, we only support one item. Second item will -// generally be found for AVIF images with alpha channel. We don't -// support them as of now. -av_log(c->fc, AV_LOG_ERROR, "iloc: item_count > 1 not supported.\n"); -return AVERROR_PATCHWELCOME; -} // Populate the necessary fields used by mov_build_index. -sc->stsc_count = item_count; -sc->stsc_data = av_malloc_array(item_count, sizeof(*sc->stsc_data)); +sc->stsc_count = 1; +sc->stsc_data = av_malloc_array(1, sizeof(*sc->stsc_data)); if (!sc->stsc_data) return AVERROR(ENOMEM); sc->stsc_data[0].first = 1; sc->stsc_data[0].count = 1; sc->stsc_data[0].id = 1; -sc->chunk_count = item_count; -sc->chunk_offsets = -av_malloc_array(item_count, sizeof(*sc->chunk_offsets)); +sc->chunk_count = 1; +sc->chunk_offsets = av_malloc_array(1, sizeof(*sc->chunk_offsets)); if (!sc->chunk_offsets) return AVERROR(ENOMEM); -sc->sample_count = item_count; -sc->sample_sizes = -av_malloc_array(item_count, sizeof(*sc->sample_sizes)); +sc->sample_count = 1; +sc->sample_sizes = av_malloc_array(1, sizeof(*sc->sample_sizes)); if (!sc->sample_sizes) return AVERROR(ENOMEM); -sc->stts_count = item_count; -sc->stts_data = av_malloc_array(item_count, sizeof(*sc->stts_data)); +sc->stts_count = 1; +sc->stts_data = av_malloc_array(1, sizeof(*sc->stts_data)); if (!sc->stts_data) return AVERROR(ENOMEM); sc->stts_data[0].count = 1; @@ -7540,7 +7538,7 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->stts_data[0].duration = 0; for (int i = 0; i < item_count; i++) { -(version < 2) ? avio_rb16(pb) : avio_rb32(pb); // item_id; +int item_id = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); if (version > 0) avio_rb16(pb); // construction_method. avio_rb16(pb); // data_reference_index. @@ -7556,8 +7554,10 @@ static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) if (rb_size(pb, &extent_offset, offset_size) < 0 || rb_size(pb, &extent_length, length_size) < 0) return AVERROR_INVALIDDATA; -sc->sample_sizes[0] = extent_length; -sc->chunk_offsets[0] = base_offset + extent_offset; +if (item_id == c->primary_item_id) { +sc->sample_sizes[0] = extent_length; +sc->chunk_offsets[0] = base_offset + extent_offset; +} } } @@ -7674,6 +7674,7 @@ static const MOVParseTableEntry mov_default_parse_table[] = { { MKTAG('S','A','3','D'), mov_read_SA3D }, /* ambisonic audio box */ { MKTAG('S','A','N','D'), mov_read_SAND }, /* non diegetic audio box */ { MKTAG('i','l','o','c'), mov_read_iloc }, +{ MKTAG('p','i','t','m'), mov_read_pitm }, { 0, NULL } }; -- 2.36.0.rc2.479.g8af0fa9b8e-goog ___ 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/mov: Add avif to list of supported extensions
AVIF still and animations are now supported by the MOV parser. Add the "avif" extension to the list of supported extensions to AVInputFormat. Signed-off-by: Vignesh Venkatasubramanian --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 3e83e54a77..26aeeaea0c 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -9036,7 +9036,7 @@ const AVInputFormat ff_mov_demuxer = { .long_name = NULL_IF_CONFIG_SMALL("QuickTime / MOV"), .priv_class = &mov_class, .priv_data_size = sizeof(MOVContext), -.extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v", +.extensions = "mov,mp4,m4a,3gp,3g2,mj2,psp,m4b,ism,ismv,isma,f4v,avif", .flags_internal = FF_FMT_INIT_CLEANUP, .read_probe = mov_probe, .read_header= mov_read_header, -- 2.36.0.rc2.479.g8af0fa9b8e-goog ___ 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/mov: Add support for still image AVIF parsing
On Sat, Apr 23, 2022 at 1:14 AM Gyan Doshi wrote: > > Removed some trailing whitespace, edited commit msg and pushed as > 499e245b856733c3bbcd3ba23b406729343ed5fe > Thanks for merging! > Consider adding avif to extensions in the AVInputFormat Sorry this was an oversight. I thought I had already done this. I have sent another patch to do this: http://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295648.html > > Regards, > Gyan > > On 2022-04-23 12:29 am, Vignesh Venkatasubramanian wrote: > > Add support for parsing AVIF still images. This patches supports > > AVIF still images that have exactly 1 item (i.e.) no alpha channel. > > Essentially, we will have to parse the "iloc" box and populate > > the mov index. > > > > With this patch, we can decode still AVIF images like so: > > ffmpeg -i image.avif image.png > > > > Partially fixes trac ticket #7621 > > > > Signed-off-by: Vignesh Venkatasubramanian > > --- > > libavformat/isom.h | 1 + > > libavformat/mov.c | 141 + > > 2 files changed, 142 insertions(+) > > > > diff --git a/libavformat/isom.h b/libavformat/isom.h > > index 5caf42b15d..02d681e3ae 100644 > > --- a/libavformat/isom.h > > +++ b/libavformat/isom.h > > @@ -315,6 +315,7 @@ typedef struct MOVContext { > > int have_read_mfra_size; > > uint32_t mfra_size; > > uint32_t max_stts_delta; > > +int is_still_picture_avif; > > } MOVContext; > > > > int ff_mp4_read_descr_len(AVIOContext *pb); > > diff --git a/libavformat/mov.c b/libavformat/mov.c > > index 6c847de164..39feb9fba6 100644 > > --- a/libavformat/mov.c > > +++ b/libavformat/mov.c > > @@ -1136,6 +1136,7 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext > > *pb, MOVAtom atom) > > c->isom = 1; > > av_log(c->fc, AV_LOG_DEBUG, "ISO: File Type Major Brand: > > %.4s\n",(char *)&type); > > av_dict_set(&c->fc->metadata, "major_brand", type, 0); > > +c->is_still_picture_avif = !strncmp(type, "avif", 4); > > minor_ver = avio_rb32(pb); /* minor version */ > > av_dict_set_int(&c->fc->metadata, "minor_version", minor_ver, 0); > > > > @@ -7430,6 +7431,145 @@ static int mov_read_SAND(MOVContext *c, AVIOContext > > *pb, MOVAtom atom) > > return 0; > > } > > > > +static int rb_size(AVIOContext *pb, uint64_t* value, int size) > > +{ > > +if (size == 0) > > +*value = 0; > > +else if (size == 1) > > +*value = avio_r8(pb); > > +else if (size == 2) > > +*value = avio_rb16(pb); > > +else if (size == 4) > > +*value = avio_rb32(pb); > > +else if (size == 8) > > +*value = avio_rb64(pb); > > +else > > +return -1; > > +return size; > > +} > > + > > +static int mov_read_iloc(MOVContext *c, AVIOContext *pb, MOVAtom atom) > > +{ > > +int version, offset_size, length_size, base_offset_size, index_size; > > +int item_count, extent_count; > > +uint64_t base_offset, extent_offset, extent_length; > > +uint8_t value; > > +AVStream *st; > > +MOVStreamContext *sc; > > + > > +if (!c->is_still_picture_avif) { > > +// * For non-avif, we simply ignore the iloc box. > > +// * For animated avif, we don't care about the iloc box as all the > > +// necessary information can be found in the moov box. > > +return 0; > > +} > > + > > +if (c->fc->nb_streams) { > > +av_log(c->fc, AV_LOG_INFO, "Duplicate iloc box found\n"); > > +return 0; > > +} > > + > > +st = avformat_new_stream(c->fc, NULL); > > +if (!st) > > +return AVERROR(ENOMEM); > > +st->id = c->fc->nb_streams; > > +sc = av_mallocz(sizeof(MOVStreamContext)); > > +if (!sc) > > +return AVERROR(ENOMEM); > > + > > +st->priv_data = sc; > > +st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; > > +st->codecpar->codec_id = AV_CODEC_ID_AV1; > > +sc->ffindex = st->index; > > +c->trak_index = st->index; > > +st->avg_frame_rate.num = st->avg_frame_rate.den = 1; > > +st->time_base.num = st->time_base.den = 1; > > +st->nb_frames = 1; > > +sc->time_scale = 1; > > +sc = st->priv_data; > > +sc->pb = c->fc->pb; > > +sc->pb_is_copied = 1; > > + > > +version = avio_r8(pb); > > +avio_rb24(pb); // flags. > > + > > +value = avio_r8(pb); > > +offset_size = (value >> 4) & 0xF; > > +length_size = value & 0xF; > > +value = avio_r8(pb); > > +base_offset_size = (value >> 4) & 0xF; > > +index_size = !version ? 0 : (value & 0xF); > > +if (index_size) { > > +av_log(c->fc, AV_LOG_ERROR, "iloc: index_size != 0 not > > supported.\n"); > > +return AVERROR_PATCHWELCOME; > > +} > > +item_count = (version < 2) ? avio_rb16(pb) : avio_rb32(pb); > > +if (item_count > 1) { > > +// For still AVIF images, we only support one item. Second item > > will > > +// generally be found for AVIF images with alpha channel. We don't > > +
Re: [FFmpeg-devel] [PATCH] avformat/mov: Add support for still image AVIF parsing
On Thu, Apr 21, 2022 at 9:16 AM Vignesh Venkatasubramanian wrote: > > On Thu, Apr 21, 2022 at 2:08 AM Gyan Doshi wrote: > > > > > > > > On 2022-04-20 09:54 am, Gyan Doshi wrote: > > > > > > > > > On 2022-04-20 02:49 am, Paul B Mahol wrote: > > >> On Tue, Apr 19, 2022 at 10:57 PM Vignesh Venkatasubramanian < > > >> vigneshv-at-google@ffmpeg.org> wrote: > > >> > > >>> Add support for parsing AVIF still images. This patches supports > > >>> AVIF still images that have exactly 1 item (i.e.) no alpha channel. > > >>> Essentially, we will have to parse the "iloc" box and populate > > >>> the mov index. > > >>> > > >>> With this patch, we can decode still AVIF images like so: > > >>> ffmpeg -i image.avif image.png > > >>> > > >>> Partially fixes trac ticket #7621 > > >>> > > >> LGTM > > > > > > Will push tomorrow if no one else has. > > > > Can you provide a sample AVIF image and command that this patch allows > > decoding of? > > > > I tried a couple of samples from Netflix[1] and MS[2] and none worked, > > even with forcing MOV demuxer ("moov atom not found" or "error reading > > header"). > > Thanks for verifying. The test files you tried are invalid/not > supported by this patch. Please see the explanation below. > > > > > [1]: http://download.opencontent.netflix.com/?prefix=AV1/Chimera/AVIF/ > > These files are not valid AVIF since they don't have the major brand > set to "mif1" and not "avif". They are also missing a few other > mandatory boxes. libavif (the reference AVIF library) also is not able > to parse these files. These files were likely made when the AVIF > specification was not yet finalized. > > $ ./avifdec --info Chimera-AV1-8bit-1280x720-3363kbps-100.avif > ERROR: Failed to decode image: BMFF parsing failed > Diagnostics: > * [Strict] Item ID 1 of type 'av01' is missing mandatory pixi property > > > [2]: > > https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Microsoft > > > > These files have EXIF metadata and will contain more than one item > entry in the iloc box. This patch does not support that (however, i > have a follow-up patch to fix this). The files in this directory > return AVERROR_PATCHWELCOME as intended. > The follow-up patch for supporting the files in the "Microsoft" subdirectory is here: http://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295647.html > For a set of working AVIF files that are supported by this patch you > can try the files under "Link-U" and "Netflix" subdirectories of this repo: > > https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Link-U > > https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles/Netflix/avif > > The command is as mentioned in the commit message: > ./ffmpeg -i output.png > > Please let me know if you have more questions. Thank you! > > > > Regards, > > Gyan > > > > > > ___ > > ffmpeg-devel mailing list > > ffmpeg-devel@ffmpeg.org > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel > > > > To unsubscribe, visit link above, or email > > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe". > > > > -- > Vignesh -- Vignesh ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] lavfi: Add blurriness filter
Am 24.04.22 um 19:28 schrieb Thilo Borgmann: Am 23.04.22 um 15:32 schrieb Thilo Borgmann: Hi, v3 updated to current HEAD. Named blurdetect filter now. Minor fixes on allocation and removed -f option. Please make this per plane filtering, with default to measure only first plane. done in v4. (Will add Changelog, version.h and fate test once the filter itself looks ok) Ping. v5 according to IRC comments. v6 (1/2 and 2/2) according to IRC comments. LGTM'd there, applying soon. Added Changelog, version.h, FATE. v7: removed useless debug garbage. Still applying soon. -ThiloFrom 2879cfd94358aa977dd7f4314f931fb782750f96 Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Mon, 25 Apr 2022 00:01:51 +0200 Subject: [PATCH v7 2/2] lavfi: Add blurdetect filter --- Changelog | 1 + doc/filters.texi| 52 +++ libavfilter/Makefile| 1 + libavfilter/allfilters.c| 1 + libavfilter/version.h | 2 +- libavfilter/vf_blurdetect.c | 395 tests/fate/filter-video.mak | 3 + tests/ref/fate/filter-refcmp-blurdetect-yuv | 10 + 8 files changed, 464 insertions(+), 1 deletion(-) create mode 100644 libavfilter/vf_blurdetect.c create mode 100644 tests/ref/fate/filter-refcmp-blurdetect-yuv diff --git a/Changelog b/Changelog index 7a63e3d1ee..4d467eb741 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ version 5.1: - pixelize video filter - colormap video filter - colorchart video source filter +- blurdetect filter version 5.0: diff --git a/doc/filters.texi b/doc/filters.texi index c8699b9099..499f3adcd9 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -7997,6 +7997,58 @@ tblend=all_mode=grainextract @subsection Commands This filter supports same @ref{commands} as options. +@anchor{blurdetect} +@section blurdetect + +Determines blurriness of frames without altering the input frames. + +Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. + +The filter accepts the following options: + +@table @option +@item low +@item high +Set low and high threshold values used by the Canny thresholding +algorithm. + +The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. + +@var{low} and @var{high} threshold values must be chosen in the range +[0,1], and @var{low} should be lesser or equal to @var{high}. + +Default value for @var{low} is @code{20/255}, and default value for @var{high} +is @code{50/255}. + +@item radius +Define the radius to search around an edge pixel for local maxima. + +@item block_pct +Determine blurriness only for the most significant blocks, given in percentage. + +@item block_width +Determine blurriness for blocks of width @var{block_width}. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of @var{block_height}. + +@item block_height +Determine blurriness for blocks of height @var{block_height}. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of @var{block_width}. + +@item planes +Set planes to filter. Default is first only. +@end table + +@subsection Examples + +@itemize +@item +Determine blur for 80% of most significant 32x32 blocks: +@example +blurdetect=block_width=32:block_height=32:block_pct=80 +@end example +@end itemize + @section bm3d Denoise frames using Block-Matching 3D algorithm. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 38ca379e5a..1db097b464 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -195,6 +195,7 @@ OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o OBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o framesync.o OBJS-$(CONFIG_BLEND_VULKAN_FILTER) += vf_blend_vulkan.o framesync.o vulkan.o vulkan_filter.o +OBJS-$(CONFIG_BLURDETECT_FILTER) += vf_blurdetect.o edge_common.o OBJS-$(CONFIG_BM3D_FILTER) += vf_bm3d.o framesync.o OBJS-$(CONFIG_BOXBLUR_FILTER)+= vf_boxblur.o boxblur.o OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 36fa3ae8d7..2ad523fd0f 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -183,6 +183,7 @@ extern const AVFilter ff_vf_blackdetect; extern const AVFilter ff_vf_blackframe; extern const AVFilter ff_vf_blend; extern const AVFilter ff_vf_blend_vulkan; +extern const AVFilter ff_vf_blurdetect; extern const AVFilter ff_vf_bm3d; extern const AVFilter ff_vf_boxblur; extern const AVFilter ff_vf_boxblur_opencl; diff --git a/libavfilter/version.h b/libavfilter/version.h index 9add1
Re: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi
> -Original Message- > From: ffmpeg-devel On Behalf Of nil- > admir...@mailo.com > Sent: Sunday, April 24, 2022 2:08 PM > To: ffmpeg-devel@ffmpeg.org > Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] > libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and > utf8toansi > > > 1. Patch 3/6 - Replace LoadLibraryExA with LoadLibraryExW > > What's the point in making changes to library loading? What does it > fix? > > > > From the commit https://ffmpeg.org/pipermail/ffmpeg-devel/2022- > April/295571.html: > > ... the path length limitation is only lifted for file APIs that pass > paths as wchar_t... You normally don't load libraries from such longs paths. As I had written previously (but stripped off by you): Could you please give an example of a situation that this is supposed to fix? Which dll do you think would need to be loaded from a long path? > > 2. Patches 5/6 and 6/6 - Add Fusion Manifest > > ... > > Both of these manifest attributes are affecting the runtime behavior > of > > an application running on Windows - but only starting from a certain > > OS version. > > ... you would need to check the operating system version > > before using to make sure that you are providing parameters in the > "right" > > way - I'm not sure whether that would make much sense. > > > The same can be said about e.g. DirectX 11 hardware acceleration, > which is available > only starting with Windows 7; and you have to check OS version before > providing > parameters that enable it. Does not mean implementing that feature > made no sense, > since it made FFmpeg inconsistent with previous versions of Windows. > Consistency > > with the greatest common denominator does not make much sense. Your example is making a comparison that is not quite valid IMO. The use of DirectX 11 is a very specific feature and that surely involves checking of availability. But file IO is a fundamental feature where a common and predictable behavior is crucial. > > 3. All Patches x/6 - Remove MAX_PATH limit > > The punch line sounds compelling. But how is the current situation > and > > what exactly would be the benefit? > > All patches with that line replace MAX_PATH-sized buffers with > dynamically-allocated > > buffers of potentially arbitrary size. If application continues to use > fixed-size buffers, > > it's not long path aware, regardless of the manifest. That's true, but the file IO in ffmpeg does not use MAX_PATH buffers, so it's only about those few specific cases: Patch 2/6: Removing the fixed-size buffer is surely a good change, but can't you just completely remove the charset conversion and use the same file IO patterns that ffmpeg is using everywhere else? Patch 3/6: see 1. Patch 4/6: Seems to be pointless because you cannot run ffmpeg.exe from a long path anyway. Neither with cmd nor with powershell. Even if you could, it would be a pretty exotic use case. > It is neither predictable nor reliable. Please check > https://googleprojectzero.blogspot.com/2016/02/the-definitive-guide- > on-win32-to-nt.html > > for things like “I actually exploited this behaviour to create > arbitrary named pipes from the Chrome sandbox awhile back.” I know about that. But it's something that is possible now already and would be still possible after applying your patchset. So, that's not a relevant point in this regard. > > 1. Windows version needs to be >= 1903 > > (for being able to have both attributes in effect) > For all intents and purposes, versions of Windows < 1903 have EOLed. > Exceptions: > > - Windows 8.1 will EOL in January 2023, > - LTSB/LTSC branches of Windows 10 before 21H2. And the servers? And all those which are still using older versions?` > > 3. A registry key or group policy needs to be set on Windows to > enable this > > ´ (in both cases, administrative permission/UAC is required to set > it) > > 4. Even when registry key or group policy is set, it might still be > pending > > a reboot > > Is it a big deal to change a registry and reboot? Yes it is. Especially when you don't know that it's needed or whether it's needed or when it is needed. Also it requires administrative permissions which not everybody has. Further it's a serious change to OS behavior and you cannot expect that all users are educated enough for being able to make this decision and be confident that it won't have any unexpected side effects. > > On the other side, there's a risk of regressions by adding those > manifest > > attributes. > > Adding anything risks regressions, how manifest is supposed to be > different from any other patch? That's what I tried to explain. "Any other patch" makes a change after which you know that the change has been made. But adding those attributes will impose changes that will be effective under ce
Re: [FFmpeg-devel] [PATCH] avdevice/dshow: reuse unused variables.
On 4/19/2022 5:13 AM, Diederick Niehorster wrote: Fix for f125c504d8fece6420bb97767f9e72414c26312a, requested_sample_rate and such should be used. Signed-off-by: Diederick Niehorster --- libavdevice/dshow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 1e69620880..5946a72cc2 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -1003,9 +1003,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, continue; } if ( -(ctx->sample_rate && ctx->sample_rate != fx->nSamplesPerSec) || -(ctx->sample_size && ctx->sample_size != fx->wBitsPerSample) || -(ctx->channels&& ctx->channels!= fx->nChannels ) +(requested_sample_rate && requested_sample_rate != fx->nSamplesPerSec) || +(requested_sample_size && requested_sample_size != fx->wBitsPerSample) || +(requested_channels&& requested_channels!= fx->nChannels ) ) { goto next; } Will apply. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-devel] [PATCH 2/2] lavfi: Add blurriness filter
Am 25.04.22 um 00:03 schrieb Thilo Borgmann: Am 24.04.22 um 19:28 schrieb Thilo Borgmann: Am 23.04.22 um 15:32 schrieb Thilo Borgmann: Hi, v3 updated to current HEAD. Named blurdetect filter now. Minor fixes on allocation and removed -f option. Please make this per plane filtering, with default to measure only first plane. done in v4. (Will add Changelog, version.h and fate test once the filter itself looks ok) Ping. v5 according to IRC comments. v6 (1/2 and 2/2) according to IRC comments. LGTM'd there, applying soon. Added Changelog, version.h, FATE. v7: removed useless debug garbage. Still applying soon. v8: and now even with adapted FATE. -ThiloFrom 72f1631e8994e15eac58c5c9a8c0fcf14ef627ad Mon Sep 17 00:00:00 2001 From: Thilo Borgmann Date: Mon, 25 Apr 2022 00:07:04 +0200 Subject: [PATCH v8 2/2] lavfi: Add blurdetect filter --- Changelog | 1 + doc/filters.texi| 52 +++ libavfilter/Makefile| 1 + libavfilter/allfilters.c| 1 + libavfilter/version.h | 2 +- libavfilter/vf_blurdetect.c | 395 tests/fate/filter-video.mak | 3 + tests/ref/fate/filter-refcmp-blurdetect-yuv | 10 + 8 files changed, 464 insertions(+), 1 deletion(-) create mode 100644 libavfilter/vf_blurdetect.c create mode 100644 tests/ref/fate/filter-refcmp-blurdetect-yuv diff --git a/Changelog b/Changelog index 7a63e3d1ee..4d467eb741 100644 --- a/Changelog +++ b/Changelog @@ -13,6 +13,7 @@ version 5.1: - pixelize video filter - colormap video filter - colorchart video source filter +- blurdetect filter version 5.0: diff --git a/doc/filters.texi b/doc/filters.texi index c8699b9099..499f3adcd9 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -7997,6 +7997,58 @@ tblend=all_mode=grainextract @subsection Commands This filter supports same @ref{commands} as options. +@anchor{blurdetect} +@section blurdetect + +Determines blurriness of frames without altering the input frames. + +Based on Marziliano, Pina, et al. "A no-reference perceptual blur metric." +Allows for a block-based abbreviation. + +The filter accepts the following options: + +@table @option +@item low +@item high +Set low and high threshold values used by the Canny thresholding +algorithm. + +The high threshold selects the "strong" edge pixels, which are then +connected through 8-connectivity with the "weak" edge pixels selected +by the low threshold. + +@var{low} and @var{high} threshold values must be chosen in the range +[0,1], and @var{low} should be lesser or equal to @var{high}. + +Default value for @var{low} is @code{20/255}, and default value for @var{high} +is @code{50/255}. + +@item radius +Define the radius to search around an edge pixel for local maxima. + +@item block_pct +Determine blurriness only for the most significant blocks, given in percentage. + +@item block_width +Determine blurriness for blocks of width @var{block_width}. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of @var{block_height}. + +@item block_height +Determine blurriness for blocks of height @var{block_height}. If set to any value smaller 1, no blocks are used and the whole image is processed as one no matter of @var{block_width}. + +@item planes +Set planes to filter. Default is first only. +@end table + +@subsection Examples + +@itemize +@item +Determine blur for 80% of most significant 32x32 blocks: +@example +blurdetect=block_width=32:block_height=32:block_pct=80 +@end example +@end itemize + @section bm3d Denoise frames using Block-Matching 3D algorithm. diff --git a/libavfilter/Makefile b/libavfilter/Makefile index 38ca379e5a..1db097b464 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -195,6 +195,7 @@ OBJS-$(CONFIG_BLACKDETECT_FILTER)+= vf_blackdetect.o OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o OBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o framesync.o OBJS-$(CONFIG_BLEND_VULKAN_FILTER) += vf_blend_vulkan.o framesync.o vulkan.o vulkan_filter.o +OBJS-$(CONFIG_BLURDETECT_FILTER) += vf_blurdetect.o edge_common.o OBJS-$(CONFIG_BM3D_FILTER) += vf_bm3d.o framesync.o OBJS-$(CONFIG_BOXBLUR_FILTER)+= vf_boxblur.o boxblur.o OBJS-$(CONFIG_BOXBLUR_OPENCL_FILTER) += vf_avgblur_opencl.o opencl.o \ diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c index 36fa3ae8d7..2ad523fd0f 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -183,6 +183,7 @@ extern const AVFilter ff_vf_blackdetect; extern const AVFilter ff_vf_blackframe; extern const AVFilter ff_vf_blend; extern const AVFilter ff_vf_blend_vulkan; +extern const AVFilter ff_vf_blurdetect; extern const AVFilter ff_vf_bm3d; extern const AVFilter ff_vf_boxblur; extern const AVFilter ff_vf_bo
Re: [FFmpeg-devel] [PATCH] avcodec/audiotoolboxdec: Properly fill out_format
On 12/31/2021 2:23 AM, Christopher Snowhill wrote: Monterey needs mBytesPerFrame and mBytesPerPacket to be set, and I'm surprised this didn't break any previous system versions. Fixes bug #9564: Cannot decode xHE-AAC with audiotoolbox (aac_at) on Mac OS Monterey. Fixes likely bug that none of the AudioToolbox decoders work on Monterey. Signed-off-by: Christopher Snowhill --- libavcodec/audiotoolboxdec.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c index 9939fef218..4abcb63a03 100644 --- a/libavcodec/audiotoolboxdec.c +++ b/libavcodec/audiotoolboxdec.c @@ -370,6 +370,11 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, avctx->sample_rate = out_format.mSampleRate = in_format.mSampleRate; avctx->channels = out_format.mChannelsPerFrame = in_format.mChannelsPerFrame; +out_format.mBytesPerFrame = +out_format.mChannelsPerFrame * (out_format.mBitsPerChannel / 8); +out_format.mBytesPerPacket = +out_format.mBytesPerFrame * out_format.mFramesPerPacket; + if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_QT) in_format.mFramesPerPacket = 64; Applied. ___ 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] lavf/tls_mbedtls: add support for mbedtls version 3
On 24.04.2022 01:32, Timo Rothenpieler wrote: - certs.h is gone. Only contains test data, and was not used at all. - config.h is renamed. Was seemingly not used, so can be removed. - MBEDTLS_ERR_SSL_NO_USABLE_CIPHERSUITE is gone, instead MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE will be thrown. - mbedtls_pk_parse_keyfile now needs to be passed a properly seeded RNG. Hence, move the call to after RNG seeding. I'd really like some review on this, and merge it rather sooner than later. Also, I think this should be backported to all currently maintained branches, since mbedtls<3 is no longer maintained, so lack of support for recent versions is a potential security issue. Would hate to just push it without review, even though it looks trivial enough to me, it is touching TLS code. ___ 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] FFmpeg 5.0 LTS vs 5.1 LTS
> -Original Message- > From: ffmpeg-devel On Behalf Of > Michael Niedermayer > Sent: Saturday, April 23, 2022 6:36 PM > To: FFmpeg development discussions and patches de...@ffmpeg.org> > Subject: [FFmpeg-devel] FFmpeg 5.0 LTS vs 5.1 LTS > > Hi all > > Do people prefer that 5.0 becomes LTS or the next (5.1) ? > Or something else ? @Anton - I'm wondering how your multi-threading transformations to ffmpeg.c would align with the release schedule? I think an LTS release should be either before or after the series of changes you are planning. It would be unfortunate when 5.1 would be somewhere in the middle of those changes and become LTS. (as you said it could take a year in the worst case) Thanks, softworkz ___ 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] 2nd ping
look good for me On Thu, Apr 21, 2022 at 9:55 PM MCC CS wrote: > It would be great if anyone who reads this could review this small patch > (original: > https://ffmpeg.org/pipermail/ffmpeg-devel/2022-April/295351.html): > > This is a repost of the patch by Chris Snowhill who originally sent this > patch > on 31 December - which didn't receive any replies. As you can see > on https://trac.ffmpeg.org/ticket/9564 the patch is needed and works > perfectly. > > I have rebased it and recompiled it. > > Original commit description: > > Monterey needs mBytesPerFrame and mBytesPerPacket to be set, and I'm > surprised this didn't break any previous system versions. > > Fixes bug #9564: Cannot decode xHE-AAC with audiotoolbox (aac_at) on > Mac OS Monterey. Fixes likely bug that none of the AudioToolbox > decoders work on Monterey. > --- > libavcodec/audiotoolboxdec.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c > index b8d0e868f7..daccf4abf8 100644 > --- a/libavcodec/audiotoolboxdec.c > +++ b/libavcodec/audiotoolboxdec.c > @@ -375,6 +375,11 @@ static av_cold int ffat_create_decoder(AVCodecContext > *avctx, > avctx->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; > avctx->ch_layout.nb_channels = out_format.mChannelsPerFrame = > in_format.mChannelsPerFrame; > > +out_format.mBytesPerFrame = > +out_format.mChannelsPerFrame * (out_format.mBitsPerChannel / 8); > +out_format.mBytesPerPacket = > +out_format.mBytesPerFrame * out_format.mFramesPerPacket; > + > if (avctx->codec_id == AV_CODEC_ID_ADPCM_IMA_QT) > in_format.mFramesPerPacket = 64; > > -- > 2.35.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 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".