V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
sbeasy
V2EX  ›  程序员

直接将 capture 时捕获的 ID3D11Texture2D 在 GPU 内编码, 有这么做的吗

  •  
  •   sbeasy · Apr 17, 2023 · 1580 views
    This topic created in 1109 days ago, the information mentioned may be changed or developed.

    GPU 和 CPU 之间数据传输很耗费时间, 这样 GPU 和 CPU 只需要传输 h264/h265 了.

    有没有能跑通的例子, 类似这个 https://github.com/NVIDIA/video-sdk-samples/tree/master/nvEncDXGIOutputDuplicationSample, 不过我跑的时候发现 dxgi 捕获必须要在集显里.

    5 replies    2023-04-18 09:35:40 +08:00
    ysc3839
        1
    ysc3839  
       Apr 17, 2023 via Android   ❤️ 1
    为什么不行?

    另外别用 GitHub 上这个 NVIDIA video sdk ,很久没更新了。
    sbeasy
        2
    sbeasy  
    OP
       Apr 17, 2023
    新的 video_codec_sdk 已经把 Duplication 这个例子删了
    sbeasy
        3
    sbeasy  
    OP
       Apr 17, 2023
    @ysc3839 不用 gpu 厂家的 sdk, 用 ffmpeg 能做到吗
    ysc3839
        4
    ysc3839  
       Apr 17, 2023 via Android
    @sbeasy 不用私有 SDK 的话可以考虑用 Media Foundation 的 H.264 encoder
    FFmpeg 应该不支持 Media Foundation ,可以考虑用 gstreamer
    d3d11screencapturesrc 捕获,传递给 mfh264enc 即可
    https://gstreamer.freedesktop.org/documentation/d3d11/d3d11screencapturesrc.html
    https://gstreamer.freedesktop.org/documentation/mediafoundation/mfh264enc.html
    sbeasy
        5
    sbeasy  
    OP
       Apr 18, 2023
    @ysc3839 好的, 我看看 gstreamer
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2410 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 01:06 · PVG 09:06 · LAX 18:06 · JFK 21:06
    ♥ Do have faith in what you're doing.