summaryrefslogtreecommitdiff
path: root/python-pvsfunc.spec
blob: 6d2e3ac505f8eed06ab85292f27541eeda262979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
%global _empty_manifest_terminate_build 0
Name:		python-pvsfunc
Version:	4.4.0
Release:	1
Summary:	PHOENiX's compilation of VapourSynth Script's and Functions
License:	GPL-3.0-or-later
URL:		https://github.com/rlaphoenix/pvsfunc
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/2c/f1/f576f1011fbfaa171b95f504cc68dfb5b344ee408b602b1a93f6e047a009/pvsfunc-4.4.0.tar.gz
BuildArch:	noarch

Requires:	python3-pymediainfo
Requires:	python3-pyd2v
Requires:	python3-more-itertools

%description
# pvsfunc

pvsfunc (PHOENiX's VapourSynth Functions) is my compilation of VapourSynth Scripts, Functions, and Helpers.

[![Build Tests](https://img.shields.io/github/workflow/status/rlaphoenix/pvsfunc/ci?label=Python%203.7%2B%20builds)](https://github.com/rlaphoenix/pvsfunc/actions?query=workflow%3A%22ci%22)
[![License](https://img.shields.io/github/license/rlaphoenix/pvsfunc?style=flat)](https://github.com/rlaphoenix/pvsfunc/blob/master/LICENSE)
[![DeepSource](https://deepsource.io/gh/rlaphoenix/pvsfunc.svg)](https://deepsource.io/gh/rlaphoenix/pvsfunc)
[![Issues](https://img.shields.io/github/issues/rlaphoenix/pvsfunc?style=flat)](https://github.com/rlaphoenix/pvsfunc/issues)
[![PR's Accepted](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://makeapullrequest.com)

## Installation

Install [VapourSynth] first! (this is different to the pypi/pip `vapoursynth` python wrapper!)

    pip install --user pvsfunc

Done! However, there are further dependencies listed below that you may need to install depending on the classes you
intend to use, and your use-case. Don't forget to install them if needed!

  [VapourSynth]: <https://www.vapoursynth.com/doc/installation.html>

## Building

Building from source requires [Poetry](https://python-poetry.org).  
Simply run `poetry install` or `poetry build` for distribution wheel and source packages.

## License

This project is released under the GNU GENERAL PUBLIC LICENSE Version 3 (GPLv3) license.
Please read and agree to the license before use, it can be found in the [LICENSE](LICENSE) file.

* * *

Below is information about the projects included in pvsfunc that are available to use. Don't take it as full
documentation as that is being worked on.

## PD2V

Convenience class for working with DGIndex D2V project files (MPEG-1/2 videos). Includes source loading, frame
matching, deinterlacing, and more.

### Example Usage

```py
from pvsfunc import PD2V
from functools import partial
from havsfunc import QTGMC

clip = PD2V(r"C:\Users\john\Videos\s01e01.d2v", verbose=True).\
    ceil().\
    deinterlace(
        kernel=partial(QTGMC, FPSDivisor=2, Preset="Very Slow"),
        verbose=True
    ).\
    clip

# ... any manual changes to clip

clip.set_output()
```

The above example will load a D2V project file located at `C:\Users\john\Videos\s01e01.d2v` in Verbose mode.
Verbose mode will display extra information during the PD2V use.

It then runs `ceil()` which frame-matches the progressive sections of the video with the interlaced sections by
duplicating the progressive frames (instead of interlacing).

It then deinterlaces the interlaced sections of the video with QTGMC as the kernel. The Kernel must have a `tff` or
`TFF` argument to be compatible, but the field order should not be manually set by the user.

Finally, it takes the clip and set's it for VapourSynth output.

### Dependencies

- [d2vsource] (core.d2v) VapourSynth plugin
- [DGIndex] v1.5.8 or newer
- [mkvextract] Only required if you plan on providing non demuxed streams (e.g., mp4, mkv)

To install [d2vsource] it's as simple as `vsrepo install d2vsource` on Windows. Other Operating System user's know the
drill, go check your package repository's or compile it yourself.

Make sure [DGIndex] and [mkvextract] is available on your environment path and has execution permissions. Note Linux
Users: Add to system profile path, not terminal/rc path. DGIndex is Windows-only but is supported if you install Wine.

## PLS

Convenience class for working with L-SMASH-WORKS LWI project files. Includes source loading and deinterlacing.
More features are to be implemented in the future once a Python-based LWI project parser is available.

Refer to PD2Vs example usage as it's very similar to how PLS is used.

### Dependencies

- [lsmash] (core.lsmas) VapourSynth plugin
- [mkvmerge] Only required if input file has a container-set frame rate that differs to the encoded frame rate

To install [lsmash] it's as simple as `vsrepo install lsmas` on Windows. Other Operating System user's know the drill,
go check your package repository's or compile it yourself.

Make sure [mkvmerge] is available on your environment path and has execution permissions. Note Linux Users: Add to
system profile path, not terminal/rc path.

## PDebox

Lightweight class to apply de-boxing based on an output aspect-ratio. Similar scripts would annoyingly want you to
just crop in yourself which is incredibly annoying.

## PDecimate

Decimate (delete) frames in a specified pattern using cycle and offsets. This is typically used for Inverse-Telecine
purposes.

Decimation may often be done for IVTC purposes to remove constant pattern pulldown frames.

## PKernel

Kernel storage class for any custom Deinterlacing kernels I'm working on or tinkering with that you may want to use.
Just know that they are most likely not the type of deinterlacing you may expect, as it's generally a playground for
looking into strange tactics of deinterlacing.

### VoidWeave

VoidWeave is a deinterlacing method involving in-painting with machine-learning.

It takes footage and separates the weaved fields so that each field is full-height with the missing data of the field
being 255 RGB green instead of empty/black. The in-painting machine-learning system would then in-paint the missing
data wherever it finds the 255 RGB Green pixels. It works quite well as YUV 4:2:0 DVD data doesn't seem to ever reach
255 green though it does get close, but never quite 255.

I tested it on a Live Action DVD and the results were honestly outstanding! The time it took to run the in-painting
was about the same as QTGMC on Very Slow, with similar results! I think where this method may really shine is with
Cartoon/Animated sources as QTGMC does not do them well.

It all still requires a lot more testing, but it looks like it could be a really nice method! Especially now that I've
learned Disney has also been working on it around the same tim, back in 2020 :P

  [d2vsource]: https://github.com/dwbuiten/d2vsource
  [DGIndex]: http://rationalqm.us/dgmpgdec/dgmpgdec.html
  [mkvextract]: https://mkvtoolnix.download
  [mkvmerge]: https://mkvtoolnix.download
  [lsmash]: https://github.com/VFR-maniac/L-SMASH-Works


%package -n python3-pvsfunc
Summary:	PHOENiX's compilation of VapourSynth Script's and Functions
Provides:	python-pvsfunc
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-pvsfunc
# pvsfunc

pvsfunc (PHOENiX's VapourSynth Functions) is my compilation of VapourSynth Scripts, Functions, and Helpers.

[![Build Tests](https://img.shields.io/github/workflow/status/rlaphoenix/pvsfunc/ci?label=Python%203.7%2B%20builds)](https://github.com/rlaphoenix/pvsfunc/actions?query=workflow%3A%22ci%22)
[![License](https://img.shields.io/github/license/rlaphoenix/pvsfunc?style=flat)](https://github.com/rlaphoenix/pvsfunc/blob/master/LICENSE)
[![DeepSource](https://deepsource.io/gh/rlaphoenix/pvsfunc.svg)](https://deepsource.io/gh/rlaphoenix/pvsfunc)
[![Issues](https://img.shields.io/github/issues/rlaphoenix/pvsfunc?style=flat)](https://github.com/rlaphoenix/pvsfunc/issues)
[![PR's Accepted](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://makeapullrequest.com)

## Installation

Install [VapourSynth] first! (this is different to the pypi/pip `vapoursynth` python wrapper!)

    pip install --user pvsfunc

Done! However, there are further dependencies listed below that you may need to install depending on the classes you
intend to use, and your use-case. Don't forget to install them if needed!

  [VapourSynth]: <https://www.vapoursynth.com/doc/installation.html>

## Building

Building from source requires [Poetry](https://python-poetry.org).  
Simply run `poetry install` or `poetry build` for distribution wheel and source packages.

## License

This project is released under the GNU GENERAL PUBLIC LICENSE Version 3 (GPLv3) license.
Please read and agree to the license before use, it can be found in the [LICENSE](LICENSE) file.

* * *

Below is information about the projects included in pvsfunc that are available to use. Don't take it as full
documentation as that is being worked on.

## PD2V

Convenience class for working with DGIndex D2V project files (MPEG-1/2 videos). Includes source loading, frame
matching, deinterlacing, and more.

### Example Usage

```py
from pvsfunc import PD2V
from functools import partial
from havsfunc import QTGMC

clip = PD2V(r"C:\Users\john\Videos\s01e01.d2v", verbose=True).\
    ceil().\
    deinterlace(
        kernel=partial(QTGMC, FPSDivisor=2, Preset="Very Slow"),
        verbose=True
    ).\
    clip

# ... any manual changes to clip

clip.set_output()
```

The above example will load a D2V project file located at `C:\Users\john\Videos\s01e01.d2v` in Verbose mode.
Verbose mode will display extra information during the PD2V use.

It then runs `ceil()` which frame-matches the progressive sections of the video with the interlaced sections by
duplicating the progressive frames (instead of interlacing).

It then deinterlaces the interlaced sections of the video with QTGMC as the kernel. The Kernel must have a `tff` or
`TFF` argument to be compatible, but the field order should not be manually set by the user.

Finally, it takes the clip and set's it for VapourSynth output.

### Dependencies

- [d2vsource] (core.d2v) VapourSynth plugin
- [DGIndex] v1.5.8 or newer
- [mkvextract] Only required if you plan on providing non demuxed streams (e.g., mp4, mkv)

To install [d2vsource] it's as simple as `vsrepo install d2vsource` on Windows. Other Operating System user's know the
drill, go check your package repository's or compile it yourself.

Make sure [DGIndex] and [mkvextract] is available on your environment path and has execution permissions. Note Linux
Users: Add to system profile path, not terminal/rc path. DGIndex is Windows-only but is supported if you install Wine.

## PLS

Convenience class for working with L-SMASH-WORKS LWI project files. Includes source loading and deinterlacing.
More features are to be implemented in the future once a Python-based LWI project parser is available.

Refer to PD2Vs example usage as it's very similar to how PLS is used.

### Dependencies

- [lsmash] (core.lsmas) VapourSynth plugin
- [mkvmerge] Only required if input file has a container-set frame rate that differs to the encoded frame rate

To install [lsmash] it's as simple as `vsrepo install lsmas` on Windows. Other Operating System user's know the drill,
go check your package repository's or compile it yourself.

Make sure [mkvmerge] is available on your environment path and has execution permissions. Note Linux Users: Add to
system profile path, not terminal/rc path.

## PDebox

Lightweight class to apply de-boxing based on an output aspect-ratio. Similar scripts would annoyingly want you to
just crop in yourself which is incredibly annoying.

## PDecimate

Decimate (delete) frames in a specified pattern using cycle and offsets. This is typically used for Inverse-Telecine
purposes.

Decimation may often be done for IVTC purposes to remove constant pattern pulldown frames.

## PKernel

Kernel storage class for any custom Deinterlacing kernels I'm working on or tinkering with that you may want to use.
Just know that they are most likely not the type of deinterlacing you may expect, as it's generally a playground for
looking into strange tactics of deinterlacing.

### VoidWeave

VoidWeave is a deinterlacing method involving in-painting with machine-learning.

It takes footage and separates the weaved fields so that each field is full-height with the missing data of the field
being 255 RGB green instead of empty/black. The in-painting machine-learning system would then in-paint the missing
data wherever it finds the 255 RGB Green pixels. It works quite well as YUV 4:2:0 DVD data doesn't seem to ever reach
255 green though it does get close, but never quite 255.

I tested it on a Live Action DVD and the results were honestly outstanding! The time it took to run the in-painting
was about the same as QTGMC on Very Slow, with similar results! I think where this method may really shine is with
Cartoon/Animated sources as QTGMC does not do them well.

It all still requires a lot more testing, but it looks like it could be a really nice method! Especially now that I've
learned Disney has also been working on it around the same tim, back in 2020 :P

  [d2vsource]: https://github.com/dwbuiten/d2vsource
  [DGIndex]: http://rationalqm.us/dgmpgdec/dgmpgdec.html
  [mkvextract]: https://mkvtoolnix.download
  [mkvmerge]: https://mkvtoolnix.download
  [lsmash]: https://github.com/VFR-maniac/L-SMASH-Works


%package help
Summary:	Development documents and examples for pvsfunc
Provides:	python3-pvsfunc-doc
%description help
# pvsfunc

pvsfunc (PHOENiX's VapourSynth Functions) is my compilation of VapourSynth Scripts, Functions, and Helpers.

[![Build Tests](https://img.shields.io/github/workflow/status/rlaphoenix/pvsfunc/ci?label=Python%203.7%2B%20builds)](https://github.com/rlaphoenix/pvsfunc/actions?query=workflow%3A%22ci%22)
[![License](https://img.shields.io/github/license/rlaphoenix/pvsfunc?style=flat)](https://github.com/rlaphoenix/pvsfunc/blob/master/LICENSE)
[![DeepSource](https://deepsource.io/gh/rlaphoenix/pvsfunc.svg)](https://deepsource.io/gh/rlaphoenix/pvsfunc)
[![Issues](https://img.shields.io/github/issues/rlaphoenix/pvsfunc?style=flat)](https://github.com/rlaphoenix/pvsfunc/issues)
[![PR's Accepted](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)](https://makeapullrequest.com)

## Installation

Install [VapourSynth] first! (this is different to the pypi/pip `vapoursynth` python wrapper!)

    pip install --user pvsfunc

Done! However, there are further dependencies listed below that you may need to install depending on the classes you
intend to use, and your use-case. Don't forget to install them if needed!

  [VapourSynth]: <https://www.vapoursynth.com/doc/installation.html>

## Building

Building from source requires [Poetry](https://python-poetry.org).  
Simply run `poetry install` or `poetry build` for distribution wheel and source packages.

## License

This project is released under the GNU GENERAL PUBLIC LICENSE Version 3 (GPLv3) license.
Please read and agree to the license before use, it can be found in the [LICENSE](LICENSE) file.

* * *

Below is information about the projects included in pvsfunc that are available to use. Don't take it as full
documentation as that is being worked on.

## PD2V

Convenience class for working with DGIndex D2V project files (MPEG-1/2 videos). Includes source loading, frame
matching, deinterlacing, and more.

### Example Usage

```py
from pvsfunc import PD2V
from functools import partial
from havsfunc import QTGMC

clip = PD2V(r"C:\Users\john\Videos\s01e01.d2v", verbose=True).\
    ceil().\
    deinterlace(
        kernel=partial(QTGMC, FPSDivisor=2, Preset="Very Slow"),
        verbose=True
    ).\
    clip

# ... any manual changes to clip

clip.set_output()
```

The above example will load a D2V project file located at `C:\Users\john\Videos\s01e01.d2v` in Verbose mode.
Verbose mode will display extra information during the PD2V use.

It then runs `ceil()` which frame-matches the progressive sections of the video with the interlaced sections by
duplicating the progressive frames (instead of interlacing).

It then deinterlaces the interlaced sections of the video with QTGMC as the kernel. The Kernel must have a `tff` or
`TFF` argument to be compatible, but the field order should not be manually set by the user.

Finally, it takes the clip and set's it for VapourSynth output.

### Dependencies

- [d2vsource] (core.d2v) VapourSynth plugin
- [DGIndex] v1.5.8 or newer
- [mkvextract] Only required if you plan on providing non demuxed streams (e.g., mp4, mkv)

To install [d2vsource] it's as simple as `vsrepo install d2vsource` on Windows. Other Operating System user's know the
drill, go check your package repository's or compile it yourself.

Make sure [DGIndex] and [mkvextract] is available on your environment path and has execution permissions. Note Linux
Users: Add to system profile path, not terminal/rc path. DGIndex is Windows-only but is supported if you install Wine.

## PLS

Convenience class for working with L-SMASH-WORKS LWI project files. Includes source loading and deinterlacing.
More features are to be implemented in the future once a Python-based LWI project parser is available.

Refer to PD2Vs example usage as it's very similar to how PLS is used.

### Dependencies

- [lsmash] (core.lsmas) VapourSynth plugin
- [mkvmerge] Only required if input file has a container-set frame rate that differs to the encoded frame rate

To install [lsmash] it's as simple as `vsrepo install lsmas` on Windows. Other Operating System user's know the drill,
go check your package repository's or compile it yourself.

Make sure [mkvmerge] is available on your environment path and has execution permissions. Note Linux Users: Add to
system profile path, not terminal/rc path.

## PDebox

Lightweight class to apply de-boxing based on an output aspect-ratio. Similar scripts would annoyingly want you to
just crop in yourself which is incredibly annoying.

## PDecimate

Decimate (delete) frames in a specified pattern using cycle and offsets. This is typically used for Inverse-Telecine
purposes.

Decimation may often be done for IVTC purposes to remove constant pattern pulldown frames.

## PKernel

Kernel storage class for any custom Deinterlacing kernels I'm working on or tinkering with that you may want to use.
Just know that they are most likely not the type of deinterlacing you may expect, as it's generally a playground for
looking into strange tactics of deinterlacing.

### VoidWeave

VoidWeave is a deinterlacing method involving in-painting with machine-learning.

It takes footage and separates the weaved fields so that each field is full-height with the missing data of the field
being 255 RGB green instead of empty/black. The in-painting machine-learning system would then in-paint the missing
data wherever it finds the 255 RGB Green pixels. It works quite well as YUV 4:2:0 DVD data doesn't seem to ever reach
255 green though it does get close, but never quite 255.

I tested it on a Live Action DVD and the results were honestly outstanding! The time it took to run the in-painting
was about the same as QTGMC on Very Slow, with similar results! I think where this method may really shine is with
Cartoon/Animated sources as QTGMC does not do them well.

It all still requires a lot more testing, but it looks like it could be a really nice method! Especially now that I've
learned Disney has also been working on it around the same tim, back in 2020 :P

  [d2vsource]: https://github.com/dwbuiten/d2vsource
  [DGIndex]: http://rationalqm.us/dgmpgdec/dgmpgdec.html
  [mkvextract]: https://mkvtoolnix.download
  [mkvmerge]: https://mkvtoolnix.download
  [lsmash]: https://github.com/VFR-maniac/L-SMASH-Works


%prep
%autosetup -n pvsfunc-4.4.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-pvsfunc -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 4.4.0-1
- Package Spec generated