72.1.1
by Jason Gerard DeRose
Added another static demo for testing |
1 |
#!/usr/bin/python3
|
2 |
||
3 |
import json |
|
4 |
import time |
|
5 |
from microfiber import dmedia_env, Database, Conflict |
|
82.1.3
by Jason Gerard DeRose
create-demo-project now nits views |
6 |
from novacut import schema, views |
72.1.2
by Jason Gerard DeRose
Added new schema.save_to_intrinsic() function |
7 |
from collections import OrderedDict |
72.1.1
by Jason Gerard DeRose
Added another static demo for testing |
8 |
|
9 |
docs = json.load(open('demo.json', 'r')) |
|
10 |
for doc in docs: |
|
11 |
doc['ver'] = 0 |
|
12 |
doc['time'] = time.time() |
|
13 |
||
14 |
||
15 |
p = { |
|
16 |
'_id': '5A236DNAC6NMS5XIBUMHTY2A', |
|
17 |
'ver': 0, |
|
18 |
'title': '2 Clip Demo', |
|
19 |
'db_name': 'novacut-0-5a236dnac6nms5xibumhty2a', |
|
20 |
'time': 1327022245.45872, |
|
21 |
'atime': 1327022245.45872, |
|
22 |
'type': 'novacut/project', |
|
23 |
}
|
|
24 |
||
25 |
env = dmedia_env() |
|
26 |
db = Database('novacut-0', env) |
|
27 |
db.ensure() |
|
28 |
project = Database(p['db_name'], env) |
|
29 |
if project.ensure(): |
|
30 |
project.post(p) |
|
72.1.6
by Jason Gerard DeRose
Got tweaked demo working, but needed to change Dmedia.HashAndMove() API a bit |
31 |
project.post({'docs': docs}, '_bulk_docs') |
72.1.1
by Jason Gerard DeRose
Added another static demo for testing |
32 |
try: |
33 |
db.save(p) |
|
34 |
except Conflict: |
|
35 |
pass
|
|
86
by Jason Gerard DeRose
Tweaked schema.intrinsic_graph() to make it a bit easier to use in real-life |
36 |
#db.post({'docs': docs}, '_bulk_docs')
|
72.1.1
by Jason Gerard DeRose
Added another static demo for testing |
37 |
|
87
by Jason Gerard DeRose
Got reasonable way to trigger renders and get signal when it's finished |
38 |
raise SystemExit() |
39 |
||
82.1.3
by Jason Gerard DeRose
create-demo-project now nits views |
40 |
views.init_views(db, views.novacut_main) |
41 |
views.init_views(project, views.novacut_projects) |
|
42 |
||
72.1.5
by Jason Gerard DeRose
Started work on revamp of how render jobs are dispatched |
43 |
root = schema.save_to_intrinsic('AUABDULVRZIBH727GQP2HXSA', project, db) |
44 |
print('root:', root) |
|
72.1.4
by Jason Gerard DeRose
bit of doodling on splitting things into render settings and job |
45 |
|
46 |
node = { |
|
47 |
'muxer': {'name': 'oggmux'}, |
|
48 |
'video': { |
|
49 |
'encoder': { |
|
50 |
'name': 'theoraenc', |
|
51 |
'props': { |
|
52 |
'quality': 52, |
|
53 |
},
|
|
54 |
},
|
|
55 |
'filter': { |
|
56 |
'mime': 'video/x-raw-yuv', |
|
57 |
'caps': { |
|
58 |
'width': 960, |
|
59 |
'height': 540, |
|
60 |
},
|
|
61 |
},
|
|
62 |
},
|
|
63 |
}
|
|
72.1.5
by Jason Gerard DeRose
Started work on revamp of how render jobs are dispatched |
64 |
doc = schema.create_settings(node) |
65 |
try: |
|
66 |
db.save(doc) |
|
67 |
except Conflict: |
|
68 |
pass
|
|
69 |
print('settings:', doc['_id']) |
|
70 |
||
71 |
doc = schema.create_job(root, doc['_id']) |
|
72 |
try: |
|
73 |
db.save(doc) |
|
74 |
except Conflict: |
|
75 |
pass
|
|
76 |
print('job:', doc['_id']) |
|
72.1.2
by Jason Gerard DeRose
Added new schema.save_to_intrinsic() function |
77 |
|
72.1.1
by Jason Gerard DeRose
Added another static demo for testing |
78 |