Metadata-Version: 2.4
Name: chgnhyk
Version: 0.0.5
Summary: visual and audio engine of chgnhyk
Requires-Python: >=3.9.0
Requires-Dist: moderngl
Requires-Dist: moviepy>=2.2.1
Requires-Dist: noise
Requires-Dist: numpy
Requires-Dist: opencv-python
Requires-Dist: pillow
Requires-Dist: pyrr
Requires-Dist: svgpathtools
Requires-Dist: trimesh
Provides-Extra: audio
Requires-Dist: csoundengine; extra == 'audio'
Provides-Extra: mediapipe
Requires-Dist: numpy==1.26.4; extra == 'mediapipe'
Provides-Extra: window
Requires-Dist: moderngl-window; extra == 'window'
Description-Content-Type: text/markdown

# Package Name

Visual and audio engine of Choi Gunhyuk

## Installation

Install the package from PyPI:

```bash
pip install chgnhyk
```

ffmpeg 
- required to generate video

csound 
libcsnd6-6.0v5 
- required to generate audio 

### Installation options
```bash
pip install chgnhyk[audio]
```
- requires csound

```bash
pip install chgnhyk[window]
```
- installs moderngl_window

```bash
pip install chgnhyk[mediapipe]
```
- installs mediapipe
- downgrades numpy to 1.26.4

```bash
pip install "chgnhyk[audio, window, mediapipe]"
```
- install with all three options

## Usage

Basic example:

```python
from chgnhyk import FBO, ClipRenderer
import moderngl

CTX = create_context(require=(330), standalone=True)
SIZE = (1080, 1080)

shader = '''
#version 330
out vec4 outputColor;
in vec2 UV;

uniform sampler2D bckbuffer;
uniform vec2 resolution;

uniform float timer;
uniform float loop_timer;
uniform float duration;

void main() {
    vec2 uv = UV;
    vec2 rs = resolution;

    outputColor = vec4(uv, 1., 1.);
}
'''

scene = FBO(
    ctx = CTX, size = (1080, 1080), shader = shader
)

clip = ClipRenderer(duration=2, fps=30, rest_time=0.)
clip.addFBOPass("", scene)

clip.render_frame_sample(clip.duration * 0.0)
clip.extractImage((f"test_{clip.t}.jpg"))

vid = clip.render()
vid.write_videofile(str("test.mp4"), fps=clip.fps)

clip.release()
CTX.release()
```

## Requirements

* Python 3.9 or later
* moderngl
* moderngl_window
* csound

## License

This project is licensed under the MIT License. See the `LICENSE` file for details.

## Author

Choi Gunhyuk

## Links

* PyPI: 
* GitHub: 
