Xabe.FFmpeg
Xabe.FFmpeg copied to clipboard
Support for libx265?
I can see you're still updating this project. Can I ask if the libx265, nvenc_hevc, hevc_qsv, etc codecs are going to be supported?
Hi @OFark I think you could achive that by using SetCodec method, ConvertWithHardware.
Right now I can do hardware h264 encoding like this:
videoStream.SetCodec(VideoCodec.h264_nvenc);
IConversion conversion = FFmpeg.Conversions.New();
conversion.AddStream(videoStream)
conversion.UseHardwareAcceleration(HardwareAccelerator.cuvid, VideoCodec.h264_cuvid, VideoCodec.h264_nvenc);
This should have done the same for h265:
videoStream.SetCodec(VideoCodec.h265_nvenc);
IConversion conversion = FFmpeg.Conversions.New();
conversion.AddStream(videoStream)
conversion.UseHardwareAcceleration(HardwareAccelerator.cuvid, VideoCodec.hevc_cuvid, VideoCodec.hevc_nvenc);
The following are missing from VideoCodec: decoders: hevc_qsv, hevc_cuvid encoders: hevc_nvenc hevc_qsv
I believe they have to be added to this file: https://github.com/tomaszzmuda/Xabe.FFmpeg/blob/master/src/Xabe.FFmpeg/Streams/VideoStream/VideoCodec.cs
I can indeed confirm that adding the following lines to VideoCodec.cs and compiling my own NuGet-package allowed me to successfully do a hardware hevc encode:
///<summary>
/// hevc_cuvid
///</summary>
hevc_cuvid,
///<summary>
/// hevc_nvenc
///</summary>
hevc_nvenc,
///<summary>
/// hevc_qsv
///</summary>
hevc_qsv
I tried to do a Commit 31b6b752 but I'm not sure if I'm doing it correctly :P
Audio encoder libfdk_aac is also missing, it is different from the standard aac encoder.
And I think libtheora is different from theora and should be added as well :)
Hey, Feel free to create Pull Request with that. You have a possibility to use overloaded method UseHardwareAcceleration(string hardwareAccelerator, string decoder, string encoder, int device = 0). To commit anything to this repository you have to fork it first, push changes to your branch on your fork and next create Pull Request with that changes.