<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Thank you for your quick response!</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Yes, that was the way we were going to investigate next, we already had a project using Nvenc directly, but the original implementation was for OpenGL.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
We also saw there was D3D12 Video Encoding (<a class="OWAAutoLink elementToProof" id="OWA47272222-8a7f-8132-f0ef-329584f350dc" href="https://microsoft.github.io/DirectX-Specs/d3d/D3D12VideoEncoding.html">D3D12 Video Encoding | DirectX-Specs</a>) that might
also do something similar. Do you have any experience with the latter? Otherwise we'll most likely do as you say with the nvidia SDK.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
I was contacting for low latency as that is currently the problem I was having, however the reason we wanted libavcodec initially is that a few of our clients cannot agree on a codec. So we wanted the broad range of codecs supported by FFmpeg, even if that
meant a higher latency. I thought we could do a basic implementation, test the end-to-end latency and figure out from there if we needed a lower level implementation. It is only while doing the implementation that I found that even though d3d12va is supported,
the hevc_nvenc doesn't list d3d12 as a pixel format supported.</div>
<div id="appendonsend"></div>
<hr style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg">
<div style="direction: ltr; font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);">
<b>From:</b> Libav-user <libav-user-bounces@ffmpeg.org> on behalf of Ben Harper <rogojin-at-gmail.com@ffmpeg.org><br>
<b>Sent:</b> July 9, 2025 11:19 AM<br>
<b>To:</b> This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. <libav-user@ffmpeg.org><br>
<b>Subject:</b> Re: [Libav-user] Libavcodec D3D12 hevc_nvenc</div>
<div style="direction: ltr;"> </div>
</div>
<div style="direction: ltr;">Have you tried just using the nvidia SDK directly? Since you need low latency, I assume this is for some kind of realtime application, which implies you're streaming video packets. The raw video codec data is simpler than many people
imagine. It's just a stream of packets - also called NALs, or NALUs. The nvidia encoder will likely spit these out, and I'm guessing this is what your decoding side needs. You'll want avcodec for packaging those up into a .mp4 file or some other container
format. But if you're just streaming live video data, then I'm guessing you don't actually need a container file format, so the raw packets might be good enough.</div>
<div><br>
</div>
<div style="direction: ltr;">On Wed, 9 Jul 2025 at 17:12, Alex Cha <<a class="OWAAutoLink" id="OWA9c0aa5d9-a5bb-eff5-25bb-4cb6ca598d4d" href="mailto:alex-1er-at-hotmail.com@ffmpeg.org">alex-1er-at-hotmail.com@ffmpeg.org</a>> wrote:</div>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left: 1px solid rgb(204, 204, 204);">
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I was under the impression that there was hardware acceleration for D3D12 supported by ffmpeg.</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Upon implementing the solution however, we had unsupported pixel format d3d12 by the hevc_nvenc. </div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Digging further in the nvenc.c code it seems d3d12 format is not supported directly. Was there a reason for this? Looking into the nvidia documentation the encoder should support D3D12, even if it is unclear to me what needs to be done. </div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
For reference, we are trying to integrate hardware streaming using FFmpeg into a unreal engine 5 application which uses D3D12. We need a very low latency.</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
We have tried using the D3D11on12 interop without success, it is returning us "openencodesessionex failed no encode device(1)". The adapter seems to be using my RTX 4090 correctly but no success.</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Anyway, this email is a long shot in case someone as already encountered these issues and is able encode without copying to CPU.</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thanks,</div>
<div style="direction: ltr; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div>_______________________________________________<br>
Libav-user mailing list<br>
<a class="OWAAutoLink" id="OWAceded450-5a02-39e7-6c9b-1a41eef7bc23" href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a data-auth="NotApplicable" class="OWAAutoLink" id="OWA409f7978-ad7c-fd6d-af75-edf8d1002b56" href="https://ffmpeg.org/mailman/listinfo/libav-user">https://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br>
To unsubscribe, visit link above, or email<br>
<a class="OWAAutoLink" id="OWA07f5acbc-9342-9c52-6647-9128391533e2" href="mailto:libav-user-request@ffmpeg.org">libav-user-request@ffmpeg.org</a> with subject "unsubscribe".</div>
</blockquote>
</body>
</html>