From: Soft Works <softworkz@hotmail.com>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi
Date: Sun, 24 Apr 2022 03:39:42 +0000
Message-ID: <DM8P223MB036516F2CC12C83D25FBF7ADBAF99@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20220423205626.39039-1-nil-admirari@mailo.com>
> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of Nil
> Admirari
> Sent: Saturday, April 23, 2022 10:56 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h:
> Add whcartoutf8, wchartoansi and utf8toansi
>
> These functions are going to be used in libavformat/avisynth.c
> and fftools/cmdutils.c to remove MAX_PATH limit.
> ---
Hi,
thanks for submitting this patchset.
I'm afraid that I hadn't found time to look into this at an earlier stage,
so please apologize if one of my questions has been covered before.
1. Patch 3/6 - Replace LoadLibraryExA with LoadLibraryExW
What's the point in making changes to library loading? What does it fix?
Which dll cannot be loaded with the current implementation and what
would be the location of the dll and the location of the exe in that case?
Could you please give an example of a situation that this is supposed
to fix?
2. Patches 5/6 and 6/6 - Add Fusion Manifest
The manifest that you want to add includes two settings:
- longPathAware
effective on Windows 10, version 1607 or later
- activeCodePage
effective on Windows 10, version 1903 or later
Both of these manifest attributes are affecting the runtime behavior of
an application running on Windows - but only starting from a certain
OS version. That means - effectively you would end up having an ffmpeg
executable with three different kinds of behavior:
1. Win < 1607
2. Win >= 1607 && < 1903
3. Win >= 1903
An ffmpeg executable, where you can't rely on the exposed behavior being
consistent and where 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.
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?
What's important to understand is that the basic Windows file APIs are
supporting long (> MAX_PATH length) for a long time already.
MS has just been a bit hesitant regarding the transition and wanted to
avoid breaking changes to the API. The outcome was that long paths are
only supported when using a lower-level path syntax, which is as simple
as prepending "\\?\" to the actual path, no matter whether drive or UNC
network path.
As an example, the following command runs without issue on Windows
with a normal current ffmpeg build:
.\ffmpeg.exe -i "\\?\U:\TestMedia\This is a very long path - This is a very long path - This is a very long path - This is a very long path - This is a very long path -\This is a very long path - This is a very long path - This is a very long path - This is a very lon\aaaaaaaaaaaaaassssssssssssssdddddddddd\TestMediaThis is a very long path - This is a very long path - This is a very long path - This is a very long path - This is a very long path -This is a very long path - This is a very long path - Thi - 不要抬头.ts"
It's not only a path with len > MAX_PATH, the name also includes
Chinese (non-ANSI) characters.
All this is working in a predictable and reliable way on all common Windows
versions.
Recently, MS have taken additional effort in order to ease compatibility
and improve platform portability, by allowing applications to use ANSI
file APIs with long paths and UTF-8 charset.
BUT: there are several prerequisites for this to work:
1. Windows version needs to be >= 1903
(for being able to have both attributes in effect)
2. Application needs to be compiled with and manifest file as resource
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
SUMMARY
From my understanding, the benefit of this patchset would be:
When 1. and 2. and 3. and 4. are fulfilled (and only then) - it would be
possible to use long path names in ffmpeg _without_ prefixing it with '\\?\'
On the other side, there's a risk of regressions by adding those manifest
attributes.
I wonder whether it wouldn’t be a better idea, to simply auto-add this prefix
in the ffmpeg file handling code if:
- OS == Windows
- len > MAX_PATH
This would work on all common Windows versions and would be predictable and
reliable.
Best regards,
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-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-04-24 3:39 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-23 20:56 Nil Admirari
2022-04-23 20:56 ` [FFmpeg-devel] [PATCH v11 2/6] libavformat/avisynth.c: Remove MAX_PATH limit Nil Admirari
2022-05-07 17:55 ` Soft Works
2022-04-23 20:56 ` [FFmpeg-devel] [PATCH v11 3/6] compat/w32dlfcn.h: Remove MAX_PATH limit and replace LoadLibraryExA with LoadLibraryExW Nil Admirari
2022-06-05 11:43 ` nil-admirari
2022-04-23 20:56 ` [FFmpeg-devel] [PATCH v11 4/6] fftools/cmdutils.c: Remove MAX_PATH limit Nil Admirari
2022-04-23 20:56 ` [FFmpeg-devel] [PATCH v11 5/6] fftools: Enable long path support on Windows (fixes #8885) Nil Admirari
2022-04-26 7:07 ` Tobias Rapp
2022-04-26 7:29 ` Hendrik Leppkes
2022-04-26 8:33 ` Tobias Rapp
2022-04-29 18:08 ` nil-admirari
2022-04-23 20:57 ` [FFmpeg-devel] [PATCH v11 6/6] fftools: Set active code page to UTF-8 on Windows Nil Admirari
2022-04-24 3:39 ` Soft Works [this message]
2022-05-07 17:57 ` [FFmpeg-devel] [PATCH v11 1/6] libavutil/wchar_filename.h: Add whcartoutf8, wchartoansi and utf8toansi Soft Works
2022-04-24 12:08 nil-admirari
2022-04-24 22:04 ` Soft Works
2022-04-25 9:03 ` nil-admirari
2022-04-25 9:31 ` Soft Works
2022-04-25 9:51 ` nil-admirari
2022-04-25 11:12 ` Soft Works
2022-04-25 12:51 ` Hendrik Leppkes
2022-04-25 13:02 ` Martin Storsjö
2022-04-25 13:36 ` Soft Works
2022-04-29 19:08 ` nil-admirari
2022-04-25 13:17 ` Soft Works
2022-04-29 18:59 ` nil-admirari
2022-04-29 18:52 ` nil-admirari
2022-04-30 12:34 ` Soft Works
2022-05-05 20:20 ` nil-admirari
2022-05-05 22:38 ` Soft Works
2022-05-06 16:07 ` nil-admirari
2022-05-07 2:57 ` Soft Works
2022-05-07 17:33 ` nil-admirari
2022-05-07 17:59 ` Soft Works
2022-05-10 21:22 ` nil-admirari
2022-05-10 22:59 ` Soft Works
2022-05-10 23:32 ` Soft Works
2022-05-11 7:46 ` Tobias Rapp
2022-05-11 7:57 ` Soft Works
2022-05-11 8:08 ` Hendrik Leppkes
2022-05-11 9:03 ` nil-admirari
2022-05-11 13:32 ` Tobias Rapp
2022-05-11 20:50 ` Soft Works
2022-05-11 8:57 ` nil-admirari
2022-05-14 0:42 ` Soft Works
2022-05-15 19:53 ` nil-admirari
2022-05-15 20:34 ` Soft Works
2022-05-16 8:49 ` nil-admirari
2022-05-08 19:48 ` Martin Storsjö
2022-04-25 20:51 ` Stephen Hutchinson
2022-04-29 19:25 ` nil-admirari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM8P223MB036516F2CC12C83D25FBF7ADBAF99@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \
--to=softworkz@hotmail.com \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git