[CLOSED] Shinobi does not pass the quotes around paths correctly to ffmpeg



  • I have a secondary video folder on a separate drive thats mounted to "/media/foo 2"

    "addStorage": [
    {"name":"second","path":"/media/foo 2/recordings"}
    ]

    Shinobi itself see's this as a valid option when selecting a place to save video and even makes directories in it. However, the command that's passed to ffmpeg doesn't contain quotes around the directory and so fails. If I add a second set of quotes in conf.json, shinobi fails to start. If I try to escape the space a la "/media/foo\2 2", shinobi fails to start.



  • Actually, looks like it needs to escape the spaces. Adding quotes manually messes it up.


  • administrators

    currently the way the ffmpeg string is written it is required that i split it just before execution.

    the spawn function requires an array instead of a string. If you know of a better way to split the string I am all ears 😄

    otherwise i need to consider rewriting the function that launches the ffmpeg process so that it uses the array to begin with.



  • @moeiscool I looked through the code a bit. I'm an EE, not a comp sci guy, but my only suggestion is to create a second variable for the folder path and have a regex function trawl the path entered in conf.json and replace spaces with a backslash and a space.

    Then you can use the original variable for displaying the option in the gui, and the new variable when passing the info to ffmpeg.


  • administrators

    hmmmmmmm :thinking: thank you, ill see what i can stir up in my mixing pot!


  • administrators

    Latest dev now allows spaces inside double quotes. In turn this allows us to use spaces in folder names.

    so if you do

    "addStorage": [
        {"name":"second","path":"/media/foo 2/recordings"}
    ]
    

    it should work now. I've tested it with the addStorage rule below and it worked as expected.

    "addStorage": [
        {"name":"second","path":"__DIR__/video s2"}
    ],
    


  • How can I upgrade to this so I can stop hammering my SSD with 2gb/hr?


  • administrators

    Check out this link here https://shinobi.video/docs/start#content-updating-shinobi

    If you used git then i suggest running git checkout dev then i think git pull and restart shinobi pm2 restart camera.js


 

Looks like your connection to Shinobi Forum was lost, please wait while we try to reconnect.