# <img src="https://github.com/sosie-js/python-bssource/blob/1.2.0/icons/python-bssource.png?raw=true" alt="logo" width="32"> python-bestsource
[![Python](https://img.shields.io/badge/Python%20->=3.10-blue)](https://www.python.org/) ![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white)
A library helper for producing and manipulating videos with audio support in vapoursynth using [bestsource](https://github.com/vapoursynth/bestsource)
## Current state
Version 1.2 bring filter range support with both ApplyRange and FrameEval in TextSub : a door to make Animations easier in vapoursynth is now open =)
Sound is working with vspreview as soon as Track1 is selected in the Playback sub panel hidden by default and play is triggered for a video that has sound. I provide a test video in test/ and two examples scripts
### trim.vpy:
Shows how trim is handled with video that has sound - the player I used is a forked [release of vspreview 0.7.1 is available here](https://github.com/sosie-js/vs-preview/releases/tag/v0.7.1-ubuntu22.04) is for users using a [still supported python 3.10 version](https://pyreadiness.org/3.10/) as ubuntu 22.04 user, install it using the git way.
### frame.vpy
Show frame props of a clip different ways. Under scite you can trigger vspreview with [F5]
or compile - In test I let you the scite config file.
### Audio and Sub Range tests support in Aegisub (.ass) / vspreview (.vpy)
This requires vapoursynth fork from Arch1t3cht and the use of [peagisub](https://github.com/sosie-js/peagisub-vs)
for vapoursynth plugin dir configuration. Two subtitles files are provided (1+2) and a probe system (3):
(1) Open tests/VTS_01_1-trim100.ass
then tests/VTS_01_1-trim100.vpy delivers video as channel 0 and audio as channel 1
this is not supported by current release that disable Open Audio from Video feature.
>As I did not find a way to know which type of channel audio or video is requested.
>I opened thus a [Request for feature](https://github.com/arch1t3cht/Aegisub/issues/148)
Sound works fine in vspreview you can trigger with scite by opening tests/VTS_01_1-trim100.vpy and press [F5]
Note you will have no sound in vsedit (vapoursynth editor) for all the tests
(2) Open tests/VTS_01_1-trim100-video-audio.ass
then tests/VTS_01_1-trim100-video.vpy delivers video as channel 0
then tests/VTS_01_1-trim100-audio.vpy delivers audio as channel 0 (separately in time)
>this works if you ensure plays does not goes outside boundary ie frame 101
>else you will be flooded by popups. Play and seeking work fine and did not stall just before the end as in vspreview
>there is just a minor problem with the horizonthal zoom for audio
(3) Open tests/VTS_01_1-trim100-applyrange.ass
then tests/VTS_01_1-trim100-applyrange.vpy is used for video
>This will show we have a portion from 50 to 60 of VTS_01_1-trim100.ass using a mimick AVS method ApplyRange
(4) Open tests/VTS_01_1-trim100-frameval.ass
then tests/VTS_01_1-trim100-frameval.vpy is used for video
>This will show we have a portion from 50 to 60 of VTS_01_1-trim100.ass most similar of AVS Animate, you can
grab the current frame number in the filter that ApplyRange do no handle.
(5) Open tests/VTS_01_1-trim100-range.ass
then tests/VTS_01_1-trim100-frameval.vpy is used for video
then tests/VTS_01_1-trim100-audio.vpy is used to restrore sound
>This will show how to add a green mask from 50 to 60 in ASS
## Installation
as local user
```shell
pip3 install -U python-bssource
```
for all
```shell
sudo pip3 install python-bssource
```
For those who want to bridge to [arch1tech's aegisub fork](https://github.com/arch1t3cht/Aegisub/tree/vapoursynth), use my lua helper [peagisub](https://github.com/sosie-js/peagisub-vs) to get the path of the vapoursynth plugin needed by aegisub_vs.py.
## History
**1.2.0** - ApplyRange and FrameEval samples in tests/
**1.1.0** - Trim with video that has audio works in both aegisub and vspreview!
**1.0.0** - First release
## Contributing
Feel free to add other object and fixes.
## Development
### Compile .whl
```shell
$ ./package.sh
```
### Upload to PyPI
1. Create an API Token from the Web UI. (Edit your `~/.pypirc` with the generated token.)
2. Install Twine
```shell
$ python3 -m pip install --user --upgrade twine
```
3. Build the wheel bundle (.egg no more recognized)
```shell
$ sudo rm -rf dist/&sudo rm -rf build&sudo python3 setup.py bdist_wheel
```
4. Upload the bundle
```shell
$ python3 -m twine upload dist/*
```
Note: The upload to PyPI is currently assured by GitHub Actions.
### Release
1. Increase the version number in `setup.py`.
2. Commit and push.
3. Create a new tag in GitHub to trigger the CI pipeline.
Raw data
{
"_id": null,
"home_page": "http://github.com/sosie-js/python-bestsource",
"name": "python-bestsource",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "vapoursynth python bestsource helper",
"author": "sosie-js",
"author_email": "sosie@sos-productions.com",
"download_url": null,
"platform": null,
"description": "# <img src=\"https://github.com/sosie-js/python-bssource/blob/1.2.0/icons/python-bssource.png?raw=true\" alt=\"logo\" width=\"32\"> python-bestsource\n\n[![Python](https://img.shields.io/badge/Python%20->=3.10-blue)](https://www.python.org/) ![Ubuntu](https://img.shields.io/badge/Ubuntu-E95420?style=for-the-badge&logo=ubuntu&logoColor=white) \n\nA library helper for producing and manipulating videos with audio support in vapoursynth using [bestsource](https://github.com/vapoursynth/bestsource)\n\n## Current state\n\nVersion 1.2 bring filter range support with both ApplyRange and FrameEval in TextSub : a door to make Animations easier in vapoursynth is now open =)\n\nSound is working with vspreview as soon as Track1 is selected in the Playback sub panel hidden by default and play is triggered for a video that has sound. I provide a test video in test/ and two examples scripts\n\n### trim.vpy: \n\nShows how trim is handled with video that has sound - the player I used is a forked [release of vspreview 0.7.1 is available here](https://github.com/sosie-js/vs-preview/releases/tag/v0.7.1-ubuntu22.04) is for users using a [still supported python 3.10 version](https://pyreadiness.org/3.10/) as ubuntu 22.04 user, install it using the git way.\n\n### frame.vpy\n\nShow frame props of a clip different ways. Under scite you can trigger vspreview with [F5]\nor compile - In test I let you the scite config file. \n\n### Audio and Sub Range tests support in Aegisub (.ass) / vspreview (.vpy) \n\nThis requires vapoursynth fork from Arch1t3cht and the use of [peagisub](https://github.com/sosie-js/peagisub-vs) \nfor vapoursynth plugin dir configuration. Two subtitles files are provided (1+2) and a probe system (3):\n\n(1) Open tests/VTS_01_1-trim100.ass \nthen tests/VTS_01_1-trim100.vpy delivers video as channel 0 and audio as channel 1\nthis is not supported by current release that disable Open Audio from Video feature. \n>As I did not find a way to know which type of channel audio or video is requested.\n>I opened thus a [Request for feature](https://github.com/arch1t3cht/Aegisub/issues/148)\nSound works fine in vspreview you can trigger with scite by opening tests/VTS_01_1-trim100.vpy and press [F5]\nNote you will have no sound in vsedit (vapoursynth editor) for all the tests\n\n(2) Open tests/VTS_01_1-trim100-video-audio.ass \nthen tests/VTS_01_1-trim100-video.vpy delivers video as channel 0 \nthen tests/VTS_01_1-trim100-audio.vpy delivers audio as channel 0 (separately in time)\n>this works if you ensure plays does not goes outside boundary ie frame 101\n>else you will be flooded by popups. Play and seeking work fine and did not stall just before the end as in vspreview\n>there is just a minor problem with the horizonthal zoom for audio\n\n(3) Open tests/VTS_01_1-trim100-applyrange.ass \nthen tests/VTS_01_1-trim100-applyrange.vpy is used for video\n>This will show we have a portion from 50 to 60 of VTS_01_1-trim100.ass using a mimick AVS method ApplyRange\n\n(4) Open tests/VTS_01_1-trim100-frameval.ass\nthen tests/VTS_01_1-trim100-frameval.vpy is used for video\n>This will show we have a portion from 50 to 60 of VTS_01_1-trim100.ass most similar of AVS Animate, you can\ngrab the current frame number in the filter that ApplyRange do no handle. \n\n(5) Open tests/VTS_01_1-trim100-range.ass\nthen tests/VTS_01_1-trim100-frameval.vpy is used for video\nthen tests/VTS_01_1-trim100-audio.vpy is used to restrore sound\n>This will show how to add a green mask from 50 to 60 in ASS\n\n## Installation\n\nas local user\n\n```shell\npip3 install -U python-bssource\n```\n\nfor all\n\n```shell\nsudo pip3 install python-bssource\n```\n\nFor those who want to bridge to [arch1tech's aegisub fork](https://github.com/arch1t3cht/Aegisub/tree/vapoursynth), use my lua helper [peagisub](https://github.com/sosie-js/peagisub-vs) to get the path of the vapoursynth plugin needed by aegisub_vs.py. \n\n## History\n\n**1.2.0** - ApplyRange and FrameEval samples in tests/\n**1.1.0** - Trim with video that has audio works in both aegisub and vspreview!\n**1.0.0** - First release\n\n\n## Contributing\n\nFeel free to add other object and fixes.\n\n## Development\n\n### Compile .whl\n\n```shell\n$ ./package.sh\n```\n\n### Upload to PyPI\n\n1. Create an API Token from the Web UI. (Edit your `~/.pypirc` with the generated token.)\n2. Install Twine\n```shell\n$ python3 -m pip install --user --upgrade twine\n```\n3. Build the wheel bundle (.egg no more recognized) \n```shell\n$ sudo rm -rf dist/&sudo rm -rf build&sudo python3 setup.py bdist_wheel\n```\n4. Upload the bundle\n```shell\n$ python3 -m twine upload dist/*\n```\n\nNote: The upload to PyPI is currently assured by GitHub Actions.\n\n\n### Release\n\n1. Increase the version number in `setup.py`.\n2. Commit and push.\n3. Create a new tag in GitHub to trigger the CI pipeline.\n\n\n\n",
"bugtrack_url": null,
"license": "GPL",
"summary": "Python helpers to manipulate video from vapoursynth",
"version": "1.2.0",
"project_urls": {
"Homepage": "http://github.com/sosie-js/python-bestsource"
},
"split_keywords": [
"vapoursynth",
"python",
"bestsource",
"helper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "460ff3a5601b849642c971c9edccec47e25f1071b1e6ad4c8c9c5907fcd57f5d",
"md5": "0ac51688a85b73095bec849b1c11a7e5",
"sha256": "ff44b290273c5c9028bfc4dd7cac522c1ddd81c037673c51874e23f8f3dca628"
},
"downloads": -1,
"filename": "python_bestsource-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0ac51688a85b73095bec849b1c11a7e5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 26940,
"upload_time": "2024-08-22T14:26:43",
"upload_time_iso_8601": "2024-08-22T14:26:43.024078Z",
"url": "https://files.pythonhosted.org/packages/46/0f/f3a5601b849642c971c9edccec47e25f1071b1e6ad4c8c9c5907fcd57f5d/python_bestsource-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-22 14:26:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sosie-js",
"github_project": "python-bestsource",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "python-bestsource"
}