Page 1 of 1

Help with custom header

Posted: Wed Apr 28, 2021 8:48 am
by wes93
Hello to everyone :-D
i'm new to zoneminder and i can't find a way to access my camera stream :-(.
I know that the address (tested with ffmpeg and ffplay) is this: http://192.168.0.136/livestream/11 but the problem is that works only if i pass this custom header: -headers "Authorization: Basic YWRtaW46" , if i pass user:pass@ip won't work... :-(
The full ffplay command that works well is: ffplay -headers "Authorization: Basic YWRtaW46" -i "http://192.168.0.136/livestream/11"
How could i pass this custom header to my source?

Thanks a lot
Stefano

Re: Help with custom header

Posted: Thu Apr 29, 2021 1:28 am
by bbunge
Usually if you have the stream right and the cam doesn't work it is the resolution you enter in Zoneminder. VLC is a great tool to prove if a cam will work in Zoneminder. To see the resolution you need to use: VLC (Tools, Media Information, Codec) to check camera Display Resolution.
You can also halve the listed resolution to lower the load on the server.

Re: Help with custom header

Posted: Thu Apr 29, 2021 10:46 am
by wes93
Thanks a lot for your reply :-D
Unfortunately the problem is that without the custom header authorization i have a 403 unahutorized error :-(

The log:
Unable to open input http://admin:@192.168.0.50/livestream/1 ... audio_data due to: Server returned 401 Unauthorized (authorization failed)

The problem is that i need to pass the custom header instead of admin:pass

So i can't find where i need to put the custom header... :-(
LINK : http://192.168.0.50/livestream/11?actio ... audio_data
ADD FLAG : -headers "Authorization: Basic YWRtaW46"

Using this FLAG i could see the image via ffplay

Again thanks a lot
Stefano

Re: Help with custom header

Posted: Sat May 01, 2021 4:08 am
by gbruneau
Did you remove the password for posting in the forum? Just checking because it looks like you might have just missed that bit.

Try this, but update password to the real password. You may have done this already but it’s not clear.
http://admin:password@192.168.0.50/live ... audio_data

Re: Help with custom header

Posted: Sat May 01, 2021 5:41 am
by Magic919
The OP is saying that putting the username and password in the URL does not work. He wants to use an HTTP connection and pass the credentials in the headers, like you’d do with an API.

Unless it can be done as part of the FFMPEG command, I can’t see how this would happen in ZM without a code change.

Re: Help with custom header

Posted: Sun May 02, 2021 3:02 am
by makers_mark
wes93 wrote:
Wed Apr 28, 2021 8:48 am
Hello to everyone :-D
i'm new to zoneminder and i can't find a way to access my camera stream :-(.
I know that the address (tested with ffmpeg and ffplay) is this: http://192.168.0.136/livestream/11 but the problem is that works only if i pass this custom header: -headers "Authorization: Basic YWRtaW46" , if i pass user:pass@ip won't work... :-(
The full ffplay command that works well is: ffplay -headers "Authorization: Basic YWRtaW46" -i "http://192.168.0.136/livestream/11"
How could i pass this custom header to my source?

Thanks a lot
Stefano
In the 'Source" tab for that monitor under 'Options', have you tried putting:

Code: Select all

headers="Authorization: Basic YWRtaW46"

Re: Help with custom header

Posted: Mon May 03, 2021 8:15 pm
by wes93
Thanks a lot for everyone for the help,
@gbruneau, the camera has no password, just the admin and Infact works with custom header

@makers_mark
Unfortunately won't work:

Unable to open input http://@192.168.0.50/livestream/11?acti ... audio_data due to: Server returned 401 Unauthorized (authorization failed)

@Magic919
So you think the only solution it’s hope in a code update?

Best regards
Stefano

Re: Help with custom header

Posted: Tue May 04, 2021 9:48 am
by Magic919
I don't expect it'll happen unless there is a demand for it and some funding. It's not a common use case.

Re: Help with custom header

Posted: Tue May 04, 2021 9:54 am
by wes93
@Magic919
Ok thanks a lot for your reply and your time.
I love zoneminder and the app... :-(
Should you know some other app or suggestion?

Best Regards
Stefano

Re: Help with custom header

Posted: Tue May 04, 2021 12:19 pm
by Magic919
I don't, sorry.

You could ask on the Slack channel, someone might have experience.

Re: Help with custom header

Posted: Tue May 04, 2021 12:22 pm
by wes93
OK thanks i could try :-D