original -> source
This commit is contained in:
parent
34fa9e9262
commit
d2e45ccbc9
3 changed files with 25 additions and 25 deletions
28
render.py
28
render.py
|
|
@ -149,15 +149,15 @@ def compose(clips, target=150, base=1024, voice_over=None, options=None):
|
||||||
break
|
break
|
||||||
length += int(clip['duration'] * fps) / fps
|
length += int(clip['duration'] * fps) / fps
|
||||||
|
|
||||||
# 50/50 original or ai
|
# 50/50 source or ai
|
||||||
src = clip['original']
|
src = clip['source']
|
||||||
audio = clip['original']
|
audio = clip['source']
|
||||||
# select ai if we have one
|
# select ai if we have one
|
||||||
if 'ai' in clip:
|
if 'ai' in clip:
|
||||||
if True or chance(seq, 0.5):
|
if True or chance(seq, 0.5):
|
||||||
src = random_choice(seq, list(clip['ai'].values()), False)
|
src = random_choice(seq, list(clip['ai'].values()), False)
|
||||||
|
|
||||||
print('%07.3f %07.3f' % (length, clip['duration']), src.split('/')[-2], os.path.basename(clip['original']))
|
print('%07.3f %07.3f' % (length, clip['duration']), src.split('/')[-2], os.path.basename(clip['source']))
|
||||||
|
|
||||||
scene['front']['V2'].append({
|
scene['front']['V2'].append({
|
||||||
'duration': clip['duration'],
|
'duration': clip['duration'],
|
||||||
|
|
@ -298,7 +298,7 @@ def get_fragments(clips, voice_over, prefix):
|
||||||
fragment['anti-tags'].append(con['value'])
|
fragment['anti-tags'].append(con['value'])
|
||||||
|
|
||||||
fragment["id"] = int(fragment['name'].split(' ')[0])
|
fragment["id"] = int(fragment['name'].split(' ')[0])
|
||||||
originals = []
|
sources = []
|
||||||
for i in l.get_items(l.user):
|
for i in l.get_items(l.user):
|
||||||
orig = i.files.filter(selected=True).first()
|
orig = i.files.filter(selected=True).first()
|
||||||
if orig:
|
if orig:
|
||||||
|
|
@ -308,13 +308,13 @@ def get_fragments(clips, voice_over, prefix):
|
||||||
continue
|
continue
|
||||||
type_ = i.data['type'][0].lower()
|
type_ = i.data['type'][0].lower()
|
||||||
target = os.path.join(prefix, type_, i.data['title'] + ext)
|
target = os.path.join(prefix, type_, i.data['title'] + ext)
|
||||||
originals.append(target)
|
sources.append(target)
|
||||||
fragment['clips'] = []
|
fragment['clips'] = []
|
||||||
for clip in clips:
|
for clip in clips:
|
||||||
#if set(clip['tags']) & set(fragment['tags']) and not set(clip['tags']) & set(fragment['anti-tags']):
|
#if set(clip['tags']) & set(fragment['tags']) and not set(clip['tags']) & set(fragment['anti-tags']):
|
||||||
key = 'original'
|
key = 'source'
|
||||||
original = clip['original']
|
source = clip['source']
|
||||||
if original in originals:
|
if source in sources:
|
||||||
fragment['clips'].append(clip)
|
fragment['clips'].append(clip)
|
||||||
fragment["voice_over"] = voice_over.get(str(fragment["id"]), {})
|
fragment["voice_over"] = voice_over.get(str(fragment["id"]), {})
|
||||||
fragments.append(fragment)
|
fragments.append(fragment)
|
||||||
|
|
@ -777,8 +777,8 @@ def generate_clips(options):
|
||||||
prefix = options['prefix']
|
prefix = options['prefix']
|
||||||
lang, tlang = parse_lang(options["lang"])
|
lang, tlang = parse_lang(options["lang"])
|
||||||
clips = []
|
clips = []
|
||||||
for i in item.models.Item.objects.filter(sort__type='original'):
|
for i in item.models.Item.objects.filter(sort__type='source'):
|
||||||
original_target = ""
|
source_target = ""
|
||||||
qs = item.models.Item.objects.filter(data__title=i.data['title']).exclude(id=i.id)
|
qs = item.models.Item.objects.filter(data__title=i.data['title']).exclude(id=i.id)
|
||||||
#if qs.count() >= 1:
|
#if qs.count() >= 1:
|
||||||
if True:
|
if True:
|
||||||
|
|
@ -798,8 +798,8 @@ def generate_clips(options):
|
||||||
if os.path.islink(target):
|
if os.path.islink(target):
|
||||||
os.unlink(target)
|
os.unlink(target)
|
||||||
os.symlink(source, target)
|
os.symlink(source, target)
|
||||||
if type_ == "original":
|
if type_ == "source":
|
||||||
original_target = target
|
source_target = target
|
||||||
if type_.startswith('ai:'):
|
if type_.startswith('ai:'):
|
||||||
if 'ai' not in clip:
|
if 'ai' not in clip:
|
||||||
clip['ai'] = {}
|
clip['ai'] = {}
|
||||||
|
|
@ -815,7 +815,7 @@ def generate_clips(options):
|
||||||
clip["duration"] = cd
|
clip["duration"] = cd
|
||||||
clip['tags'] = i.data.get('tags', [])
|
clip['tags'] = i.data.get('tags', [])
|
||||||
clip['id'] = i.public_id
|
clip['id'] = i.public_id
|
||||||
name = os.path.basename(original_target)
|
name = os.path.basename(source_target)
|
||||||
seqid = re.sub(r"Hotel Aporia_(\d+)", "S\\1_", name)
|
seqid = re.sub(r"Hotel Aporia_(\d+)", "S\\1_", name)
|
||||||
seqid = re.sub(r"Night March_(\d+)", "S\\1_", seqid)
|
seqid = re.sub(r"Night March_(\d+)", "S\\1_", seqid)
|
||||||
seqid = re.sub(r"_(\d+)H_(\d+)", "_S\\1\\2_", seqid)
|
seqid = re.sub(r"_(\d+)H_(\d+)", "_S\\1\\2_", seqid)
|
||||||
|
|
|
||||||
|
|
@ -36,15 +36,15 @@ def render_poster(data, poster):
|
||||||
type = data.get('type')
|
type = data.get('type')
|
||||||
if type:
|
if type:
|
||||||
type = data.get('type')[0].lower()
|
type = data.get('type')[0].lower()
|
||||||
if type == "original":
|
if type == "source":
|
||||||
i = 0
|
i = 0
|
||||||
elif type == "background":
|
elif type and type.startswith('ai:'):
|
||||||
i = 200
|
i = 200
|
||||||
elif type == "foreground":
|
elif type == "landscape":
|
||||||
i = 400
|
i = 400
|
||||||
elif type == "foreground2":
|
elif type == "music":
|
||||||
i = 500
|
i = 500
|
||||||
elif type == "annimation":
|
elif type == "audio":
|
||||||
i = 600
|
i = 600
|
||||||
elif type == "voice over":
|
elif type == "voice over":
|
||||||
i = 300
|
i = 300
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
||||||
if (data.type?.join('').includes('ai:')) {
|
if (data.type?.join('').includes('ai:')) {
|
||||||
$('<div>').addClass('ai-preview').appendTo($text);
|
$('<div>').addClass('ai-preview').appendTo($text);
|
||||||
}
|
}
|
||||||
if (data.type?.includes('original')) {
|
if (data.type?.includes('source')) {
|
||||||
|
|
||||||
$('<a>').attr({
|
$('<a>').attr({
|
||||||
href: 'https://power-video.rmozone.com/#ox/' + data.id,
|
href: 'https://power-video.rmozone.com/#ox/' + data.id,
|
||||||
|
|
@ -659,7 +659,7 @@ pandora.ui.infoView = function(data, isMixed) {
|
||||||
};
|
};
|
||||||
$element.appendTo($text);
|
$element.appendTo($text);
|
||||||
pandora.api.find(request, function(response) {
|
pandora.api.find(request, function(response) {
|
||||||
let original;
|
let source;
|
||||||
response.data.items.forEach(item => {
|
response.data.items.forEach(item => {
|
||||||
if (item.id != data.id) {
|
if (item.id != data.id) {
|
||||||
var type = item.type ? item.type[0] : 'Unknown'
|
var type = item.type ? item.type[0] : 'Unknown'
|
||||||
|
|
@ -669,17 +669,17 @@ pandora.ui.infoView = function(data, isMixed) {
|
||||||
$element.append(
|
$element.append(
|
||||||
` <a href="/${item.id}/info">${type}</a>`
|
` <a href="/${item.id}/info">${type}</a>`
|
||||||
)
|
)
|
||||||
if (type == 'original') {
|
if (type == 'source') {
|
||||||
original = item.id
|
source = item.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
$element.append(`[<a href="/grid/title/title=${pandora.escapeQueryValue(title)}">all</a>]`)
|
$element.append(`[<a href="/grid/title/title=${pandora.escapeQueryValue(title)}">all</a>]`)
|
||||||
pandora.createLinks($element)
|
pandora.createLinks($element)
|
||||||
if (data.type?.join('').includes('ai:') && original) {
|
if (data.type?.join('').includes('ai:') && source) {
|
||||||
const preview = $text[0].querySelector('.ai-preview')
|
const preview = $text[0].querySelector('.ai-preview')
|
||||||
const src_ai = '480p.mp4'
|
const src_ai = '480p.mp4'
|
||||||
const src = `/${original}/480p.mp4`
|
const src = `/${source}/480p.mp4`
|
||||||
preview.innerHTML = `
|
preview.innerHTML = `
|
||||||
<video src="${src}" controls loop></video>
|
<video src="${src}" controls loop></video>
|
||||||
<video src="${src_ai}" loop></video>
|
<video src="${src_ai}" loop></video>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue