In future the Dashcam app will be named NinjaCam. For the rest of the article we will refer to the Dashcam app as NinjaCam.

Requirements

  • Shinobi Monitor Setup with Input Type as Dashcam/NinjaCam (Shinobi Streamer v2)
  • Device Streaming to Shinobi server on the same network or Shinobi server is accessible remotely.

How to setup a NinjaCam Monitor in Shinobi

  1. Click Add Monitor.
  2. Set Input Type to Dashcam (Shinobi Streamer v2)
    • This Input Type will be renamed to NinjaCam in later revisions of Shinobi.
  3. Change the view from Simple to Advanced in the bottom right corner
    • Next to the Save button on the Add Monitor window.
  4. Scroll down to Custom and set Input Flags to the following value.
    • -r 10 -re -f h264
    • -r is the frame rate that Shinobi will consume. You can change this to match what you have set in NinjaCam or remove it to attempt automatic recognition of the frame rate you choose on the NinjaCam app.
  5. Optional but Recommended for Testing : Set your Stream Type to Base64 over Websocket and set the clear the Frame Rate field.
    • These options are found in the Stream section.
  6. Save the Monitor. It is now ready to take Stream data.

How to push video data to Shinobi

Now that you've made it this far you will want to know what you can do send data in, here are some ways.

  • Shinobi Dashcam
  • Shinobi's Web Panel logged into the Dashcam page.
    • This requires a camera that your browser can access, like a webcam.

However these are not the only ways. You can do it yourself with other devices. You can even develop your own IP camera with Shinobi Push support.

Do A Test Run : How to push video data via FFmpeg

For all you FFmpeg lovers out there, there isn't much needed to be said. Here's a command you can try.

ffmpeg -loglevel warning -probesize 1000 -analyzeduration 1000 -i https://cdn.shinobi.video/videos/bears.mp4 -an -r 10 -g 1 -f h264 -movflags faststart+frag_keyframe+empty_moov+default_base_moof -q:v 1 http://SHINOBI_HOST:SHINOBI_PORT/API_KEY/streamIn/GROUP_KEY/MONITOR_ID

Replace the Endpoint URL at the end of the command with your Endpoint and it will be ready for your test run.

Breakdown of what this command is doing :

  • -loglevel : Selects how much information to display in the console when running this command.
  • -probesize and -analyzeduration : In combination these two options dictate how longs to verify the quality of a stream before beginning processing of your expected commands.
  • -i : The chosen input for this command. Which is currently set to the static bear video.
  • -an : Disables all Audio, this is done for simplicity. AAC is usually the best the choice for this kind of stream.
  • -r : Frame Rate, Frames Per Second (FPS)
  • -g : I-Frame controller. Personally I would leave this at 1 or match it to the FPS. However different use cases require different choices.
  • -f : Format of the data being sent. We have chosen H.264.
  • -movflags : Additional write options. The chosen options will move certain markers to the beginning of the stream to allow consumption immediately on the Shinobi end.
  • -q:v : Quality of the Video. 1 is the Best, 23 is the Worst.
  • Endpoint : The URL you see at the end of the command is the Endpoint, where the video data goes to. Here is breakdown of its components.
    • SHINOBI_HOST : The IP Address of your Shinobi machine.
    • SHINOBI_PORT : The Port your Shinobi instance is running on. The port you use for accessing the web panel, default is 8080.
    • API_KEY : To create an API key you can click the main menu in the top left of the Dashboard and select API.
    • GROUP_KEY : This is the Account's Group ID. You can find this in the Header of the API Key window.
    • MONITOR_ID : The ID of the Monitor you created as a NinjaCam (Shinobi Streamer v2)

Tips

  • You may have noticed the -r flag. This flag represents the frame rate. In Shinobi this was put in the Custom > Input Flags field. This alters the frame rate being consumed. Any -r flag found after the Input portion will be used for outputs. This sometimes has no effect or sometimes has problematic effects. I suggest always setting it for both Input and Outputs.
  • The data fed in doesn't have to be H.264, it can be anything. As long as the data type is supported by the other features in Shinobi. For example, you can stream in WebM data.