how to use ffmpeg in wpf?

mc 5,426 Reputation points
2023-10-07T07:15:37.66+00:00

I am using wpf and want to capture the desktop and then save mp4 to file.

better add some text.

I searched that I can get the device list using the command:

ffmpeg -list_devices true -f show -i dummy

can I do it in dll? I mean add the ffmpeg from nuget and get the device list by cs code.

not to run a command?

Developer technologies Windows Presentation Foundation
Developer technologies .NET Other
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 90,521 Reputation points
    2023-10-07T07:42:32.43+00:00

    I am using wpf and want to capture the desktop and then save mp4 to file.

    You can use native Win32 interfaces, like

    IMFCaptureEngine with P/Invoke

    (tested on Windows 10 22H2 from MS SDK sample https://github.com/microsoft/Windows-classic-samples/tree/main/Samples/CaptureEngineVideoCapture )

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.