dialogstream


Namedialogstream JSON
Version 1.4.8 PyPI version JSON
download
home_pagehttps://github.com/pipexy/stream-filter-router
SummaryA flexible stream routing and filtering system with support for scheduled tasks and event reactions
upload_time2024-11-02 17:26:24
maintainerNone
docs_urlNone
authorTom Sapletta
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements pyyaml python-dotenv ffmpeg-python typing-extensions colorlog click prometheus_client fastapi uvicorn
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img alt="Dialogstream logo" src="https://dialogstream-com.github.io/python/dialogstream-animation.svg" />

# DialogStream Python Package

This repository contains the Python package for DialogStream, a powerful and flexible conversational AI platform.

## Installation

To install the DialogStream Python package, you can use pip:

```bash
pip install dialogstream
```

## Quick start

```bash
python -m venv .venv && source .venv/bin/activate && pip install dialogstream
```
JSON
```bash
python router.py -s "config/stream.json" -p "config/process.json"
```


## Video stream testing

```bash
ffplay rtsp://192.168.1.2:554/Preview_01_sub
```

```bash
ffmpeg -i rtsp://192.168.1.2:554/Preview_01_sub -c copy -f segment -segment_time 6 -segment_format mp4 -strftime 1 -reset_timestamps 1 "./recordings/%Y%m%d_%H.mp4" -v debug
```



## Usage

Here's a basic example of how to use the DialogStream package:

![image](https://github.com/user-attachments/assets/03a65528-9f94-423c-9fa8-4ac9ccab1cbe)


### Flow configuration (flows.json)
The `config/flows.json` file defines video stream flows:
```json
{
  "flows": [
    {
      "name": "RTSP z detekcją ruchu i zapisaniem obrazów",
      "steps": [
        "rtsp://test1234:test1234@192.168.188.225:554/Preview_01_sub",
        "file:///motion"
      ]
    },
    {
      "name": "Timelapse z obrazów",
      "steps": [
        "file:///motion",
        "file:///timelapses"
      ]
    },
    {
      "name": "Timelapse z obrazów co 1 godzine",
      "steps": [
        "file:///motion",
        "schedule://0 */1 * * *",
        "file:///timelapses"
      ]
    },
    {
      "name": "Timelapse z obrazów co 1 godzine",
      "steps": [
        "file:///motion",
        "schedule://0 */1 * * *",
        "file:///timelapses"
      ]
    },
    {
      "name": "Email z powiadamieniem, gdy pojawi się nowy obiekt",
      "steps": [
        "subscribe://object_detected",
        "email:///info@softreck.dev"
      ]
    },
    {
      "name": "Wysyłanie powiadomienia, gdy pojawi się nowy obiekt",
      "steps": [
        "file:///motion",
        "process://detect_object_on_picture",
        "publish://object_detected"
      ]
    }
  ]
}
```

Each flow contains:
- `name`: A descriptive name for the flow
- `steps`: A list of processing steps, where each step is a URL in the format:
    - `rtsp://` - RTSP source
    - `process://` - Processing step with parameters
    - `file://` - Save to file (supports strftime format)

### Process configuration (process.json)
The `config/process.json` file defines processing rules:
```json
[
  {
    "filter": [
      "rtsp",
      "process://motion",
      "file"
    ],
    "run": [
      "shell://ffmpeg -i $1 -c copy -f segment -segment_time 6 -segment_format mp4 -strftime 1 -reset_timestamps 1 $3"
    ]
  },
  {
    "filter": [
      "rtsp",
      "file"
    ],
    "run": [
      "shell://ffmpeg -i $1 -c copy -f segment -segment_time 6 -segment_format mp4 -strftime 1 -reset_timestamps 1 $2"
    ]
  }
]
```

Each rule contains:
- `filter`: A list of URL patterns to match
- `run`: A list of shell commands to execute, where:
    - `$1, $2, $3...` - refer to the corresponding URLs from the filter section
    - Commands are executed in the order defined in the list




For more detailed information, please refer to the [official documentation](https://github.com/dialogstream-com/python/tree/main/docs).

## Contributing

Contributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request on GitHub.

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/dialogstream-com/python/blob/main/LICENSE) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pipexy/stream-filter-router",
    "name": "dialogstream",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Tom Sapletta",
    "author_email": "info@softreck.dev",
    "download_url": "https://files.pythonhosted.org/packages/63/a8/f7aac3ab1da4822970871f3bc995daa01147511176638313f7cd07ee21ed/dialogstream-1.4.8.tar.gz",
    "platform": null,
    "description": "<img alt=\"Dialogstream logo\" src=\"https://dialogstream-com.github.io/python/dialogstream-animation.svg\" />\n\n# DialogStream Python Package\n\nThis repository contains the Python package for DialogStream, a powerful and flexible conversational AI platform.\n\n## Installation\n\nTo install the DialogStream Python package, you can use pip:\n\n```bash\npip install dialogstream\n```\n\n## Quick start\n\n```bash\npython -m venv .venv && source .venv/bin/activate && pip install dialogstream\n```\nJSON\n```bash\npython router.py -s \"config/stream.json\" -p \"config/process.json\"\n```\n\n\n## Video stream testing\n\n```bash\nffplay rtsp://192.168.1.2:554/Preview_01_sub\n```\n\n```bash\nffmpeg -i rtsp://192.168.1.2:554/Preview_01_sub -c copy -f segment -segment_time 6 -segment_format mp4 -strftime 1 -reset_timestamps 1 \"./recordings/%Y%m%d_%H.mp4\" -v debug\n```\n\n\n\n## Usage\n\nHere's a basic example of how to use the DialogStream package:\n\n![image](https://github.com/user-attachments/assets/03a65528-9f94-423c-9fa8-4ac9ccab1cbe)\n\n\n### Flow configuration (flows.json)\nThe `config/flows.json` file defines video stream flows:\n```json\n{\n  \"flows\": [\n    {\n      \"name\": \"RTSP z detekcj\u0105 ruchu i zapisaniem obraz\u00f3w\",\n      \"steps\": [\n        \"rtsp://test1234:test1234@192.168.188.225:554/Preview_01_sub\",\n        \"file:///motion\"\n      ]\n    },\n    {\n      \"name\": \"Timelapse z obraz\u00f3w\",\n      \"steps\": [\n        \"file:///motion\",\n        \"file:///timelapses\"\n      ]\n    },\n    {\n      \"name\": \"Timelapse z obraz\u00f3w co 1 godzine\",\n      \"steps\": [\n        \"file:///motion\",\n        \"schedule://0 */1 * * *\",\n        \"file:///timelapses\"\n      ]\n    },\n    {\n      \"name\": \"Timelapse z obraz\u00f3w co 1 godzine\",\n      \"steps\": [\n        \"file:///motion\",\n        \"schedule://0 */1 * * *\",\n        \"file:///timelapses\"\n      ]\n    },\n    {\n      \"name\": \"Email z powiadamieniem, gdy pojawi si\u0119 nowy obiekt\",\n      \"steps\": [\n        \"subscribe://object_detected\",\n        \"email:///info@softreck.dev\"\n      ]\n    },\n    {\n      \"name\": \"Wysy\u0142anie powiadomienia, gdy pojawi si\u0119 nowy obiekt\",\n      \"steps\": [\n        \"file:///motion\",\n        \"process://detect_object_on_picture\",\n        \"publish://object_detected\"\n      ]\n    }\n  ]\n}\n```\n\nEach flow contains:\n- `name`: A descriptive name for the flow\n- `steps`: A list of processing steps, where each step is a URL in the format:\n    - `rtsp://` - RTSP source\n    - `process://` - Processing step with parameters\n    - `file://` - Save to file (supports strftime format)\n\n### Process configuration (process.json)\nThe `config/process.json` file defines processing rules:\n```json\n[\n  {\n    \"filter\": [\n      \"rtsp\",\n      \"process://motion\",\n      \"file\"\n    ],\n    \"run\": [\n      \"shell://ffmpeg -i $1 -c copy -f segment -segment_time 6 -segment_format mp4 -strftime 1 -reset_timestamps 1 $3\"\n    ]\n  },\n  {\n    \"filter\": [\n      \"rtsp\",\n      \"file\"\n    ],\n    \"run\": [\n      \"shell://ffmpeg -i $1 -c copy -f segment -segment_time 6 -segment_format mp4 -strftime 1 -reset_timestamps 1 $2\"\n    ]\n  }\n]\n```\n\nEach rule contains:\n- `filter`: A list of URL patterns to match\n- `run`: A list of shell commands to execute, where:\n    - `$1, $2, $3...` - refer to the corresponding URLs from the filter section\n    - Commands are executed in the order defined in the list\n\n\n\n\nFor more detailed information, please refer to the [official documentation](https://github.com/dialogstream-com/python/tree/main/docs).\n\n## Contributing\n\nContributions are welcome! If you find any bugs or have suggestions for improvements, please open an issue or submit a pull request on GitHub.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/dialogstream-com/python/blob/main/LICENSE) file for details.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A flexible stream routing and filtering system with support for scheduled tasks and event reactions",
    "version": "1.4.8",
    "project_urls": {
        "Homepage": "https://github.com/pipexy/stream-filter-router"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c97e797da15def18b8c49a715a77b8e41a6727a49cb388c40fd549d819711525",
                "md5": "75df133d743ddc9552c88cb501b3ac08",
                "sha256": "e37f59b8f36ceecf4444fcfbcb0bcaffcdc9b249e6ca35f84bf57cd2d77c3206"
            },
            "downloads": -1,
            "filename": "dialogstream-1.4.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "75df133d743ddc9552c88cb501b3ac08",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 18329,
            "upload_time": "2024-11-02T17:26:22",
            "upload_time_iso_8601": "2024-11-02T17:26:22.532613Z",
            "url": "https://files.pythonhosted.org/packages/c9/7e/797da15def18b8c49a715a77b8e41a6727a49cb388c40fd549d819711525/dialogstream-1.4.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "63a8f7aac3ab1da4822970871f3bc995daa01147511176638313f7cd07ee21ed",
                "md5": "7e1677a5d311936a25be0518704b7288",
                "sha256": "cec4eb76387e43d00ee2d216432a03a8e5937ff5b5810d5154e31077e8229965"
            },
            "downloads": -1,
            "filename": "dialogstream-1.4.8.tar.gz",
            "has_sig": false,
            "md5_digest": "7e1677a5d311936a25be0518704b7288",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 56051,
            "upload_time": "2024-11-02T17:26:24",
            "upload_time_iso_8601": "2024-11-02T17:26:24.246302Z",
            "url": "https://files.pythonhosted.org/packages/63/a8/f7aac3ab1da4822970871f3bc995daa01147511176638313f7cd07ee21ed/dialogstream-1.4.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-02 17:26:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pipexy",
    "github_project": "stream-filter-router",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pyyaml",
            "specs": [
                [
                    ">=",
                    "6.0"
                ]
            ]
        },
        {
            "name": "python-dotenv",
            "specs": [
                [
                    ">=",
                    "0.19.0"
                ]
            ]
        },
        {
            "name": "ffmpeg-python",
            "specs": [
                [
                    ">=",
                    "0.2.0"
                ]
            ]
        },
        {
            "name": "typing-extensions",
            "specs": [
                [
                    ">=",
                    "4.0.0"
                ]
            ]
        },
        {
            "name": "colorlog",
            "specs": [
                [
                    ">=",
                    "6.7.0"
                ]
            ]
        },
        {
            "name": "click",
            "specs": [
                [
                    ">=",
                    "8.0.0"
                ]
            ]
        },
        {
            "name": "prometheus_client",
            "specs": [
                [
                    ">=",
                    "0.19.0"
                ]
            ]
        },
        {
            "name": "fastapi",
            "specs": [
                [
                    ">=",
                    "0.104.1"
                ]
            ]
        },
        {
            "name": "uvicorn",
            "specs": [
                [
                    ">=",
                    "0.24.0"
                ]
            ]
        }
    ],
    "lcname": "dialogstream"
}
        
Elapsed time: 0.39666s