{"id":14036868,"url":"https://github.com/tropicoo/hikvision-camera-bot","last_synced_at":"2025-04-05T13:06:27.257Z","repository":{"id":38961017,"uuid":"129390078","full_name":"tropicoo/hikvision-camera-bot","owner":"tropicoo","description":"Hikvision Telegram Camera Bot 🇺🇦","archived":false,"fork":false,"pushed_at":"2025-03-27T21:45:49.000Z","size":664,"stargazers_count":111,"open_issues_count":8,"forks_count":24,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-29T12:06:43.810Z","etag":null,"topics":["ffmpeg","hikvision","hikvision-camera","hikvision-camera-bot","icecast","ip-camera","made-by-ukrainians","made-in-ukraine","python","srs","telegram","telegram-bot","youtube"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tropicoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-13T10:59:19.000Z","updated_at":"2025-03-27T21:45:53.000Z","dependencies_parsed_at":"2023-09-24T23:44:42.813Z","dependency_job_id":"a87f605e-1aae-4b47-b699-8f9cb3666434","html_url":"https://github.com/tropicoo/hikvision-camera-bot","commit_stats":{"total_commits":172,"total_committers":4,"mean_commits":43.0,"dds":"0.38372093023255816","last_synced_commit":"505620c7f6065c147333b3a26fea0b230bcb4568"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tropicoo%2Fhikvision-camera-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tropicoo%2Fhikvision-camera-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tropicoo%2Fhikvision-camera-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tropicoo%2Fhikvision-camera-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tropicoo","download_url":"https://codeload.github.com/tropicoo/hikvision-camera-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","hikvision","hikvision-camera","hikvision-camera-bot","icecast","ip-camera","made-by-ukrainians","made-in-ukraine","python","srs","telegram","telegram-bot","youtube"],"created_at":"2024-08-12T03:02:17.235Z","updated_at":"2025-04-05T13:06:27.232Z","avatar_url":"https://github.com/tropicoo.png","language":"Python","funding_links":["https://www.buymeacoffee.com/terletsky","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=MA6RKYAZH9DSA"],"categories":["Python"],"sub_categories":[],"readme":"# Hikvision Telegram Camera Bot 🇺🇦\n\nTelegram Bot which sends snapshots from your Hikvision cameras.\n\nVersion: 2.0. [Release details](releases/release_2.0.md).\n\n## Features\n\n1. Send videos and full/resized pictures on request (NVR is supported).\n2. Auto-send videos and pictures on **Motion**, **Line Crossing** and **Intrusion (Field) Detection**.\n3. YouTube, Telegram, and Icecast direct or re-encoded livestreams.\n4. Multiple timelapses per camera\n5. DVR to local storage with upload to Telegram group.\n6. SRS re-stream server with support of \"rewound videos\".\n7. Theoretically, Hikvision doorbells also should be supported.\n\n\u003e Rewound video is a video that starts from the moment of the alert and goes back in time for a specified period.\n\u003e It's useful when you want to see what happened before the alert or during manual request.\n\u003e The bot will send a video with a specified rewind time in seconds.\n\u003e Example: if a manual request or an alert was triggered at 12:00:00 and the rewind time is 10 seconds with a regular video of 15 seconds, the video will start at 11:59:50 and end at 12:00:15, totaling 25 seconds.\n\n![frames](.assets/screenshot-1.png)\n\n## Support my work\n\n- [Buy me a coffee](https://www.buymeacoffee.com/terletsky)\n- PayPal [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=MA6RKYAZH9DSA)\n- Bitcoin wallet `14kMRS8SvfD2ydMSMEyAmefHV3Yynf9kAd`\n\n\n## Development supported by JetBrains and Syntevo by providing free licenses\n\n\u003ca href=\"https://jetbrains.com\" target=\"_blank\"\u003e\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jb_square.svg\" alt=\"JetBrains\" width=\"100\"\u003e\u003c/a\u003e\n\u003cp\u003e\u003ca href=\"https://www.syntevo.com\" target=\"_blank\"\u003e\u003cimg src=\"https://www.syntevo.com/assets/images/logos/syntevo-0b0da4ee.svg\" alt=\"Syntevo\" width=\"200\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\n# Installation\nTo install Hikvision Telegram Camera Bot, simply `clone` the repo.\n\n```shell script\ngit clone https://github.com/tropicoo/hikvision-camera-bot.git\ncd hikvision-camera-bot\n```\n\n# Configuration\nConfiguration files are stored in JSON format and can be found in the `configs` directory.\n\n## Quick Setup\n1. [Create and start Telegram Bot](https://core.telegram.org/bots#6-botfather)\n and get its API token\n2. [Get your Telegram API key](https://my.telegram.org/apps) (`api_id` and `api_hash`)\n3. Copy 3 default configuration files with predefined templates in the `configs` directory:\n    \n    ```bash\n    cd configs\n    cp config-template.json config.json\n    cp encoding_templates-template.json encoding_templates.json\n    cp livestream_templates-template.json livestream_templates.json\n    ```\n4. Edit **config.json**:\n    1. Put the obtained `api_id` and `api_hash` strings to the same keys\n    2. Put the obtained bot API token string to the `token` key\n    3. [Find](https://stackoverflow.com/a/32777943) your Telegram user id\n    and put it to `chat_users`, `alert_users` and `startup_message_users` lists as \n    integer value. Multiple ids can be used, just separate them with a comma.\n    4. Hikvision camera settings are placed inside the `camera_list` section. The template\n    comes with two cameras\n\n        **Camera names should start with the `cam_` prefix and end with \n        digit suffix**: `cam_1`, `cam_2`, `cam_\u003cdigit\u003e` with any description.\n\n    5. Write authentication credentials in `user` and `password` keys for every camera\n    6. Choose authentication type from `basic`, `digest` or `digest_cached`. Default is `digest_cached`. \n       Check your camera security settings before choosing/changing one.\n    7. Write `host`, which should include protocol e.g., `http://192.168.1.1`\n    8. In the `alert` section you can enable sending pictures on alert (Motion, \n    Line Crossing and Intrusion (Field) Detection). Configure the `delay` setting \n    in seconds between pushing alert pictures. To send resized picture change \n    `fullpic` to `false`\n\n### Example `config.json` with dummy values\n```json\n{\n  \"telegram\": {\n    \"api_id\": 11111111,\n    \"api_hash\": \"1a1a1a1a1a1a1a1a\",\n    \"lang_code\": \"en\",\n    \"token\": \"1b1b1b1b1b1b1b1b\",\n    \"chat_users\": [\n      1010101010,\n      2020202020\n    ],\n    \"alert_users\": [\n      1010101010,\n      2020202020\n    ],\n    \"startup_message_users\": [\n      1010101010,\n      2020202020\n    ]\n  },\n  \"log_level\": \"INFO\",\n  \"camera_list\": {\n    \"cam_1\": {\n      \"hidden\": false,\n      \"description\": \"Kitchen\",\n      \"hashtag\": \"kitchen\",\n      \"group\": \"Default group\",\n      \"api\": {\n        \"host\": \"http://192.168.1.1\",\n        \"port\": 80,\n        \"auth\": {\n          \"user\": \"dummy-user\",\n          \"password\": \"dummy-password\",\n          \"type\": \"digest_cached\"\n        },\n        \"stream_timeout\": 10\n      },\n      \"rtsp_port\": 554,\n      \"timelapse\": [\n        {\n          \"enabled\": false,\n          \"name\": \"Kitchen view\",\n          \"start_hour\": 7,\n          \"end_hour\": 18,\n          \"snapshot_period\": 10,\n          \"video_length\": 120,\n          \"video_framerate\": 30,\n          \"channel\": 102,\n          \"timezone\": \"Europe/Kyiv\",\n          \"tmp_storage\": \"/data/timelapses\",\n          \"storage\": \"/data/timelapses\",\n          \"keep_stills\": false,\n          \"ffmpeg_log_level\": \"error\",\n          \"image_quality\": 30,\n          \"video_codec\": \"libx264\",\n          \"pix_fmt\": \"yuv420p\",\n          \"custom_ffmpeg_args\": \"-preset ultrafast\",\n          \"nice_value\": 19,\n          \"threads\": 1\n        }\n      ],\n      \"nvr\": {\n        \"is_behind\": false,\n        \"channel_name\": null\n      },\n      \"picture\": {\n        \"on_demand\": {\n          \"channel\": 101\n        },\n        \"on_alert\": {\n          \"channel\": 101\n        }\n      },\n      \"video_gif\": {\n        \"on_demand\": {\n          \"channel\": 101,\n          \"record_time\": 10,\n          \"rewind_time\": 10,\n          \"tmp_storage\": \"/tmp\",\n          \"loglevel\": \"error\",\n          \"rtsp_transport_type\": \"tcp\"\n        },\n        \"on_alert\": {\n          \"channel\": 101,\n          \"record_time\": 10,\n          \"rewind_time\": 10,\n          \"rewind\": true,\n          \"tmp_storage\": \"/tmp\",\n          \"loglevel\": \"error\",\n          \"rtsp_transport_type\": \"tcp\"\n        }\n      },\n      \"alert\": {\n        \"delay\": 15,\n        \"motion_detection\": {\n          \"enabled\": false,\n          \"sendpic\": true,\n          \"fullpic\": false,\n          \"send_videogif\": true,\n          \"send_text\": true\n        },\n        \"line_crossing_detection\": {\n          \"enabled\": false,\n          \"sendpic\": true,\n          \"fullpic\": false,\n          \"send_videogif\": true,\n          \"send_text\": true\n        },\n        \"intrusion_detection\": {\n          \"enabled\": false,\n          \"sendpic\": true,\n          \"fullpic\": false,\n          \"send_videogif\": true,\n          \"send_text\": true\n        }\n      },\n      \"livestream\": {\n        \"youtube\": {\n          \"enabled\": false,\n          \"livestream_template\": \"tpl_kitchen\",\n          \"encoding_template\": \"direct.kitchen_youtube\"\n        },\n        \"telegram\": {\n          \"enabled\": false,\n          \"livestream_template\": \"tpl_kitchen\",\n          \"encoding_template\": \"direct.kitchen_telegram\"\n        },\n        \"srs\": {\n          \"enabled\": false,\n          \"livestream_template\": \"tpl_kitchen\",\n          \"encoding_template\": \"direct.kitchen_srs\"\n        },\n        \"dvr\": {\n          \"enabled\": false,\n          \"local_storage_path\": \"/data/dvr\",\n          \"livestream_template\": \"tpl_kitchen\",\n          \"encoding_template\": \"direct.kitchen_dvr\",\n          \"upload\": {\n            \"delete_after_upload\": true,\n            \"storage\": {\n              \"telegram\": {\n                \"enabled\": false,\n                \"group_id\": -10000000\n              }\n            }\n          }\n        },\n        \"icecast\": {\n          \"enabled\": false,\n          \"livestream_template\": \"tpl_kitchen\",\n          \"encoding_template\": \"vp9.kitchen\"\n        }\n      },\n      \"command_sections_visibility\": {\n        \"general\": true,\n        \"infrared\": true,\n        \"motion_detection\": true,\n        \"line_detection\": true,\n        \"intrusion_detection\": true,\n        \"alert_service\": true,\n        \"stream_youtube\": true,\n        \"stream_telegram\": true,\n        \"stream_icecast\": true\n      }\n    }\n  }\n}\n```\n\n# Usage\n## Launch by using Docker and Docker Compose\n1. Set your timezone by editing the `.env` file (`TZ=Europe/Kyiv`).\nCurrently, there is a Ukrainian timezone because I live there.\nLook for your timezone here [http://www.timezoneconverter.com/cgi-bin/zoneinfo](http://www.timezoneconverter.com/cgi-bin/zoneinfo).\nIf you want to use the default UTC time format, set Greenwich Mean Time timezone `TZ=GMT`\n\n2. Build an image and run a container in a detached mode\n    ```bash\n    # Build containers and start\n    sudo docker-compose build \u0026\u0026 sudo docker-compose up -d\n   \n   # Tail logs per container or from all at once\n   sudo docker-compose logs -f --tail 500 hikvision-camera-bot\n   sudo docker-compose logs -f --tail 500 hik-hikvision-srs-server\n   sudo docker-compose logs -f --tail 500\n   \n    # Stop running containers while you're in the bot directory\n    sudo docker-compose stop\n   \n    # Check whether any containers are running\n    sudo docker ps\n    ```\n   \n\n\n# Commands\n| Command              | Description                                                                                     |\n|----------------------|-------------------------------------------------------------------------------------------------|\n| `/start`             | Start the bot (one-time action during the first start) and show help                            |\n| `/help`              | Show help message                                                                               |\n| `/list_cams`         | List all your cameras                                                                           |\n| `/cmds_cam_*`        | List commands for particular camera                                                             |\n| `/getpic_cam_*`      | Get resized picture from your Hikvision camera                                                  |\n| `/getfullpic_cam_*`  | Get a full-sized picture from your Hikvision camera                                             |\n| `/getvideo_cam_*`    | Get a video from your Hikvision camera                                                          |\n| `/getvideor_cam_*`   | Get a rewound video from your Hikvision camera                                                  |\n| `/ir_on_cam_*`       | Turn on Infrared mode                                                                           |\n| `/ir_off_cam_*`      | Turn off Infrared mode                                                                          |\n| `/ir_auto_cam_*`     | Turn on Infrared auto mode                                                                      |\n| `/md_on_cam_*`       | Enable Motion Detection                                                                         |\n| `/md_off_cam_*`      | Disable Motion Detection                                                                        |\n| `/ld_on_cam_*`       | Enable Line Crossing Detection                                                                  |\n| `/ld_off_cam_*`      | Disable Line Crossing Detection                                                                 |\n| `/intr_on_cam_*`     | Enable Intrusion (Field) Detection                                                              |\n| `/intr_off_cam_*`    | Disable Intrusion (Field) Detection                                                             |\n| `/alert_on_cam_*`    | Enable Alert (Alarm) mode. It means it will send a respective alert to your account in Telegram |\n| `/alert_off_cam_*`   | Disable Alert (Alarm) mode, no alerts will be sent when something is detected                   |\n| `/yt_on_cam_*`       | Enable YouTube stream                                                                           |\n| `/yt_off_cam_*`      | Disable YouTube stream                                                                          |\n| `/icecast_on_cam_*`  | Enable Icecast stream                                                                           |\n| `/icecast_off_cam_*` | Disable Icecast stream                                                                          |\n\n`*` - camera digit id e.g., `cam_1`.\n\n#  Advanced Configuration\n## SRS\n[SRS](https://github.com/ossrs/srs/tree/4.0release) (Simple Realtime Server) is a re-stream server that takes a stream from your camera and re-streams it\nto any destination without touching the native camera stream multiple times.\nThe SRS release version used in the bot is `4.0`.\n\nSRS decreases CPU time and network load on the camera when you enable something like DVR,\n YouTube Livestream or try to get Video GIF at the same time. Pictures are taken\ndirectly from the camera stream, not from the SRS.\n\nHow it works - if you have two cameras with enabled SRS for both, there will be two\nrunning 24/7 bot tasks taking streams from the cameras to the SRS server. Eventually, when you\nrequest Video Gif, or it's triggered by some alert, the video will be taken from the SRS server.\n\nYou can also connect to the SRS server with any video player like VLC and watch the stream\nwithout any interruptions. URL looks like this: `rtmp://192.168.1.100/live/livestream_101_cam_2`,\nwhere:\n1. `192.168.1.100` is an IP address or a host of your server.\n2. `101` is the camera's configured stream channel.\n3. `cam_2` is the ID of your second configured camera.\n\nSRS runs in a separate docker container. SRS config and `Dockerfile` are placed\nin the `srs_prod` directory. The service name is `hikvision-srs-server` in `docker-compose.yml`.\n\n\n\nIf `docker-compose.yml` is a list of forwarded and open SRS ports to the world:\n```yaml\n# If you don't plan to use anything from this, just comment out the whole section.\nports:\n  - \"1935:1935\"   # SRS RTMP port, if you comment this out, you won't be able to connect with the video player\n  - \"1985:1985\"   # SRS API port, can be commented out since not used\n  - \"8080:8080\"   # SRS WebUI port\n```\n\n## DVR\nYou can record your videos from the camera to local storage mounted as a volume in\nvolumes section of `hikvision-camera-bot` service in `docker-compose.yml`.\n\nDVR configuration is per camera in `config.json` with livestream template name from `livestream_templates.json`.\n\nIt's very simple:\n1. Use the `enabled` key to turn on/off this feature.\n2. `local_storage_path` is a path inside the container to which videos will be recorded. \nDon't change this default value (`/data/dvr`) since it's written in the volumes mapping section.\nIf you need to change it for some reason - you must change it both here and in the volumes mapping.\n3. `livestream_template` has a template name located inside the `livestream_templates.json` \nfile with DVR stream settings:\n    ```json\n    \"dvr\": {\n      \"tpl_kitchen\": {\n        \"channel\": 101,\n        \"sub_channel\": 102,\n        \"restart_period\": -1,\n        \"restart_pause\": 0,\n        \"segment_time\": 1800,\n      }\n    }\n    ```\n    a) `segment_time` is the time in seconds when the DVR record file will be split into a new one. \n\n    b) `1800` seconds mean every file will have 30 minutes of video recording.\n\n    c) File is named `cam_1_101_1800_2022-04-15_21-19-32.mp4` with cam ID, channel name, segment time, and record start datetime.\n\n4. Configuration part from the `config.json`:\n    ```json\n    \"dvr\": {\n      \"enabled\": true,\n      \"local_storage_path\": \"/data/dvr\",\n      \"livestream_template\": \"tpl_kitchen\",\n      \"encoding_template\": \"direct.kitchen_dvr\",\n      \"upload\": {\n        \"delete_after_upload\": true,\n        \"storage\": {\n          \"telegram\": {\n            \"enabled\": true,\n            \"group_id\": -1001631507769\n          }\n        }\n      }\n    }\n    ```\n    Recorded files can be uploaded to the Telegram group. Right now, the upload will work only\n    if `delete_after_upload` is set to `true` meaning the uploaded file will be deleted \n    from the local storage. You need to make sure your file size will be up to 2GB since\n    Telegram rejects larger ones. Just experiment with segment time.\n5. Local storage (the real one, not in the container) by default is `/data/dvr` in volumes mapping (the first path string, not the last).\n   Change it to any location you need e.g., `- \"D:\\Videos:/data/dvr\"` if you're on Windows.\n    ```yaml\n    volumes:\n      - \"/data/dvr:/data/dvr\"\n    ```\n6. Watch logs for any errors.\n\n\n## YouTube Livestream\nTo enable YouTube Live Stream enable it in the `youtube` key.\n\n| Parameter               | Value            | Description                                 |\n|-------------------------|------------------|---------------------------------------------|\n| `\"enabled\"`             | `false`          | set `true` to start stream during bot start |\n| `\"livestream_template\"` | `\"tpl_kitchen\"`  | stream template, read below                 |\n| `\"encoding_template\"`   | `\"x264.kitchen\"` | stream template, read below                 |\n\n**Livestream templates**\n\nTo start a particular livestream, a user needs to set both *livestream* and\n*encoding* templates with stream settings and encoding type/arguments.\n\nEncoding templates\n\n`direct` means that the video stream will not be re-encoded (transcoded) and will\nbe sent to YouTube/Icecast servers \"as is\", only audio can be disabled.\n\n`x264` or `vp9` means that the video stream will be re-encoded on your machine/server\nwhere the bot is running using respective encoding codecs.\n\nUser can create their templates in a file named `livestream_templates.json` \nand `encoding_templates.json`.\n\nThe default dummy template file is named `livestream_templates_template.json` \n(not a very funny name but anyway) which should be copied or renamed to \n`livestream_templates.json`.\n\nSame for `encoding_templates-template.json` -\u003e `encoding_templates.json`\n\n\u003cdetails\u003e\n  \u003csummary\u003elivestream_templates-template.json\u003c/summary\u003e\n\n  ```json\n  {\n    \"youtube\": {\n      \"tpl_kitchen\": {\n        \"channel\": 101,\n        \"restart_period\": 39600,\n        \"restart_pause\": 10,\n        \"url\": \"rtmp://a.rtmp.youtube.com/live2\",\n        \"key\": \"xxxx-xxxx-xxxx-xxxx\"\n      },\n      \"tpl_basement\": {\n        \"channel\": 101,\n        \"restart_period\": 39600,\n        \"restart_pause\": 10,\n        \"url\": \"rtmp://a.rtmp.youtube.com/live2\",\n        \"key\": \"xxxx-xxxx-xxxx-xxxx\"\n      }\n    },\n    \"icecast\": {\n      \"tpl_kitchen\": {\n        \"channel\": 101,\n        \"restart_period\": 39600,\n        \"restart_pause\": 10,\n        \"ice_stream\": {\n          \"ice_genre\": \"333Default\",\n          \"ice_name\": \"222Default\",\n          \"ice_description\": \"111Default\",\n          \"ice_public\": 0,\n          \"url\": \"icecast://source@192.168.10.1:8000/video.webm\",\n          \"password\": \"hackme\",\n          \"content_type\": \"video/webm\"\n        }\n      },\n      \"tpl_basement\": {\n        \"channel\": 101,\n        \"restart_period\": 39600,\n        \"restart_pause\": 10,\n        \"ice_stream\": {\n          \"ice_genre\": \"333Default\",\n          \"ice_name\": \"222Default\",\n          \"ice_description\": \"111Default\",\n          \"ice_public\": 0,\n          \"url\": \"icecast://source@192.168.10.2:8000/video.webm\",\n          \"password\": \"hackme\",\n          \"content_type\": \"video/webm\"\n        }\n      }\n    }\n  }\n  ```\n\u003c/details\u003e\n\nWhere:\n\n| Parameter         | Value                                        | Description                                                       |\n|-------------------|----------------------------------------------|-------------------------------------------------------------------|\n| `channel`         | `101`                                        | camera channel. 101 is the main stream, and 102 is the substream. |\n| `restart_period`  | `39600`                                      | stream restart period in seconds                                  |\n| `restart_pause`   | `10`                                         | stream pause before starting on restart                           |\n| `url`             | `\"rtmp://a.rtmp.youtube.com/live2\"`          | YouTube rtmp server                                               |\n| `key`             | `\"aaaa-bbbb-cccc-dddd\"`                      | YouTube Live Streams key.                                         |\n| `ice_genre`       | `\"Default\"`                                  | Icecast stream genre                                              |\n| `ice_name`        | `\"Default\"`                                  | Icecast stream name                                               |\n| `ice_description` | `\"Default\"`                                  | Icecast stream description                                        |\n| `ice_public`      | `0`                                          | Icecast public switch, default 0                                  |\n| `url`             | `\"icecast://source@x.x.x.x:8000/video.webm\"` | Icecast server URL, Port, and media mount point                   |\n| `password`        | `\"xxxx\"`                                     | Icecast authentication password                                   |\n| `content_type`    | `\"video/webm\"`                               | FFMPEG content-type for Icecast stream                            |\n\n\u003cdetails\u003e\n  \u003csummary\u003eencoding_templates-template.json\u003c/summary\u003e\n\n  ```json\n  {\n    \"x264\": {\n      \"kitchen\": {\n        \"null_audio\": false,\n        \"loglevel\": \"error\",\n        \"vcodec\": \"libx264\",\n        \"acodec\": \"aac\",\n        \"format\": \"flv\",\n        \"rtsp_transport_type\": \"tcp\",\n        \"pix_fmt\": \"yuv420p\",\n        \"pass_mode\": 1,\n        \"framerate\": 25,\n        \"preset\": \"superfast\",\n        \"average_bitrate\": \"1000K\",\n        \"maxrate\": \"3000k\",\n        \"bufsize\": \"6000k\",\n        \"tune\": \"zerolatency\",\n        \"scale\": {\n          \"enabled\": true,\n          \"width\": 640,\n          \"height\": -1,\n          \"format\": \"yuv420p\"\n        }\n      },\n      \"basement\": {\n        \"null_audio\": false,\n        \"loglevel\": \"error\",\n        \"vcodec\": \"libx264\",\n        \"acodec\": \"aac\",\n        \"format\": \"flv\",\n        \"rtsp_transport_type\": \"tcp\",\n        \"pix_fmt\": \"yuv420p\",\n        \"pass_mode\": 1,\n        \"framerate\": 25,\n        \"preset\": \"superfast\",\n        \"average_bitrate\": \"1000K\",\n        \"maxrate\": \"3000k\",\n        \"bufsize\": \"6000k\",\n        \"tune\": \"zerolatency\",\n        \"scale\": {\n          \"enabled\": true,\n          \"width\": 640,\n          \"height\": -1,\n          \"format\": \"yuv420p\"\n        }\n      }\n    },\n    \"vp9\": {\n      \"kitchen\": {\n        \"null_audio\": false,\n        \"loglevel\": \"info\",\n        \"vcodec\": \"libvpx-vp9\",\n        \"acodec\": \"libopus\",\n        \"format\": \"webm\",\n        \"rtsp_transport_type\": \"tcp\",\n        \"pix_fmt\": \"yuv420p\",\n        \"pass_mode\": 1,\n        \"framerate\": 10,\n        \"average_bitrate\": \"1000K\",\n        \"maxrate\": \"2000k\",\n        \"bufsize\": \"4000k\",\n        \"deadline\": \"realtime\",\n        \"speed\": 5,\n        \"scale\": {\n          \"enabled\": true,\n          \"width\": 640,\n          \"height\": -1,\n          \"format\": \"yuv420p\"\n        }\n      },\n      \"basement\": {\n        \"null_audio\": false,\n        \"loglevel\": \"info\",\n        \"vcodec\": \"libvpx-vp9\",\n        \"acodec\": \"libopus\",\n        \"format\": \"webm\",\n        \"rtsp_transport_type\": \"tcp\",\n        \"pix_fmt\": \"yuv420p\",\n        \"pass_mode\": 1,\n        \"framerate\": 10,\n        \"average_bitrate\": \"1000K\",\n        \"maxrate\": \"2000k\",\n        \"bufsize\": \"4000k\",\n        \"deadline\": \"realtime\",\n        \"speed\": 5,\n        \"scale\": {\n          \"enabled\": true,\n          \"width\": 640,\n          \"height\": -1,\n          \"format\": \"yuv420p\"\n        }\n      }\n    },\n    \"direct\": {\n      \"kitchen\": {\n        \"null_audio\": false,\n        \"loglevel\": \"error\",\n        \"vcodec\": \"copy\",\n        \"acodec\": \"aac\",\n        \"format\": \"flv\",\n        \"rtsp_transport_type\": \"tcp\"\n      },\n      \"basement\": {\n        \"null_audio\": false,\n        \"loglevel\": \"error\",\n        \"vcodec\": \"copy\",\n        \"acodec\": \"aac\",\n        \"format\": \"flv\",\n        \"rtsp_transport_type\": \"tcp\"\n      }\n    }\n  }\n  ```\n\u003c/details\u003e\n\nWhere:\n\n| Parameter    | Value                               | Description                                                                     |\n|--------------|-------------------------------------|---------------------------------------------------------------------------------|\n| `null_audio` | `false`                             | enable fake silent audio (for cameras without mics)                             |\n| `url`        | `\"rtmp://a.rtmp.youtube.com/live2\"` | YouTube rtmp server                                                             |\n| `key`        | `\"aaaa-bbbb-cccc-dddd\"`             | YouTube Live Streams key                                                        |\n| `loglevel`   | `\"quiet\"`                           | ffmpeg log levels, default \"quiet\"                                              |\n| `pix_fmt`    | `\"yuv420p\"`                         | pixel format, Hikvision streams in yuvj420p                                     |\n| `framerate`  | `25`                                | encode framerate, YouTube will re-encode any to 30 anyway                       |\n| `preset`     | `\"superfast\"`                       | libx264 predefined presets, more here https://trac.ffmpeg.org/wiki/Encode/H.264 |\n| `maxrate`    | `\"3000k\"`                           | max variable bitrate                                                            |\n| `bufsize`    | `\"2000k\"`                           | rate control buffer                                                             |\n| `tune`       | `\"zerolatency\"`                     | tune for zero latency                                                           |\n| `scale`      | \\\u003ckey\\\u003e                             | re-scale video size                                                             |\n| `enabled`    | `true`                              | false to disable and re-encode with source width and height                     |\n| `width`      | `640`                               | width                                                                           |\n| `height`     | `-1`                                | height, -1 means will be automatically determined                               |\n| `format`     | `\"yuv420p\"`                         | pixel format                                                                    |\n\n\u003e YouTube Live Streams server/key is available at https://www.youtube.com/live_dashboard.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftropicoo%2Fhikvision-camera-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftropicoo%2Fhikvision-camera-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftropicoo%2Fhikvision-camera-bot/lists"}