How to create your own Stream Recording Server and make a loop recording of your IP Camera (Full instruction)

If you’ve an IP Camera (or cameras) and want to loop record the stream it provides, or record a snapshot images at some intervals, or just both, then you’ve come to the right place!

Several day’s ago I’ve re-written my python project for stream recording and uploaded it on a public GitHub repo –

Also I’ve prepared the docker image of it and here I’ll explain how it works.

1. Firstly, you’ll need to install docker & docker-compose

To do so, please follow this simple instructions based on your Operating System:

Install Docker Engine –

Install Docker Compose –

2. Next, you’ve to prepare a docker-compose file

Create a docker-compose.yml file and provide related environment variables.

version: '3.9'

    image: suxumi/stream-recording-server:1
      - ./recordings:/recordings
    restart: always
      CAM_NAME: 'Camera 1'
      CAM_RECORDINGS_PATH: '/recordings'
      CAM_VIDEO_STREAM: 'rtsp://user:pass@ip:554/live/ch0'
      CAM_IMAGE_STREAM: 'rtsp://user:pass@ip:554/live/ch0'

In above I put all the possible variables you can provide.

Full description of each configuration options you can find here:

3. Build an image, up & run it

To build an image you’ve to simply run the next command:

$ sudo docker-compose up -d

On very first time it pull’s the image from docker hub, builds it for you locally and runs in detached mode.

And – That’s it – YOU’RE DONE! Your stream recording server is ready.

NOTE: every time you change configuration, you need to re-build the image, but at this time it will takes just a second as the main image was already pulled to your computer. To do so, use the next command:

$ sudo docker-compose up --build -d


In case if you are not going to install docker or just do not want to user docker-compose for some reason, that’s ok, then just simply use my python app. Download it from the link below:

But, don’t forget, in this case you need some prerequisites, such as:

  • Install python
  • Install required packages for python
  • Install ffmpeg
  • Provide related system environment variables
  • and finally, run the


Leave a Reply