You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support pix_fmt="cuda" in video codec context. #2199
In the current implementation, the following error occurs during the process of initializing the codec context to encode a frame in GPU memory using nvenc with pix_fmt=“cuda”.
hw_frames_ctx must be set when using GPU frames as input
Invalid argument: 'avcodec_open2("h264_nvenc", {})' returned 22
When pix_fmt=“nv12” is applied, it is presumed that the encoder copies the data to the CPU and then back to the GPU. To prevent this, I would like to modify the code so that when pix_fmt=“cuda”, it executes via the correct path.
As a possibly related issue, I have been experimenting with HWAccel recently and have run into a limitation with pix_fmt="cuda".
With frame.format.name="cuda", it is not possible to determine the underlying format, such as nv12, yuv444p, or p010le.
Should sw_format be exposed?
This information should also be required when creating hwframes for encoding.
Activity
nagadomi commentedon Mar 18, 2026
As a possibly related issue, I have been experimenting with HWAccel recently and have run into a limitation with
pix_fmt="cuda".With
frame.format.name="cuda", it is not possible to determine the underlying format, such asnv12,yuv444p, orp010le.Should
sw_formatbe exposed?This information should also be required when creating hwframes for encoding.
Encode GPU frames with pix_fmt=cuda, expose
Encode GPU frames with pix_fmt=cuda, expose