Change mjpg-streamer settings in the raspi image- add user/password

Hi,

I'm using the repetier-server raspi image and I have the webcam externally available.
Problem is I can't find way to alter the mjpg-streamer startup params as I'd like to enable to option to ask for username/password.

Is there a file where that is stored and can be edited? 
Previously I had my own custom raspi image and I could easily make this change.

Thanks

Comments

  • You need to provide user and password in the url. If webcam uses digest authentication (default popup with credentials) you need a link like this

    http://admin:password@10.0.0.7/mjpeg/snap.cgi?chn=1

    server will detect this and run authentication in that case.
  • Thanks for the reply.
    I think that is not exactly it, that would be in case the webcam had some authentication method built-in.

    Here I don't have any authentication method in the webcam, so I want o add it at the mjpg-streamer level.
    The output_http plugin provides that option: https://github.com/jacksonliam/mjpg-streamer/blob/master/mjpg-streamer-experimental/plugins/output_http/README.md

    ---
    mjpg_streamer [input plugin options] -o 'output_http.so [options]'
    ---------------------------------------------------------------
    The following parameters can be passed to this plugin:
    
    [-w | --www ]...........: folder that contains webpages in 
                              flat hierarchy (no subfolders)
    [-p | --port ]..........: TCP port for this HTTP server
    [-c | --credentials ]...: ask for "username:password" on connect
    [-n | --nocommands ]....: disable execution of commands
    ---------------------------------------------------------------
    ---
    
    So what I need is a way to start the mjpg-streamer service passing the --credentials param to the output_htt plugin.
    But in the server the only options I have is to set resolution and framerate.
  • Ok, you want it on start of mjpg streamer. Thought you wanted auth for an other webcam with password.

    You need to edit the start script of mjpg_streamer. Check /usr/local/RepetierSetup/bin there is teh start script for streamer and you can add your params there.
  • Perfect thank you.
    Just looked into it and have it working now.

    PS: The code in github is quite old right? Not worth sending a pull request for it as I'm exposing this params in the UI.
  • Yes, we are closed source for years so no updates on old server on github.
Sign In or Register to comment.