[FFmpeg-devel] libavformat / vapoursynth update

2024-06-15 Thread Stefan Oltmanns via ffmpeg-devel
Hello, I updated the VapourSynth input module from the old API to the "new" API (the "new" API was introduced 4 years ago). The greatest advantage of the new API is, that it requires only a single import from the VapourSynth library, optimizing it for runtime loading instead of linking to the li

[FFmpeg-devel] [PATCH] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-06-21 Thread Stefan Oltmanns via ffmpeg-devel
Hello, this is my first patch, I hope I got all the formalities correct. The current VapourSynth implementation is rarely used, as it links the VapourSynth library at build time, making the resulting build unable to run when VapourSynth is not installed. Therefore barely anyone compiles with Vap

Re: [FFmpeg-devel] [PATCH] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-06-22 Thread Stefan Oltmanns via ffmpeg-devel
Am 22.06.24 um 08:27 schrieb Stephen Hutchinson: On 6/21/24 9:37 PM, Stefan Oltmanns via ffmpeg-devel wrote: The current VapourSynth implementation is rarely used, as it links the VapourSynth library at build time, making the resulting build unable to run when VapourSynth is not installed

Re: [FFmpeg-devel] [PATCH] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-06-22 Thread Stefan Oltmanns via ffmpeg-devel
Am 22.06.24 um 20:23 schrieb Stephen Hutchinson: On 6/22/24 6:02 AM, Stefan Oltmanns via ffmpeg-devel wrote: I don't know the extact reason, but VapourSynth is not just a library like avisynth, but an application that uses Python, meaning a lot of dependencies. If we want to be tech

[FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-06 Thread Stefan Oltmanns via ffmpeg-devel
Hello, this is revised patch, to sum up the changes: The current VapourSynth implementation is rarely used, as it links the VapourSynth library at build time, making the resulting build unable to run when VapourSynth is not installed. Therefore barely anyone compiles with VapourSynth activated.

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-18 Thread Stefan Oltmanns via ffmpeg-devel
Hello, I adressed the issues/concerns that were raised with the first revision of the patch. Any feedback? Did I do something wrong? Best regards Stefan Am 06.07.24 um 23:08 schrieb Stefan Oltmanns via ffmpeg-devel: Hello, this is revised patch, to sum up the changes: The current

Re: [FFmpeg-devel] avisynth as an internal filter, any objections?

2024-07-18 Thread Stefan Oltmanns via ffmpeg-devel
AviSynth (or better VapourSynth) as filter sounds great, but is it possible? The reason why input plugins (like FFmpegSource2) in AviSynth/VapourSynth create an index file in a first pass is to allow frame-accurate random access to the video. Also the exact number of frames of a clip has to be kno

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-18 Thread Stefan Oltmanns via ffmpeg-devel
Hi Ramiro, Am 18.07.24 um 13:08 schrieb Ramiro Polla: Hi Stefan, [...] + +#include +  struct VSState { VSScript *vss;  }; +typedef const VSSCRIPTAPI *(*VSScriptGetAPIFunc)(int version); + +typedef struct VSScriptLibrary { +    void *library; +    const VSSCRIPTAPI *vssapi; +} VSScriptL

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-18 Thread Stefan Oltmanns via ffmpeg-devel
Hi Ramiro, Am 18.07.24 um 15:04 schrieb Ramiro Polla: [...] +static VSScriptLibrary vs_script_library; Does vs_script_library have to be a global? I think it has to: ffmpeg allows multiple input files, in case you open two VapourSynth files you want to load the Library only once. It sho

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-18 Thread Stefan Oltmanns via ffmpeg-devel
Am 18.07.24 um 16:21 schrieb Ramiro Polla: On Thu, Jul 18, 2024 at 3:41 PM Stefan Oltmanns via ffmpeg-devel wrote: Am 18.07.24 um 15:04 schrieb Ramiro Polla: [...] +static VSScriptLibrary vs_script_library; Does vs_script_library have to be a global? I think it has to: ffmpeg allows

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-18 Thread Stefan Oltmanns via ffmpeg-devel
at runtime: VapourSynth is based on plugins that are loaded on runtime, so it won't work on those platforms anyway. Best regards Stefan Am 18.07.24 um 13:25 schrieb Anton Khirnov: Quoting Stefan Oltmanns via ffmpeg-devel (2024-07-18 11:37:56) Hello, I adressed the issues/concerns that w

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-21 Thread Stefan Oltmanns via ffmpeg-devel
Am 18.07.24 um 17:23 schrieb epira...@gmail.com: Well, the DLL directory is added to PATH by the VapourSynth installer, but for safety reasons ffmpeg explictly tells the LoadLibrary function to only search the application directory and system32, quote from w32dlfcn.h: /** * Safe function u

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-21 Thread Stefan Oltmanns via ffmpeg-devel
Am 22.07.24 um 00:15 schrieb Hendrik Leppkes: On Mon, Jul 22, 2024 at 12:08 AM Stefan Oltmanns via ffmpeg-devel wrote: Am 18.07.24 um 17:23 schrieb epira...@gmail.com: Well, the DLL directory is added to PATH by the VapourSynth installer, but for safety reasons ffmpeg explictly tells the

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-22 Thread Stefan Oltmanns via ffmpeg-devel
Am 22.07.24 um 14:13 schrieb Ramiro Polla: On Mon, Jul 22, 2024 at 12:15 AM Hendrik Leppkes wrote: On Mon, Jul 22, 2024 at 12:08 AM Stefan Oltmanns via ffmpeg-devel wrote: Am 18.07.24 um 17:23 schrieb epira...@gmail.com: Well, the DLL directory is added to PATH by the VapourSynth

Re: [FFmpeg-devel] [PATCH v2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-22 Thread Stefan Oltmanns via ffmpeg-devel
Am 22.07.24 um 08:57 schrieb Anton Khirnov: Quoting Stefan Oltmanns (2024-07-18 14:12:42) Hello Anton, can you eloborate on that? What is unacceptable with my patch that is perfectly fine in the AviSynth input module? It's the very same concept. It's not perfectly fine in avisynth, I dislike

[FFmpeg-devel] [PATCH v3 1/2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-23 Thread Stefan Oltmanns via ffmpeg-devel
Hello, this is revised patch, this is the first part that just updates to the API v4 of VapourSynth. Changes in API v4: -All functions previously in header are now part of the "vssapi" object -Renames of different types and functions -YCoCg is not treated as different format to YUV anymore -Some

Re: [FFmpeg-devel] [PATCH v3 2/2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-23 Thread Stefan Oltmanns via ffmpeg-devel
amount windows-specific code. Tested with 2 VapourSynth inputs on these platforms, no problems and clean exit: -Linux x86_64 (Ubuntu 22.04) -Windows 10 x86_64 -macOS 14 aarch64 Best regards Stefan Am 23.07.24 um 16:51 schrieb Stefan Oltmanns via ffmpeg-devel: Hello, this is revised patch, this

Re: [FFmpeg-devel] [PATCH v4 1/2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-28 Thread Stefan Oltmanns via ffmpeg-devel
Am 28.07.24 um 15:09 schrieb Ramiro Polla: if (st->codecpar->format == AV_PIX_FMT_NONE) { -    av_log(s, AV_LOG_ERROR, "Unsupported VS pixel format %s\n", info->format->name); +    if(vs->vsapi->getVideoFormatName(&info->format, vsfmt)) +    av_log(s, AV_LOG_ERROR, "Unsupport

Re: [FFmpeg-devel] [PATCH v3 2/2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-07-28 Thread Stefan Oltmanns via ffmpeg-devel
Am 28.07.24 um 15:15 schrieb Ramiro Polla: +    void *vslibrary = NULL; +#ifdef _WIN32 +    const HKEY hkeys[] = {HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE}; +    LONG r; +    WCHAR vss_path[512]; +    DWORD buf_size = sizeof(vss_path) - 2; +    char *vss_path_utf8; +    int i; + +    for (i = 0; i <

Re: [FFmpeg-devel] [PATCH v3 2/2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-08-11 Thread Stefan Oltmanns via ffmpeg-devel
Am 30.07.24 um 16:12 schrieb Ramiro Polla: On Mon, Jul 29, 2024 at 5:56 AM Stefan Oltmanns via ffmpeg-devel wrote: Am 28.07.24 um 15:15 schrieb Ramiro Polla: I think calling win32_dlopen() with a full path will be problematic for systems without KB2533623. win32_dlopen() might need to be

Re: [FFmpeg-devel] [PATCH v3 2/2] libavformat/vapoursynth: Update to API version 4, load library at runtime

2024-08-24 Thread Stefan Oltmanns via ffmpeg-devel
Am 23.08.24 um 14:25 schrieb Ramiro Polla: I finally managed to test the patches on a real Windows system. They both look good to me, I'll apply them in a couple of days if there are no other comments. It would be helpful to write a page in the trac wiki with a basic howto and common pitfalls.