Skip to content

Commit

Permalink
Ready for first push to pypi repo
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmithjr committed Feb 20, 2019
1 parent 4e6a0b7 commit df8c0ed
Show file tree
Hide file tree
Showing 14 changed files with 1,141 additions and 13 deletions.
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
PlexAPI = "*"

[requires]
python_version = "3.6"
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ nVida CUDA-enabled graphics card or Intel accelerated video (QSV)
* Python 3 (3.6 or higher)
* Python PlexAPI package (optional). Install with `pip3 install plexapi`

### Installation

```
pip3 install pytranscoder-ffmpeg
```

### Configuration

There is a supplied sample *transcode.yml* config file. This can be customized all you like, however be
Expand Down Expand Up @@ -207,39 +213,39 @@ folder as the source with the same name and a .tmp extension.
To get help:
```bash
python3 transcode.py -h
pytranscoder -h
```

To transcode 2 files using a specific profile:
```bash
python3 transcode.py -p x264 /tmp/video1.mp4 /tmp/video2.mp4
pytranscoder -p x264 /tmp/video1.mp4 /tmp/video2.mp4

```

To transcode 2 files using different profiles:
```bash
python3 transcode.py -p x264 /tmp/video1.mp4 -p hevc /tmp/video2.mp4
pytranscoder -p x264 /tmp/video1.mp4 -p hevc /tmp/video2.mp4

```

To transcode everything in a master file, defaulting to rules to match profiles:
```bash
python3 transcode.py --from-file /tmp/queue.txt
pytranscoder --from-file /tmp/queue.txt

```
To do a test run without transcoding, to see which profiles will match and the *ffmpeg* command:
```bash
python3 transcode.py --dry-run atestvideo.mp4
pytranscoder --dry-run atestvideo.mp4

```

To transcode everything in a master file, using a forced profile for all:
```bash
python3 transcode.py -p hevc_hd_preserve --from-file /tmp/queue.txt
pytranscoder -p hevc_hd_preserve --from-file /tmp/queue.txt

```

If configured for concurrency but want to transcode a bunch of files sequentially only:
```bash
python3 transcode.py -s *.mp4
```
pytranscoder -s *.mp4
```
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3 setup.py sdist bdist_wheel

File renamed without changes.
4 changes: 4 additions & 0 deletions build/lib/pytranscoder/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import transcode

def main():
trancoder.main()
6 changes: 5 additions & 1 deletion transcoder/transcode.py → build/lib/pytranscoder/transcode.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ def enqueue_files(files: list):
# complete.add(path)
# continue

if __name__ == '__main__':

def main():

if len(sys.argv) == 2 and sys.argv[1] == '-h':
print('usage: {} [OPTIONS]'.format(sys.argv[0], ))
Expand Down Expand Up @@ -397,6 +398,9 @@ def enqueue_files(files: list):
os.system("stty sane")


if __name__ == '__main__':
main()


SAMPLE_YAML = """
##
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions build/lib/transcoder/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import transcode

def main():
trancoder.main()
Loading

0 comments on commit df8c0ed

Please sign in to comment.