Open kuangxj opened 1 year ago
onMediaOpening
// Setting Advanced Video Stream Options is also possible if (e.Options.VideoStream is StreamInfo videoStream) { // Example of forcing a codec for a stream // e.Options.DecoderCodec[videoStream.StreamIndex] = "mjpeg"; // Hardware device priorities var deviceCandidates = new[] { //AVHWDeviceType.AV_HWDEVICE_TYPE_CUDA, //AVHWDeviceType.AV_HWDEVICE_TYPE_D3D11VA, AVHWDeviceType.AV_HWDEVICE_TYPE_DXVA2 }; foreach (var deviceType in deviceCandidates) { var accelerator = videoStream.HardwareDevices.FirstOrDefault(d => d.DeviceType == deviceType); if (accelerator == null) continue; e.Options.VideoHardwareDevice = accelerator; break; }
Issue Title (change this title!)
The CPU has always been high,and I want to reduce the performance of the CPU through hardware acceleration. I looked at the example and spent a lot of time not finding this method or example. Please tell me if you know.
Please enter a general description for the issue. Delete sections that are not relevant and provide additional sections if necessary.
Issue Categories
Version Information
Steps to Reproduce
Expected Results
Sample Code
XAML
C
Command line ffplay
Delete This Section