vssource


Namevssource JSON
Version 0.11.2 PyPI version JSON
download
home_pageNone
SummaryVapoursynth Wrapper for indexing and similar.
upload_time2024-12-06 07:09:36
maintainerSetsugen no ao
docs_urlNone
authorSetsugen no ao
requires_python>=3.12
licenseNone
keywords
VCS
bugtrack_url
requirements VapourSynth vstools
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # vs-source

### DVDs were an error, but can be nice to use with this package.

<br>

A wrapper for DVD file structure and ISO files.

For support you can check out the [JET Discord server](https://discord.gg/XTpc6Fa9eB). <br><br> <br><br>

## How to install

Install `vssource` with the following command:

```sh
pip install vssource
```

Or if you want the latest git version, install it with this command:

```sh
pip install git+https://github.com/Jaded-Encoding-Thaumaturgy/vs-source.git
```

<br>
One of these plugins is required:

- dvdsrc2
- d2vSource and either DGIndex or [patched d2vwitch](https://gist.github.com/jsaowji/ead18b4f1b90381d558eddaf0336164b)

> _DGIndex is recommended over d2vwitch as the latter has various problems._
>
> It can also be used under linux with wine; notice that doing it requires ` binfmt` and `dgindex` in PATH.
>
> ```bash
> chmod +x DGIndex.exe
> sudo ln -s $(pwd)/DGIndex.exe /usr/bin/dgindex
> ```
>
> <br>

<br>

Optional dependecies:

- [dvdsrc_dvdnav_title_ptt_test](https://gist.github.com/jsaowji/2bbf9c776a3226d1272e93bb245f7538) to automatically check the chapters against `libdvdnav`.
- [dvdsrc](https://github.com/jsaowji/dvdsrc/) to automatically double-check the determined dvdstrucut agaist libdvdread.
- [mpv](https://github.com/mpv-player/mpv) to determine chapter splits by loading the DVD and hitting I or using it like this:

  > ```bash
  > mpv --dvd-device=<iso> dvd://<title>
  > # mpv titles are zero-indexed
  > # vssource titles indices start from 1
  > # sometimes it is useful to to scale the osc down
  > # --script-opts=osc-scalewindowed=0.4,osc-scalefullscreen=0.4
  > ```

  Related to mpv, the [mpv-dvd-browser](https://github.com/CogentRedTester/mpv-dvd-browser) plugin can be useful for this too.

<br>

> Getting a vs.AudioNode and demuxing AC3 **requires** [dvdsrc2](https://github.com/jsaowji/dvdsrc2/)
>
> **The only codecs offically supported are: stereo 16bit LPCM and AC3**

## Usage

After installation, functions can be loaded and used as follows:

```py

from vssource import IsoFile, D2VWitch, DGIndex
from vstools import set_output

# Autodetect what to index with
iso = IsoFile('.\DVD_VIDEOS\Suzumiya_2009_DVD\KABA_6001.ISO')

# Force index with dgindex
iso = IsoFile('.\SOME_DVD_FOLDER\HARUHI', indexer=DGIndex)

title1 = iso.get_title(1)

# prints audio and chapter information
print(title1)

title1.video.set_output(0)
title1.audios[0].set_output(1)

title1.dump_ac3('full_title.ac3', 0)

# -1 is replace with end i.e 15
ep1, ep2, ep3 = title1.split_at([6, 11])
ep1, ep2, ep3 = title1.split_ranges([(1, 5), (6, 10), (11, 15)])
ep1           = title1.split_range(1, 5)
ep2           = title1.split_range(6, 10)
ep3           = title1.split_range(11, -1)

# preview your splits
title1.preview(title1.split_at([6,11]))

ep1 = title1.split_range(1,5,audio=0)

print(ep1.chapters[:-1])

set_output([
    ep1.video,
    ep1.audios[0],
])

a = ep1.ac3('/tmp/ep1.ac3',0)
# a is in seconds of how much samples are there too much at the start

## Advanced Usage

# Remove junk from the end
title1 = iso.get_title(1)
title1.chapters[-1] -= 609
title1.preview(title1.split_at([7, 12]))


#--------

splits = []
# title 2 through 5 containe episodes
# remove 'junk' from beginning
# you can quickly check with preview
for a in range(2,6):
    t = iso.get_title(a)
    t.chapters[0] += 180
    splits += [t.split_at([])]
    t.preview(splits[-1])

print(splits[0].ac3('/tmp/ep1.ac3'))
# 0.019955555555555556

#--------

# multi angle + multi audio + rff mode
# japanese
a = iso.get_title(4, angle_nr=1, rff_mode=2).split_at([5, 10, 15],audio=1)

# EP 1 japanese
a[0].video.set_output(0)
a[0].audios[0].set_output(1)

# italian
b = iso.get_title(4, angle_nr=2, rff_mode=2).split_at([5, 10, 15],audio=0)

# ep 2 italian
b[1].video.set_output(0)
b[1].audios[0].set_output(1)
```

The `Title.split_at` method should behave just like mkvmerge chapter splits (split before the chapter, first chapter is 1), so if you want the (first chapter, all other chapters after) 2.

Output chapters always start with frame zero and end one past the last frame.
This has been chosen because it allows you to change the video boundries and for example cut stuff off from the end.
Thats in contrast to how dvd chapters work as their only supposed to be points you jump to.

```
+---+----------+------+---+---+--------+--------+---+
| 1 |     2    |   3  | 4 | 5 |    6   |    7   | 8 |
+---+----------+------+---+---+--------+--------+---+
split_at([5])
+---+----------+------+---+
| 1 |     2    |   3  | 4 |
+---+----------+------+---+
+---+--------+--------+---+
| 5 |    6   |    7   | 8 |
+---+--------+--------+---+
split_range(1,3)
+---+----------+------+
| 1 |     2    |   3  |
+---+----------+------+
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "vssource",
    "maintainer": "Setsugen no ao",
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": "setsugen@setsugen.dev",
    "keywords": null,
    "author": "Setsugen no ao",
    "author_email": "setsugen@setsugen.dev",
    "download_url": "https://files.pythonhosted.org/packages/44/d9/3df00bbc2bc44a2409845d0299e5f402fb469c2bdfdafd103af0554bfe3b/vssource-0.11.2.tar.gz",
    "platform": null,
    "description": "# vs-source\n\n### DVDs were an error, but can be nice to use with this package.\n\n<br>\n\nA wrapper for DVD file structure and ISO files.\n\nFor support you can check out the [JET Discord server](https://discord.gg/XTpc6Fa9eB). <br><br> <br><br>\n\n## How to install\n\nInstall `vssource` with the following command:\n\n```sh\npip install vssource\n```\n\nOr if you want the latest git version, install it with this command:\n\n```sh\npip install git+https://github.com/Jaded-Encoding-Thaumaturgy/vs-source.git\n```\n\n<br>\nOne of these plugins is required:\n\n- dvdsrc2\n- d2vSource and either DGIndex or [patched d2vwitch](https://gist.github.com/jsaowji/ead18b4f1b90381d558eddaf0336164b)\n\n> _DGIndex is recommended over d2vwitch as the latter has various problems._\n>\n> It can also be used under linux with wine; notice that doing it requires ` binfmt` and `dgindex` in PATH.\n>\n> ```bash\n> chmod +x DGIndex.exe\n> sudo ln -s $(pwd)/DGIndex.exe /usr/bin/dgindex\n> ```\n>\n> <br>\n\n<br>\n\nOptional dependecies:\n\n- [dvdsrc_dvdnav_title_ptt_test](https://gist.github.com/jsaowji/2bbf9c776a3226d1272e93bb245f7538) to automatically check the chapters against `libdvdnav`.\n- [dvdsrc](https://github.com/jsaowji/dvdsrc/) to automatically double-check the determined dvdstrucut agaist libdvdread.\n- [mpv](https://github.com/mpv-player/mpv) to determine chapter splits by loading the DVD and hitting I or using it like this:\n\n  > ```bash\n  > mpv --dvd-device=<iso> dvd://<title>\n  > # mpv titles are zero-indexed\n  > # vssource titles indices start from 1\n  > # sometimes it is useful to to scale the osc down\n  > # --script-opts=osc-scalewindowed=0.4,osc-scalefullscreen=0.4\n  > ```\n\n  Related to mpv, the [mpv-dvd-browser](https://github.com/CogentRedTester/mpv-dvd-browser) plugin can be useful for this too.\n\n<br>\n\n> Getting a vs.AudioNode and demuxing AC3 **requires** [dvdsrc2](https://github.com/jsaowji/dvdsrc2/)\n>\n> **The only codecs offically supported are: stereo 16bit LPCM and AC3**\n\n## Usage\n\nAfter installation, functions can be loaded and used as follows:\n\n```py\n\nfrom vssource import IsoFile, D2VWitch, DGIndex\nfrom vstools import set_output\n\n# Autodetect what to index with\niso = IsoFile('.\\DVD_VIDEOS\\Suzumiya_2009_DVD\\KABA_6001.ISO')\n\n# Force index with dgindex\niso = IsoFile('.\\SOME_DVD_FOLDER\\HARUHI', indexer=DGIndex)\n\ntitle1 = iso.get_title(1)\n\n# prints audio and chapter information\nprint(title1)\n\ntitle1.video.set_output(0)\ntitle1.audios[0].set_output(1)\n\ntitle1.dump_ac3('full_title.ac3', 0)\n\n# -1 is replace with end i.e 15\nep1, ep2, ep3 = title1.split_at([6, 11])\nep1, ep2, ep3 = title1.split_ranges([(1, 5), (6, 10), (11, 15)])\nep1           = title1.split_range(1, 5)\nep2           = title1.split_range(6, 10)\nep3           = title1.split_range(11, -1)\n\n# preview your splits\ntitle1.preview(title1.split_at([6,11]))\n\nep1 = title1.split_range(1,5,audio=0)\n\nprint(ep1.chapters[:-1])\n\nset_output([\n    ep1.video,\n    ep1.audios[0],\n])\n\na = ep1.ac3('/tmp/ep1.ac3',0)\n# a is in seconds of how much samples are there too much at the start\n\n## Advanced Usage\n\n# Remove junk from the end\ntitle1 = iso.get_title(1)\ntitle1.chapters[-1] -= 609\ntitle1.preview(title1.split_at([7, 12]))\n\n\n#--------\n\nsplits = []\n# title 2 through 5 containe episodes\n# remove 'junk' from beginning\n# you can quickly check with preview\nfor a in range(2,6):\n    t = iso.get_title(a)\n    t.chapters[0] += 180\n    splits += [t.split_at([])]\n    t.preview(splits[-1])\n\nprint(splits[0].ac3('/tmp/ep1.ac3'))\n# 0.019955555555555556\n\n#--------\n\n# multi angle + multi audio + rff mode\n# japanese\na = iso.get_title(4, angle_nr=1, rff_mode=2).split_at([5, 10, 15],audio=1)\n\n# EP 1 japanese\na[0].video.set_output(0)\na[0].audios[0].set_output(1)\n\n# italian\nb = iso.get_title(4, angle_nr=2, rff_mode=2).split_at([5, 10, 15],audio=0)\n\n# ep 2 italian\nb[1].video.set_output(0)\nb[1].audios[0].set_output(1)\n```\n\nThe `Title.split_at` method should behave just like mkvmerge chapter splits (split before the chapter, first chapter is 1), so if you want the (first chapter, all other chapters after) 2.\n\nOutput chapters always start with frame zero and end one past the last frame.\nThis has been chosen because it allows you to change the video boundries and for example cut stuff off from the end.\nThats in contrast to how dvd chapters work as their only supposed to be points you jump to.\n\n```\n+---+----------+------+---+---+--------+--------+---+\n| 1 |     2    |   3  | 4 | 5 |    6   |    7   | 8 |\n+---+----------+------+---+---+--------+--------+---+\nsplit_at([5])\n+---+----------+------+---+\n| 1 |     2    |   3  | 4 |\n+---+----------+------+---+\n+---+--------+--------+---+\n| 5 |    6   |    7   | 8 |\n+---+--------+--------+---+\nsplit_range(1,3)\n+---+----------+------+\n| 1 |     2    |   3  |\n+---+----------+------+\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Vapoursynth Wrapper for indexing and similar.",
    "version": "0.11.2",
    "project_urls": {
        "Contact": "https://discord.gg/XTpc6Fa9eB",
        "Source Code": "https://github.com/Jaded-Encoding-Thaumaturgy/vs-source"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7924bd2a5bac8bc2baad5833eb346ccc3bb1ff25c4057b52c7f5bd652ab4b374",
                "md5": "9c4c2adb95035d01c0789ab4586693f0",
                "sha256": "a6f1f4ae856d38fa8876dfef7d8cf4fe97494ae5f680de5c8fece088650b5452"
            },
            "downloads": -1,
            "filename": "vssource-0.11.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9c4c2adb95035d01c0789ab4586693f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 38226,
            "upload_time": "2024-12-06T07:09:35",
            "upload_time_iso_8601": "2024-12-06T07:09:35.318007Z",
            "url": "https://files.pythonhosted.org/packages/79/24/bd2a5bac8bc2baad5833eb346ccc3bb1ff25c4057b52c7f5bd652ab4b374/vssource-0.11.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44d93df00bbc2bc44a2409845d0299e5f402fb469c2bdfdafd103af0554bfe3b",
                "md5": "ebc867aeb2ad6b4299d19df47bd3afcf",
                "sha256": "e21a2885b299c515e8dbae8490a5c273a54c4f1010782b6191bbafa6aa586f90"
            },
            "downloads": -1,
            "filename": "vssource-0.11.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ebc867aeb2ad6b4299d19df47bd3afcf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 32414,
            "upload_time": "2024-12-06T07:09:36",
            "upload_time_iso_8601": "2024-12-06T07:09:36.320612Z",
            "url": "https://files.pythonhosted.org/packages/44/d9/3df00bbc2bc44a2409845d0299e5f402fb469c2bdfdafd103af0554bfe3b/vssource-0.11.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-06 07:09:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Jaded-Encoding-Thaumaturgy",
    "github_project": "vs-source",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "VapourSynth",
            "specs": [
                [
                    ">=",
                    "68"
                ]
            ]
        },
        {
            "name": "vstools",
            "specs": [
                [
                    ">=",
                    "3.2.0"
                ]
            ]
        }
    ],
    "lcname": "vssource"
}
        
Elapsed time: 0.40649s