<p align="center">
<a href="https://github.com/rlaphoenix/mpgg">MPGG</a>
<br/>
<sup><em>Streamlined MPEG-1 and MPEG-2 source loader and helper utility for VapourSynth</em></sup>
</p>
<p align="center">
<a href="https://github.com/rlaphoenix/mpgg/actions/workflows/ci.yml">
<img src="https://github.com/rlaphoenix/mpgg/actions/workflows/ci.yml/badge.svg" alt="Build status">
</a>
<a href="https://python.org">
<img src="https://img.shields.io/badge/python-3.8%20%7C%7C%203.10-informational" alt="Python version">
</a>
<a href="https://vapoursynth.com">
<img src="https://img.shields.io/badge/vapoursynth-R58%2B-informational" alt="VapourSynth version">
</a>
<a href="https://deepsource.io/gh/rlaphoenix/mpgg/?ref=repository-badge">
<img src="https://deepsource.io/gh/rlaphoenix/mpgg.svg/?label=active+issues&token=9rxkTrTRXcRYIVl8HjRu2sYX" alt="DeepSource">
</a>
</p>
## Features
- 🎥 Supports MPEG-1 and MPEG-2 Sources
- 🧠 Understands Mixed-scan Sources
- 🤖 VFR to CFR (Variable to Constant frame rate)
- 🛠️ Automatic Frame-indexing using DGIndex
- ⚙️ Zero-configuration
- 🧩 Easy installation via PIP/PyPI
- ❤️ Fully Open-Source! Pull Requests Welcome
## Installation
```shell
$ pip install mpgg
```
Voilà 🎉! You now have the `mpgg` package installed, and you can now import it from a VapourSynth script.
### Dependencies
The following is a list of software that needs to be installed manually. MPGG cannot install these automatically
on your behalf.
#### Software
- [MKVToolnix] (specifically mkvextract) for demuxing MPEG streams from MKV containers.
- [DGIndex] for automatic frame-indexing of MPEG streams.
Make sure you put them in your current working directory, in the installation directory, or put the directory path in
your `PATH` environment variable. If you do not do this then their binaries will not be able to be found.
[MKVToolNix]: <https://mkvtoolnix.download/downloads.html>
[DGIndex]: <https://rationalqm.us/dgmpgdec/dgmpgdec.html>
#### VapourSynth Plugins
- [d2vsource] for loading an indexed DGIndex project file.
These plugins may be installed using [vsrepo] on Windows, or from a package repository on Linux.
[d2vsource]: <https://github.com/dwbuiten/d2vsource>
[vsrepo]: <https://github.com/vapoursynth/vsrepo>
## Usage
The following is an example of using MPGG to get a clean CFR Fully Progressive stream from an
Animated Mixed-scan VFR DVD-Video source.
```python
import functools
from mpgg import MPGG
from havsfunc import QTGMC
# load the source with verbose information printed
mpg = MPGG(r"C:\Users\John\Videos\animated_dvd_video.mkv", verbose=True)
# recover progressive frames where possible, and show which frames were recovered
mpg.recover(verbose=True)
# deinterlace any remaining interlaced frames with QTGMC, and show which frames were deinterlaced
mpg.deinterlace(
kernel=functools.partial(QTGMC, Preset="Very Slow", FPSDivisor=2),
verbose=True
)
# convert VFR to CFR by duplicating frames in a pattern
mpg.ceil()
# get the final clip (you may use the clip in between actions as well)
clip = mpg.clip
# ...
clip.set_output()
```
You can also chain calls! This is the same script but chained,
```python
import functools
from mpgg import MPGG
from havsfunc import QTGMC
# load MPEG, recover progressive frames, deinterlace what's left, and finally VFR to CFR
clip = MPGG(r"C:\Users\John\Videos\animated_dvd_video.mkv", verbose=True).\
recover(verbose=True).\
deinterlace(kernel=functools.partial(QTGMC, Preset="Very Slow", FPSDivisor=2), verbose=True).\
ceil().\
clip
# ...
clip.set_output()
```
There are more methods not shown here. I recommend taking a look at the MPGG class for further
information, methods, and more.
> __Warning__ Do not copy/paste and re-use these examples. Read each method's doc-string information
> as they each have their own warnings, tips, and flaws that you need to be aware of. For example,
> recover() shouldn't be used on all MPEG sources, floor() shouldn't be used with recover(), you
> may not want to use ceil() if you want to keep encoding as VFR, and such.
## Terminology
| Term | Meaning |
|----------------|--------------------------------------------------------------------------------|
| CFR | Constant frame-rate, the source uses a set frame rate on playback |
| VFR | Variable frame-rate, the source switches frame rate at least once on playback |
| Scan | The technology used to show images on screens, i.e., Interlaced or Progressive |
| Mixed-scan | Source with both Progressive and Interlaced frames within the video data |
| Frame-indexing | Analyzing a source to index frame/field information for frame-serving |
## Contributors
<a href="https://github.com/rlaphoenix"><img src="https://images.weserv.nl/?url=avatars.githubusercontent.com/u/17136956?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d" alt=""/></a>
## License
© 2021-2023 rlaphoenix — [GNU General Public License, Version 3.0](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/rlaphoenix/mpgg",
"name": "mpgg",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "vapoursynth,dvd,mpeg,mpeg2",
"author": "rlaphoenix",
"author_email": "rlaphoenix@pm.me",
"download_url": "https://files.pythonhosted.org/packages/da/3f/d9ee547e775bfdca21730ade21bf2212d150445ff9277151fe3dcd178602/mpgg-1.0.0.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <a href=\"https://github.com/rlaphoenix/mpgg\">MPGG</a>\n <br/>\n <sup><em>Streamlined MPEG-1 and MPEG-2 source loader and helper utility for VapourSynth</em></sup>\n</p>\n\n<p align=\"center\">\n <a href=\"https://github.com/rlaphoenix/mpgg/actions/workflows/ci.yml\">\n <img src=\"https://github.com/rlaphoenix/mpgg/actions/workflows/ci.yml/badge.svg\" alt=\"Build status\">\n </a>\n <a href=\"https://python.org\">\n <img src=\"https://img.shields.io/badge/python-3.8%20%7C%7C%203.10-informational\" alt=\"Python version\">\n </a>\n <a href=\"https://vapoursynth.com\">\n <img src=\"https://img.shields.io/badge/vapoursynth-R58%2B-informational\" alt=\"VapourSynth version\">\n </a>\n <a href=\"https://deepsource.io/gh/rlaphoenix/mpgg/?ref=repository-badge\">\n <img src=\"https://deepsource.io/gh/rlaphoenix/mpgg.svg/?label=active+issues&token=9rxkTrTRXcRYIVl8HjRu2sYX\" alt=\"DeepSource\">\n </a>\n</p>\n\n## Features\n\n- \ud83c\udfa5 Supports MPEG-1 and MPEG-2 Sources\n- \ud83e\udde0 Understands Mixed-scan Sources\n- \ud83e\udd16 VFR to CFR (Variable to Constant frame rate)\n- \ud83d\udee0\ufe0f Automatic Frame-indexing using DGIndex\n- \u2699\ufe0f Zero-configuration\n- \ud83e\udde9 Easy installation via PIP/PyPI\n- \u2764\ufe0f Fully Open-Source! Pull Requests Welcome\n\n## Installation\n\n```shell\n$ pip install mpgg\n```\n\nVoil\u00e0 \ud83c\udf89! You now have the `mpgg` package installed, and you can now import it from a VapourSynth script.\n\n### Dependencies\n\nThe following is a list of software that needs to be installed manually. MPGG cannot install these automatically\non your behalf.\n\n#### Software\n\n- [MKVToolnix] (specifically mkvextract) for demuxing MPEG streams from MKV containers.\n- [DGIndex] for automatic frame-indexing of MPEG streams.\n\nMake sure you put them in your current working directory, in the installation directory, or put the directory path in\nyour `PATH` environment variable. If you do not do this then their binaries will not be able to be found.\n\n [MKVToolNix]: <https://mkvtoolnix.download/downloads.html>\n [DGIndex]: <https://rationalqm.us/dgmpgdec/dgmpgdec.html>\n\n#### VapourSynth Plugins\n\n- [d2vsource] for loading an indexed DGIndex project file.\n\nThese plugins may be installed using [vsrepo] on Windows, or from a package repository on Linux.\n\n [d2vsource]: <https://github.com/dwbuiten/d2vsource>\n [vsrepo]: <https://github.com/vapoursynth/vsrepo>\n\n## Usage\n\nThe following is an example of using MPGG to get a clean CFR Fully Progressive stream from an\nAnimated Mixed-scan VFR DVD-Video source.\n\n```python\nimport functools\n\nfrom mpgg import MPGG\nfrom havsfunc import QTGMC\n\n# load the source with verbose information printed\nmpg = MPGG(r\"C:\\Users\\John\\Videos\\animated_dvd_video.mkv\", verbose=True)\n\n# recover progressive frames where possible, and show which frames were recovered\nmpg.recover(verbose=True)\n\n# deinterlace any remaining interlaced frames with QTGMC, and show which frames were deinterlaced\nmpg.deinterlace(\n kernel=functools.partial(QTGMC, Preset=\"Very Slow\", FPSDivisor=2),\n verbose=True\n)\n\n# convert VFR to CFR by duplicating frames in a pattern\nmpg.ceil()\n\n# get the final clip (you may use the clip in between actions as well)\nclip = mpg.clip\n\n# ...\n\nclip.set_output()\n```\n\nYou can also chain calls! This is the same script but chained,\n\n```python\nimport functools\n\nfrom mpgg import MPGG\nfrom havsfunc import QTGMC\n\n# load MPEG, recover progressive frames, deinterlace what's left, and finally VFR to CFR\nclip = MPGG(r\"C:\\Users\\John\\Videos\\animated_dvd_video.mkv\", verbose=True).\\\n recover(verbose=True).\\\n deinterlace(kernel=functools.partial(QTGMC, Preset=\"Very Slow\", FPSDivisor=2), verbose=True).\\\n ceil().\\\n clip\n\n# ...\n\nclip.set_output()\n```\n\nThere are more methods not shown here. I recommend taking a look at the MPGG class for further\ninformation, methods, and more.\n\n> __Warning__ Do not copy/paste and re-use these examples. Read each method's doc-string information\n> as they each have their own warnings, tips, and flaws that you need to be aware of. For example,\n> recover() shouldn't be used on all MPEG sources, floor() shouldn't be used with recover(), you\n> may not want to use ceil() if you want to keep encoding as VFR, and such.\n\n## Terminology\n\n| Term | Meaning |\n|----------------|--------------------------------------------------------------------------------|\n| CFR | Constant frame-rate, the source uses a set frame rate on playback |\n| VFR | Variable frame-rate, the source switches frame rate at least once on playback |\n| Scan | The technology used to show images on screens, i.e., Interlaced or Progressive |\n| Mixed-scan | Source with both Progressive and Interlaced frames within the video data |\n| Frame-indexing | Analyzing a source to index frame/field information for frame-serving |\n\n## Contributors\n\n<a href=\"https://github.com/rlaphoenix\"><img src=\"https://images.weserv.nl/?url=avatars.githubusercontent.com/u/17136956?v=4&h=25&w=25&fit=cover&mask=circle&maxage=7d\" alt=\"\"/></a>\n\n## License\n\n\u00a9 2021-2023 rlaphoenix \u2014 [GNU General Public License, Version 3.0](LICENSE)\n",
"bugtrack_url": null,
"license": "GPL-3.0-only",
"summary": "Streamlined MPEG-1 and MPEG-2 source loader and helper utility for VapourSynth",
"version": "1.0.0",
"split_keywords": [
"vapoursynth",
"dvd",
"mpeg",
"mpeg2"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7abf8a56c63d00ee5d9092d74aa4b98e892c0e9a692fc266754d15a6c0cfc38a",
"md5": "9be5d4b2e220dab79c3ef54a219fff04",
"sha256": "1adcc8e24eabd09868eb63baa3d88ec21090f2f385ae979cf30348eb2451fc33"
},
"downloads": -1,
"filename": "mpgg-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9be5d4b2e220dab79c3ef54a219fff04",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 23643,
"upload_time": "2023-03-30T13:47:25",
"upload_time_iso_8601": "2023-03-30T13:47:25.314981Z",
"url": "https://files.pythonhosted.org/packages/7a/bf/8a56c63d00ee5d9092d74aa4b98e892c0e9a692fc266754d15a6c0cfc38a/mpgg-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "da3fd9ee547e775bfdca21730ade21bf2212d150445ff9277151fe3dcd178602",
"md5": "20e30ef902b719d0da5a279248760890",
"sha256": "5f008c5a701b94e3ef9b4adadb7d42da80e6dd42cbe38f5eefae98d5016e20c2"
},
"downloads": -1,
"filename": "mpgg-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "20e30ef902b719d0da5a279248760890",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 25066,
"upload_time": "2023-03-30T13:47:26",
"upload_time_iso_8601": "2023-03-30T13:47:26.595988Z",
"url": "https://files.pythonhosted.org/packages/da/3f/d9ee547e775bfdca21730ade21bf2212d150445ff9277151fe3dcd178602/mpgg-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-30 13:47:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "rlaphoenix",
"github_project": "mpgg",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "mpgg"
}