sr99622 / libonvif

Onvif library with GUI implementation and built in YOLOX
GNU Lesser General Public License v2.1
175 stars 45 forks source link

Recording from the CLI possible? #74

Closed sir-farfan closed 12 months ago

sir-farfan commented 1 year ago

Hello I just found this util today and I'd like to use it to save the cameras' stream to a local storage.

Is that possible somehow?

I successfully connect from the GUI and can see the content, expect that the GUI is failing to save to disk, though I don't really mind as long as I can use the CLI to record

BTW, this is the GUI recording error, nothing important is printed to the terminal: Writer open failure: Pipe::open exception: avformat_write_header has failed with error: Invalid argument

sr99622 commented 1 year ago

Thank you for reaching out, your feedback is greatly appreciated. It might be possible to add the recording function to the CLI, but it is not currently part of that utility.

It is unfortunate that the recording is not working for you from the onvif-gui. This is something that has been tested pretty extensively, but there are many ways for it to fail, and the underlying ffmpeg api does not provide any useful error feedback when the error occurs. The avformat_write_header invalid argument means that an mp4 file parameter is missing or not a valid value. Many onvif cameras do not supply proper data in their rtsp streams for parameters that are needed for recording.

You could try disabling the audio on the settings panel and re-starting the camera stream to see if that will allow the system to record the video in the event that the audio stream is the problem. This is most common place for that type of error to occur.

You could also try using the Post Process Record function on the settings panel. This will re-factor the stream entirely which can fix missing parameters in the camera stream. This has the disadvantage of being compute intensive, but could be worth a try if you are interested and have a decent machine. If you have a GPU, the hardware encode could be used as well.

There is an error log in ~/.cache/onvif-gui that might have some more information on the camera. Also, if you let me know what kind of camera it is, I can have a look at that as well.

Best Regards,

Stephen

sir-farfan commented 12 months ago

Interesting, I don't see any post-processing option, well, that's the bad thing about using Debian Stable, sometimes packages are just old.

Thanks, I'll just try something else, I still prefer onvif-gui over the phone app :)

sr99622 commented 12 months ago

Hi Ismeal,

Yes, the debian package is very outdated.

Let me know what you end up with, I'm interested in what other packages are doing.

Best Regards,

Stephen

On Mon, Nov 27, 2023 at 1:51 PM Ismael Farfán Estrada < @.***> wrote:

Interesting, I don't see any post-processing option, well, that's the bad thing about using Debian Stable, sometimes packages are just old.

Thanks, I'll just try something else, I still prefer onvif-gui over the phone app :)

— Reply to this email directly, view it on GitHub https://github.com/sr99622/libonvif/issues/74#issuecomment-1828427592, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM6EKOGSFLUSUY3NLNI7YQTYGTOLXAVCNFSM6AAAAAA7ZPJVFGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRYGQZDONJZGI . You are receiving this because you commented.Message ID: @.***>