Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ffmpeg] av_log callback called with bad parameters (NULL AVClass). #728

Open
mibby opened this issue Dec 3, 2024 · 1 comment
Open

Comments

@mibby
Copy link

mibby commented Dec 3, 2024

One of the ffmpeg libraries errors when used with hwdec d3d12va-copy? Does not happen with d3d11va-copy or nvdec-copy. d3d12va-copy does correctly show up being used in the Shift + i HW: output and the video plays fine.

gpu-api=d3d11
gpu-context=d3d11
hwdec=d3d12va-copy
vo=gpu-next
profile=high-quality
mpv v0.39.0-430-ga283f66e Copyright © 2000-2024 mpv/MPlayer/mplayer2 projects
 built on Nov 30 2024 00:11:36
libplacebo version: v7.350.0 (v7.349.0-29-g5ba1376-dirty)
FFmpeg version: N-117959-g4100a2da2
FFmpeg library versions:
   libavcodec      61.26.100
   libavdevice     61.4.100
   libavfilter     10.6.101
   libavformat     61.9.100
   libavutil       59.47.101
   libswresample   5.4.100
   libswscale      8.12.100
C:\Users\Admin> mpv "D:\File.mkv"
● Video  --vid=1  --vlang=ja  (hevc 1920x1080 23.976 fps) [default]
● Audio  --aid=1  --alang=ja  'Japanese (FLAC 2.0)' (flac 2ch 48000 Hz) [default]
● Subs   --sid=1  --slang=en  'English' (ass) [default]
File tags:
 Title: File
[ffmpeg] av_log callback called with bad parameters (NULL AVClass).
[ffmpeg] This is a bug in one of FFmpeg libraries used.
Using hardware decoding (d3d12va-copy).
AO: [wasapi] 48000Hz stereo 2ch float
VO: [gpu-next] 1920x1080 p010
(Paused) AV: 00:00:00 / 00:23:36 (0%) A-V:  0.010 DS: 2.625/0 Dropped: 1
Exiting... (Quit)

Is there any way to figure out which library is causing the warning so it can possibly be fixed or forwarded upstream?

@llyyr
Copy link

llyyr commented Dec 5, 2024

Warning is caused by incorrect av_log usage by the d3d12 context code in ffmpeg

diff --git a/libavutil/hwcontext_d3d12va.c b/libavutil/hwcontext_d3d12va.c
index 6507cf69c15e..339572679001 100644
--- a/libavutil/hwcontext_d3d12va.c
+++ b/libavutil/hwcontext_d3d12va.c
@@ -660,7 +660,7 @@ static int d3d12va_device_create(AVHWDeviceContext *hwdev, const char *device,
             DXGI_ADAPTER_DESC desc;
             hr = IDXGIAdapter2_GetDesc(pAdapter, &desc);
             if (!FAILED(hr)) {
-                av_log(ctx, AV_LOG_INFO, "Using device %04x:%04x (%ls).\n",
+                av_log(hwdev, AV_LOG_INFO, "Using device %04x:%04x (%ls).\n",
                        desc.VendorId, desc.DeviceId, desc.Description);
             }
         }
@@ -668,7 +668,7 @@ static int d3d12va_device_create(AVHWDeviceContext *hwdev, const char *device,
         hr = priv->create_device((IUnknown *)pAdapter, D3D_FEATURE_LEVEL_12_0, &IID_ID3D12Device, (void **)&ctx->device);
         D3D12_OBJECT_RELEASE(pAdapter);
         if (FAILED(hr)) {
-            av_log(ctx, AV_LOG_ERROR, "Failed to create Direct 3D 12 device (%lx)\n", (long)hr);
+            av_log(hwdev, AV_LOG_ERROR, "Failed to create Direct 3D 12 device (%lx)\n", (long)hr);
             return AVERROR_UNKNOWN;
         }
     }

This might fix it but I don't use Windows so can't test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants