vidspinner


Namevidspinner JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/DedInc/vidspinner
SummaryVidSpinner is a Python library for easily creating unique versions of videos using filters, text, and audio effects.
upload_time2023-10-05 02:31:22
maintainer
docs_urlNone
authorMaehdakvan
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">-- vidspinner --</h1>

vidspinner is a Python library for easily creating unique versions of videos using filters, text, and audio effects.

<h2>📥 Installation</h2>

```
pip install vidspinner
```

<h2>💡 Quick Start</h2>

```python
from vidspinner import MontageBuilder
from vidspinner.filters import Filter
from vidspinner.builders.text import TextBuilder, TextEffectBuilder
from vidspinner.builders.audio import AudioBuilder

mb = MontageBuilder()

mb.input = 'input.mp4'
mb.output = 'output.mp4'
mb.clear_meta_tags = True # clear meta tags

mb.add_filter(Filter.RETRO)

########### Test text ############ 
tb = TextBuilder()
tb.set_params(text='Wow! It is a simple text!')
mb.add_filter(tb.build(), start_duration=2, end_duration=5) # add text
##################################

####################### Fisheye effect ################
mb.add_filter(Filter.FISHEYE, start_duration=3, end_duration=5.8)
########################################################


############## Creating logo ###########
tb.set_font('comic_sans.ttf')
tb.set_params(color='cyan', text='VidSpinner', size=48)

teb = TextEffectBuilder()
teb.add_effect(effect='SHADOW', x=5, y=5, color='black')
teb.add_effect(effect='SHAKE', x=0, y=1850, amplitude=6) # for the shake effect you need to set the position of the text relative to its current coordinates.

box_effect = 'box=1:boxcolor={color}@{transparency}:boxborderw={width}' # custom text effect

teb.add_custom_effect(box_effect.format(
  color='lime',
  transparency=0.3,
  width=3
))

tb.add_effect(teb)

mb.add_filter(tb.build())
#######################################

########### Audio manipulations ############
ab = AudioBuilder()
ab.set_pitch(1.5)
mb.set_audio(ab)
#####################################

mb.build() # build result
```

<h2>🎥 Example (Quickstart Result):</h2>

<h3>📹 Input:</h3>

https://github.com/DedInc/vidspinner/assets/41906303/3377f048-c482-4aca-9592-5a22a262c2d0

<h3>🔮 Output:</h3>

https://github.com/DedInc/vidspinner/assets/41906303/6da817f3-a398-4763-9885-47aa5d876856

<h2>🎨 Features</h2>

- 16 built-in filters like retro, black & white, psychedelic etc.
- Add custom text with control over font, size, position  
- Animate text with scroll, shake, blink and more
- Trim, pitch shift, speed up/slow down audio
- Clear metadata to avoid detection

<h2>🧰 Built-in Filters</h2>

```python
from vidspinner.filters import Filter

print(Filter.get_filters()) # to see all filters 
```

<h3>🎨 Working with Filters</h3>

Add a filter:

```python 
mb = MontageBuilder()
mb.add_filter(Filter.RETRO) # add filter
mb.add_filter(Filter.VIGNETTE) # add several filters
```

Add a custom filter:

```python
mb.add_filter('rotate=PI/4') 
```

<h3>🖌️ Working with Text</h3>

Add text:

```python
from vidspinner.builders.text import TextBuilder

tb = TextBuilder()
tb.set_params(
  text='Hello World!',
  position='CENTER' 
)
text = tb.build()
mb.add_filter(text)
```

Stylize text and custom position:

```python
from vidspinner.builders.text import TextBuilder

tb = TextBuilder()
tb.set_font('comic_sans.ttf')
tb.set_params(
  position='COORDS',
  text='Hello World', 
  color='blue',
  size=32,
  x=0,
  y=0
)
text = tb.build()
mb.add_filter(text)
```

Some text positions:

```
'CENTER' - Center text horizontally and vertically
'CENTER_RIGHT' - Center vertically, align right
'CENTER_LEFT' - Center vertically, align left

'BOTTOM' - Align text to bottom center  
'BOTTOM_LEFT' - Align text to bottom left
'BOTTOM_RIGHT' - Align text to bottom right
'BOTTOM_CENTER' - Align text to bottom center

'TOP' - Align text to top center
'TOP_RIGHT' - Align text to top right
'TOP_LEFT' - Align text to top left 
'TOP_CENTER' - Align text to top center

'COORDS' - Specify x and y coordinates
```


Add text with effects:

```python 
from vidspinner.builders.text import TextBuilder, TextEffectBuilder

tb = TextBuilder()

te = TextEffectBuilder()
te.add_effect('BLINK', interval=3)
te.add_effect('SHADOW', color='gray', x=5, y=5)

tb.set_params(
  text='Hello World!'
)

tb.add_effect(te) 

text = tb.build()

mb.add_filter(text)
```

Some text effects:

```
'BLINK' - Text blinks
'SHADOW' - Text shadow
'SHAKE' - Shake text randomly
'SCROLL_TB' - Scroll text top to bottom 
'SCROLL_LR' - Scroll text left to right
'FADE_IN' - Fade in text over duration
'FADE_OUT' - Fade out text over duration
```

Some common effect parameters:

- `BLINK` - `interval` 
- `SHADOW` - `color, x, y`
- `SHAKE` - `amplitude, x, y`
- `FADE_IN` - `duration`
- `FADE_OUT` - `duration`  
- `SCROLL_TB` - `duration`
- `SCROLL_LR` - `duration`


<h3>🎙️ Working with Audio</h3>

Change audio track:

```python
from vidspinner.builders.audio import AudioBuilder

ab = AudioBuilder()
ab.set_audiotrack('track.mp3', start_time=10, end_time=20)
mb.set_audio(ab)
```

Change volume:

```python
ab.set_volume(0.5)
```

Pitch shift: 

```python 
ab.set_pitch(1.5)
```

<h3>🗑️ Clearing Metadata</h3>

To clear metadata tags and avoid detection:

```python
mb.clear_meta_tags = True 
```

This will add the `-map_metadata -1` flag to ffmpeg to clear metadata tags like title, author, etc.

<h2>📄 License</h2>

VidSpinner is [MIT licensed](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DedInc/vidspinner",
    "name": "vidspinner",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Maehdakvan",
    "author_email": "visitanimation@google.com",
    "download_url": "https://files.pythonhosted.org/packages/b0/ec/f9fb06f031a5c5e5785c1ee0a315541f3efd51758752e45540c23f0d2567/vidspinner-2.0.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">-- vidspinner --</h1>\r\n\r\nvidspinner is a Python library for easily creating unique versions of videos using filters, text, and audio effects.\r\n\r\n<h2>\ud83d\udce5 Installation</h2>\r\n\r\n```\r\npip install vidspinner\r\n```\r\n\r\n<h2>\ud83d\udca1 Quick Start</h2>\r\n\r\n```python\r\nfrom vidspinner import MontageBuilder\r\nfrom vidspinner.filters import Filter\r\nfrom vidspinner.builders.text import TextBuilder, TextEffectBuilder\r\nfrom vidspinner.builders.audio import AudioBuilder\r\n\r\nmb = MontageBuilder()\r\n\r\nmb.input = 'input.mp4'\r\nmb.output = 'output.mp4'\r\nmb.clear_meta_tags = True # clear meta tags\r\n\r\nmb.add_filter(Filter.RETRO)\r\n\r\n########### Test text ############ \r\ntb = TextBuilder()\r\ntb.set_params(text='Wow! It is a simple text!')\r\nmb.add_filter(tb.build(), start_duration=2, end_duration=5) # add text\r\n##################################\r\n\r\n####################### Fisheye effect ################\r\nmb.add_filter(Filter.FISHEYE, start_duration=3, end_duration=5.8)\r\n########################################################\r\n\r\n\r\n############## Creating logo ###########\r\ntb.set_font('comic_sans.ttf')\r\ntb.set_params(color='cyan', text='VidSpinner', size=48)\r\n\r\nteb = TextEffectBuilder()\r\nteb.add_effect(effect='SHADOW', x=5, y=5, color='black')\r\nteb.add_effect(effect='SHAKE', x=0, y=1850, amplitude=6) # for the shake effect you need to set the position of the text relative to its current coordinates.\r\n\r\nbox_effect = 'box=1:boxcolor={color}@{transparency}:boxborderw={width}' # custom text effect\r\n\r\nteb.add_custom_effect(box_effect.format(\r\n  color='lime',\r\n  transparency=0.3,\r\n  width=3\r\n))\r\n\r\ntb.add_effect(teb)\r\n\r\nmb.add_filter(tb.build())\r\n#######################################\r\n\r\n########### Audio manipulations ############\r\nab = AudioBuilder()\r\nab.set_pitch(1.5)\r\nmb.set_audio(ab)\r\n#####################################\r\n\r\nmb.build() # build result\r\n```\r\n\r\n<h2>\ud83c\udfa5 Example (Quickstart Result):</h2>\r\n\r\n<h3>\ud83d\udcf9 Input:</h3>\r\n\r\nhttps://github.com/DedInc/vidspinner/assets/41906303/3377f048-c482-4aca-9592-5a22a262c2d0\r\n\r\n<h3>\ud83d\udd2e Output:</h3>\r\n\r\nhttps://github.com/DedInc/vidspinner/assets/41906303/6da817f3-a398-4763-9885-47aa5d876856\r\n\r\n<h2>\ud83c\udfa8 Features</h2>\r\n\r\n- 16 built-in filters like retro, black & white, psychedelic etc.\r\n- Add custom text with control over font, size, position  \r\n- Animate text with scroll, shake, blink and more\r\n- Trim, pitch shift, speed up/slow down audio\r\n- Clear metadata to avoid detection\r\n\r\n<h2>\ud83e\uddf0 Built-in Filters</h2>\r\n\r\n```python\r\nfrom vidspinner.filters import Filter\r\n\r\nprint(Filter.get_filters()) # to see all filters \r\n```\r\n\r\n<h3>\ud83c\udfa8 Working with Filters</h3>\r\n\r\nAdd a filter:\r\n\r\n```python \r\nmb = MontageBuilder()\r\nmb.add_filter(Filter.RETRO) # add filter\r\nmb.add_filter(Filter.VIGNETTE) # add several filters\r\n```\r\n\r\nAdd a custom filter:\r\n\r\n```python\r\nmb.add_filter('rotate=PI/4') \r\n```\r\n\r\n<h3>\ud83d\udd8c\ufe0f Working with Text</h3>\r\n\r\nAdd text:\r\n\r\n```python\r\nfrom vidspinner.builders.text import TextBuilder\r\n\r\ntb = TextBuilder()\r\ntb.set_params(\r\n  text='Hello World!',\r\n  position='CENTER' \r\n)\r\ntext = tb.build()\r\nmb.add_filter(text)\r\n```\r\n\r\nStylize text and custom position:\r\n\r\n```python\r\nfrom vidspinner.builders.text import TextBuilder\r\n\r\ntb = TextBuilder()\r\ntb.set_font('comic_sans.ttf')\r\ntb.set_params(\r\n  position='COORDS',\r\n  text='Hello World', \r\n  color='blue',\r\n  size=32,\r\n  x=0,\r\n  y=0\r\n)\r\ntext = tb.build()\r\nmb.add_filter(text)\r\n```\r\n\r\nSome text positions:\r\n\r\n```\r\n'CENTER' - Center text horizontally and vertically\r\n'CENTER_RIGHT' - Center vertically, align right\r\n'CENTER_LEFT' - Center vertically, align left\r\n\r\n'BOTTOM' - Align text to bottom center  \r\n'BOTTOM_LEFT' - Align text to bottom left\r\n'BOTTOM_RIGHT' - Align text to bottom right\r\n'BOTTOM_CENTER' - Align text to bottom center\r\n\r\n'TOP' - Align text to top center\r\n'TOP_RIGHT' - Align text to top right\r\n'TOP_LEFT' - Align text to top left \r\n'TOP_CENTER' - Align text to top center\r\n\r\n'COORDS' - Specify x and y coordinates\r\n```\r\n\r\n\r\nAdd text with effects:\r\n\r\n```python \r\nfrom vidspinner.builders.text import TextBuilder, TextEffectBuilder\r\n\r\ntb = TextBuilder()\r\n\r\nte = TextEffectBuilder()\r\nte.add_effect('BLINK', interval=3)\r\nte.add_effect('SHADOW', color='gray', x=5, y=5)\r\n\r\ntb.set_params(\r\n  text='Hello World!'\r\n)\r\n\r\ntb.add_effect(te) \r\n\r\ntext = tb.build()\r\n\r\nmb.add_filter(text)\r\n```\r\n\r\nSome text effects:\r\n\r\n```\r\n'BLINK' - Text blinks\r\n'SHADOW' - Text shadow\r\n'SHAKE' - Shake text randomly\r\n'SCROLL_TB' - Scroll text top to bottom \r\n'SCROLL_LR' - Scroll text left to right\r\n'FADE_IN' - Fade in text over duration\r\n'FADE_OUT' - Fade out text over duration\r\n```\r\n\r\nSome common effect parameters:\r\n\r\n- `BLINK` - `interval` \r\n- `SHADOW` - `color, x, y`\r\n- `SHAKE` - `amplitude, x, y`\r\n- `FADE_IN` - `duration`\r\n- `FADE_OUT` - `duration`  \r\n- `SCROLL_TB` - `duration`\r\n- `SCROLL_LR` - `duration`\r\n\r\n\r\n<h3>\ud83c\udf99\ufe0f Working with Audio</h3>\r\n\r\nChange audio track:\r\n\r\n```python\r\nfrom vidspinner.builders.audio import AudioBuilder\r\n\r\nab = AudioBuilder()\r\nab.set_audiotrack('track.mp3', start_time=10, end_time=20)\r\nmb.set_audio(ab)\r\n```\r\n\r\nChange volume:\r\n\r\n```python\r\nab.set_volume(0.5)\r\n```\r\n\r\nPitch shift: \r\n\r\n```python \r\nab.set_pitch(1.5)\r\n```\r\n\r\n<h3>\ud83d\uddd1\ufe0f Clearing Metadata</h3>\r\n\r\nTo clear metadata tags and avoid detection:\r\n\r\n```python\r\nmb.clear_meta_tags = True \r\n```\r\n\r\nThis will add the `-map_metadata -1` flag to ffmpeg to clear metadata tags like title, author, etc.\r\n\r\n<h2>\ud83d\udcc4 License</h2>\r\n\r\nVidSpinner is [MIT licensed](LICENSE).\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "VidSpinner is a Python library for easily creating unique versions of videos using filters, text, and audio effects.",
    "version": "2.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/DedInc/vidspinner/issues",
        "Homepage": "https://github.com/DedInc/vidspinner"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bd7b8876753e5cd343a8a3d0b1c2924227ce07678f43e3582c25a4b41c1febfa",
                "md5": "44dfeaa446eab0db38d2b0e09ff365a5",
                "sha256": "8110951848cc75b2da71aa88bfb7e69a9710d7679c74cc8072e22a902e31e474"
            },
            "downloads": -1,
            "filename": "vidspinner-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "44dfeaa446eab0db38d2b0e09ff365a5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8057,
            "upload_time": "2023-10-05T02:31:20",
            "upload_time_iso_8601": "2023-10-05T02:31:20.812813Z",
            "url": "https://files.pythonhosted.org/packages/bd/7b/8876753e5cd343a8a3d0b1c2924227ce07678f43e3582c25a4b41c1febfa/vidspinner-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0ecf9fb06f031a5c5e5785c1ee0a315541f3efd51758752e45540c23f0d2567",
                "md5": "e0f4870f2386a2c7b9bd03b0da37a077",
                "sha256": "327a18cff6d9086f56fdc0b95d450a1100f5c2def4d50741f714b2e1ebdfbc59"
            },
            "downloads": -1,
            "filename": "vidspinner-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e0f4870f2386a2c7b9bd03b0da37a077",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 9505,
            "upload_time": "2023-10-05T02:31:22",
            "upload_time_iso_8601": "2023-10-05T02:31:22.782978Z",
            "url": "https://files.pythonhosted.org/packages/b0/ec/f9fb06f031a5c5e5785c1ee0a315541f3efd51758752e45540c23f0d2567/vidspinner-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-05 02:31:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DedInc",
    "github_project": "vidspinner",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "vidspinner"
}
        
Elapsed time: 0.11303s