Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (108)

Sur d’autres sites (14342)

  • How can I display the frame got by FFmpeg cuvid decoder without copy to host memory ?

    21 septembre 2019, par hefty

    Nowadays I am working on a video display program using FFmpeg to decode the frames. For h264 input, I chose h264_cuvid to decode and get decoded AVFrame store in Nvidia video card’s device memory.

    Now I am using some inefficient way to display the frame by copying the hardware frame to host memory and then display :

    avcodec_receive_frame(decode_ctx, hw_frame); // Get decoded hardware frame that store in device memory.

    av_hwframe_transfer_data(sw_frame, hw_frame, flag); // Copy the hardware frame to the host memory.

    //...some code to scale and display the sw_frame.

    I want to display the hw_frame by Direct3D surface directly but I don’t know how to access the data in hw_frame and copy the pixel data to a D3D surface natively (without accessing the host memory).

    What I know is that the hw_frame’s data[0] and data[1] are CUdeviceptr pointing to the NV12 data store in device memory, anyone knows how to use the CUdeviceptr to transfer the data to a D3D surface through the device memory and display ?

  • Chromakey filter to display transparent keyboard while recording game screen using ffmpeg

    31 janvier 2020, par captain_majid

    I’m trying to display a transparent keyboard like this one (he is using OBS studio) :
    https://www.youtube.com/watch?v=6RCXyh2aICY

    So I’m setting all "NohBoard v1.2.2" colors to green (0x00FF00), except the letters, then :

    ffmpeg -y -f gdigrab -framerate 30 -draw_mouse 0 -i title="NohBoard v1.2.2" keyboard.mp4
    ffmpeg -y -i keyboard.mp4 -c: png -vf "chromakey=0x00FF00:similarity=.200" keyboard1.mp4
    ffmpeg -y -i gameplay.avi -i keyboard1.mp4 -filter_complex "[1:v] scale=560x180 [kb]; [0:v][kb] overlay=x=W-w-520:y=H-h-0 [done]" -shortest -map [done] test.mkv

    Everything works great so far, but can I use 1 command for this ?

  • How to display transparent GIFs using AutoHotkey script when pressing CapsLock ?

    8 juillet 2024, par Juan dalton

    I am trying to create a script in which if you press the capslock key a gif image appears on the screen, but the gif image appears with a solid black background, it is not transparent, what am I doing wrong ?

    


    ; Variable to track the state of Caps Lock
global capslock_toggle := false

; Path to the GIF file with transparency
ImagePath := "C:\Path\To\Your\Folder\animation.gif"

; Path to ffplay (adjust this line with the path to ffplay.exe)
ffplayPath := "C:\FFmpeg\bin\ffplay.exe"

; Variable to store the ID of the ffplay process
global ffplayPID

; Function to show the GIF using ffplay
ShowImage() {
    global
    Run, %ffplayPath% -autoexit -loop 0 -vf "format=rgba" -x 200 -y 200 -noborder -window_title "GifWindow" %ImagePath%,, Hide, ffplayPID
}

; Function to hide the GIF by closing ffplay
HideImage() {
    global
    if (ffplayPID) {
        Process, Close, %ffplayPID%
        ffplayPID := ""
    }
}

; Detect Caps Lock key press and toggle actions
CapsLock::
capslock_toggle := !capslock_toggle
if capslock_toggle
{
    ShowImage()  ; Show the GIF
}
else
{
    HideImage()  ; Hide the GIF
}
Return



    


    enter image description here

    


    I try to convert gif to webm but it doesn't work either