Skip to content

Commit 3bd1649

Browse files
committed
added support stitching for start_encode
1 parent 20be7f3 commit 3bd1649

File tree

10 files changed

+24
-10
lines changed

10 files changed

+24
-10
lines changed

qencode/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,9 @@ def x265_video_codec():
2929

3030
from exeptions import QencodeClientException, QencodeTaskException
3131

32+
__version__ = "0.9.15"
33+
__status__ = "Beta"
34+
__author__ = "Qencode"
35+
3236

3337

qencode/task.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,15 @@ def _prepare_query(self, params):
110110
def _prepare_data(self, profiles, video_url, **kwargs):
111111
data = dict(
112112
task_token=self.task_token,
113-
uri=video_url,
114113
profiles=', '.join(profiles) if type(profiles).__name__ == 'list' else profiles
115114
)
115+
if isinstance(video_url, list):
116+
try:
117+
data.update(stitch=json.dumps(video_url))
118+
except Exception:
119+
data.update(stitch=video_url)
120+
else:
121+
data.update(uri=video_url)
116122
if kwargs:
117123
data.update(kwargs)
118124
return data

sample-code/query.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{"query": {
22

3-
"source": "https://qa.qencode.com/static/test_mini.mp4",
3+
"source": "https://qencode.com/static/test_mini.mp4",
44
"format": [
55
{
66
"output": "mp4",

sample-code/start_custom_hls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
FORMAT.destination = DESTINATION
3737

3838
#replace with a link to your input video
39-
params.source = 'https://qa.qencode.com/static/1.mp4'
39+
params.source = 'https://qencode.com/static/1.mp4'
4040
params.format = [FORMAT]
4141

4242

sample-code/start_custom_mp4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
FORMAT.destination = DESTINATION
3030

3131
#replace with a link to your input video
32-
params.source = 'https://qa.qencode.com/static/1.mp4'
32+
params.source = 'https://qencode.com/static/1.mp4'
3333
params.format = [FORMAT]
3434

3535

sample-code/start_custom_with_dict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
API_KEY = 'your-api-qencode-key'
1515

1616
#replace with a link to your input video
17-
source_url = "https://qa.qencode.com/static/1.mp4"
17+
source_url = "https://qencode.com/static/1.mp4"
1818

1919
format_240 = dict(
2020
output="mp4",

sample-code/start_custom_with_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
params = """
1616
{"query": {
17-
"source": "https://qa.qencode.com/static/1.mp4",
17+
"source": "https://qencode.com/static/1.mp4",
1818
"format": [
1919
{
2020
"output": "mp4",

sample-code/start_encode.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
TRANSCODING_PROFILEID = 'your-qencode-profile-id'
1818

1919
#replace with a link to your input video
20-
VIDEO_URL = 'https://qa.qencode.com/static/1.mp4'
20+
VIDEO_URL = 'https://qencode.com/static/1.mp4'
21+
# or stitch
22+
#STITCH = ["https://qencode.com/static/1.mp4", 'https://qencode.com/static/timer.mp4']
2123

2224

2325
def start_encode():
@@ -43,6 +45,8 @@ def start_encode():
4345
raise QencodeTaskException(task.message)
4446

4547
task.start(TRANSCODING_PROFILEID, VIDEO_URL)
48+
#or stitch
49+
#task.start(TRANSCODING_PROFILEID, STITCH)
4650

4751
if task.error:
4852
raise QencodeTaskException(task.message)

sample-code/start_with_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
TRANSCODING_PROFILEID = 'your-qencode-profile-id'
1818

1919
#replace with a link to your input video
20-
VIDEO_URL = 'https://qa.qencode.com/static/1.mp4'
20+
VIDEO_URL = 'https://qencode.com/static/1.mp4'
2121

2222

2323
def progress_changed_handler(status):

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
setup(
1010
name='qencode',
11-
version='0.9.14',
11+
version='0.9.15',
1212
description='Qencode Python SDK',
1313
url='https://github.com/qencode-dev/qencode-api-python-client',
1414
# url=here,
1515
author='Qencode Developer',
1616
author_email='team@qencode.com',
1717
license='proprietary',
1818
classifiers=[
19-
'Development Status :: 3 - Alpha',
19+
'Development Status :: 4 - Beta',
2020
'Intended Audience :: Developers',
2121
'Topic :: Software Development :: Build Tools',
2222
'License :: Other/Proprietary License',

0 commit comments

Comments
 (0)