View Categories

FFmpeg Examples

  1. Click Add. Type the name of your camera and select your timezone. Click Save.
  2. Now you can Edit your camera. Click Actions -> Edit.
  3. Navigate to Video Configurations and select the following: Video Source: RTMPS Stream, Motion Detection Type: FTPS Video, Transcoding: No, Record Stream: Yes, Playback 14 Days (select as many you need). Click Update.
  4. In this step, you need to start streaming video from your camera to camlocus. The easiest way to do this is using FFMPEG, you can download it here: https://www.ffmpeg.org/download.html. On any platform you can use ffmpeg to start uploading the stream. For example, in windows, create .bat file and put it in startup location as a shortcut. C: \Users\MyUser123\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\StartupExample filename: stream-123.bat. Below is the content of the .bat file:
    @echo off
    title FFmpeg RTSP to RTMPS Restream
    :loop
    echo Starting FFmpeg at %date% %time%
    .\ffmpeg.exe -rtsp_transport tcp -i “rtsp://admin:mycampass@192.168.0.65/Streaming/Channels/102” ^
    -pix_fmt yuv420p ^
    -vcodec libx264 ^
    -preset veryfast ^
    -crf 31 ^
    -x264-params “keyint=48:min-keyint=48:scenecut=0” ^
    -ar 44100 ^
    -acodec aac ^
    -threads 4 ^
    -f flv “rtmps://aa.zz.yy.xx/hls/key“
    echo FFmpeg stopped/crashed at %date% %time%
    echo Restarting in 5 seconds…
    timeout /t 5 /nobreak
    goto loop
    You need to know your camera’s IP address, password, RTSP url. Example above is for hikvision cameras. RTMPS url is generated in camlocus platform for each camera individually, once you create one. Please check blog article here: https://camlocus.com/rtsp-url-examples-of-ip-cameras/ , on how to find rtsp url for your camera.
  5. That’s it. Please go to Camlocus -> Live Stream and you will see your camera’s stream. Also, you can preview recorded video in Playback page.