Closed kasirajansfm closed 5 months ago
Hello! The different encoders have different opinions of things, and one of them is the Quality BitrateMode option. I have noticed the Microsoft sofware encoder will in many cases use a higher bitrate given the same quality number than hardware encoders.
Your code has set the bitrate for the encoder, but you also must set the encoder in "constat bitrate" or CBR mode, for that option to have effect. Quality and Bitrate is mutually exclusive.
For quality (this is default, which is why it works if omitted)
VideoEncoderOptions = new VideoEncoderOptions
{
Encoder = new H264VideoEncoder { BitrateMode = H264BitrateControlMode.Quality },
Quality = 30
}
for CBR:
VideoEncoderOptions = new VideoEncoderOptions
{
Encoder = new H264VideoEncoder { BitrateMode = H264BitrateControlMode.CBR},
Bitrate = 50000
}
I think if you change it to CBR, you will see the files have the same size between the two encoders, but probably overall larger size. At least with 50mbit bitrate, which is quite a lot (Blu-ray quality)
Build an EXE with below options on Windows 10 with GPU machine,
its approximate file size is around 400kb. When i try to run same EXE on Windows 10 Non-GPU machine, the file size is around 1.8MB is there anything am missing on my code.? anyone faced this kind of issue?