agsh / onvif

ONVIF node.js implementation
http://agsh.github.io/onvif/
MIT License
696 stars 237 forks source link

SetvideoEncoderconfiguration #331

Open momoAmch opened 1 month ago

momoAmch commented 1 month ago

Hi

The setVideoEncoderConfiguration function appears to have a bug in how it parses and accesses the properties for H264 and MJPEG encoders. Specifically, it tries to access the profile property, but the actual property name is H264Profile for the H264 encoder. Similarly, there is a mismatch for the MJPEG encoder properties.

( options.H264.profile ? '' + options.H264.profile + '' : '' ) +

https://github.com/agsh/onvif/pull/148

RogerHardiman commented 2 days ago

Thank you for the Issue Report. It makes a lot of sense to allow the output of GetVideoEncoderConfiguation to feed directly into SetVideoEncoderConfiguration.

I cannot apply PR #148 as it breaks backwards compatibility. (PR 148 already warns about this)

If you can do a new PR that takes PR 148 as the starting point but continues to support the existing ".profile" API as well as adding in the better API (.H264Profile) then I can review and merge it.

Thanks for helping improve the library with better property names. And thanks too to @bl0ggy for the old PR that I forgot to review 4.5 years ago

Roger

RogerHardiman commented 2 days ago

actually, I'll just do it now

RogerHardiman commented 2 days ago

There is a new branch with this fix. Please can you test it.

Roger