diff --git a/README.md b/README.md index 45fbb4d..5a048ba 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,32 @@ ## qencode-api-python3-client - **install sdk libraries from github** -```` +```sh cd your-workspace-folder git clone https://github.com/qencode-dev/qencode-api-python3-client cd qencode-api-python3-client pip install -r requirements.txt python setup.py install -```` +``` + **install from pip** -```` -sudo pip install qencode3 -```` +```sh +pip install qencode3 +``` **Usage** -```` -import qencode +```python +import qencode3 -client = qencode.client(API_KEY) +client = qencode3.client(API_KEY) client.create() task = client.create_task() task.start(TRANSCODING_PROFILEID, VIDO_URL) - -```` +``` **Documentation** @@ -40,31 +39,34 @@ Here you will find examples of Qencode solutions using the latest version of pyt Key features of encoding your videos: Output Formats - * HLS - * MPEG-DASH - * MP4 - * MXF - * WebM + +- HLS +- MPEG-DASH +- MP4 +- MXF +- WebM Codecs - * H.264 (AVC1) - * H.265 (HEVC) - * VP9 - * VP8 - * AV1 - * MPEG-2 + +- H.264 (AVC1) +- H.265 (HEVC) +- VP9 +- VP8 +- AV1 +- MPEG-2 Input Formats - * MP4 - * AVI - * MOV - * MKV - * HLS - * MPEG‑2 (TS & PS) - * MXF - * ASF - * ProRes - * XDCAM - * DNx - * FLV - * ...and many more \ No newline at end of file + +- MP4 +- AVI +- MOV +- MKV +- HLS +- MPEG‑2 (TS & PS) +- MXF +- ASF +- ProRes +- XDCAM +- DNx +- FLV +- ...and many more diff --git a/docs/quickstart.md b/docs/quickstart.md index 1e3d61e..b5f7e0b 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -2,28 +2,27 @@ **install sdk libraries from github** -```` +```sh cd your-workspace-folder -git clone https://github.com/qencode-dev/qencode-api-python-client -cd qencode-api-python-client +git clone https://github.com/qencode-dev/qencode-api-python3-client +cd qencode-api-python3-client pip install -r requirements.txt python setup.py install -```` +``` **Usage** -```` -import qencode +```python +import qencode3 -client = qencode.client(API_KEY) +client = qencode3.client(API_KEY) client.create() task = client.create_task() -task.start(TRANSCODING_PROFILEID, VIDO_URL) - -```` +task.start(TRANSCODING_PROFILEID, VIDEO_URL) +``` **Documentation** -Documentation is available at \ No newline at end of file +Documentation is available at diff --git a/docs/usage.md b/docs/usage.md index 89c99b6..954c806 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -2,17 +2,17 @@ **Usage by transcoding profile ID** -```` +```python import sys import os.path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) -import qencode +import qencode3 import time API_KEY = 'Your API KEY' TRANSCODING_PROFILEID = 'Your profile ID' -VIDO_URL = 'your source url' +VIDEO_URL = 'your source url' @@ -24,7 +24,7 @@ def start_encode(): :param api_version: int. not required. default 'v1' :return: client object """ - client = qencode.client(API_KEY) + client = qencode3.client(API_KEY) client.create() if client.error: print 'encoder error:', client.error, client.message @@ -36,14 +36,14 @@ def start_encode(): task = client.create_task() task.start_time = 0.0 task.duration = 10.0 - task.start(TRANSCODING_PROFILEID, VIDO_URL) + task.start(TRANSCODING_PROFILEID, VIDEO_URL) if task.error: print 'task error:', task.error, task.message raise SystemExit while True: status = task.status() - print '{0} | {1} | {2} | error: {3}'.format(VIDO_URL, + print '{0} | {1} | {2} | error: {3}'.format(VIDEO_URL, status.get('status'), status.get('percent'), status.get('error'), @@ -57,25 +57,25 @@ def start_encode(): if __name__ == '__main__': start_encode() -```` +``` **Usage by custom parameters** -```` +``` import sys import os.path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))) -import qencode +import qencode3 import time API_KEY = 'Your API KEY' -params = qencode.custom_params() +params = qencode3.custom_params() -FORMAT = qencode.format() -STREAM = qencode.stream() -DESTINATION = qencode.destination() -VIDEO_CODEC = qencode.x264_video_codec() +FORMAT = qencode3.format() +STREAM = qencode3.stream() +DESTINATION = qencode3.destination() +VIDEO_CODEC = qencode3.x264_video_codec() DESTINATION.url = "..." @@ -111,7 +111,7 @@ def start_encode(): :param api_version: int. not required. default 'v1' :return: client object """ - client = qencode.client(API_KEY) + client = qencode3.client(API_KEY) client.create() if client.error: print 'encoder error:', client.error, client.message @@ -144,25 +144,26 @@ def start_encode(): if __name__ == '__main__': start_encode() -```` +``` + **Usage with callback methods** -```` +```python def my_callback(e): print e def my_callback2(e): print e - -... -task.start(TRANSCODING_PROFILEID, VIDO_URL) -if task.error: +# ... + +task.start(TRANSCODING_PROFILEID, VIDEO_URL) +if task.error: raise SystemExit task.progress_changed(my_callback) task.task_completed(my_callback2) -```` +``` **Documentation**