NickVerri commited on
Commit
9d7178b
·
verified ·
1 Parent(s): e5e9af6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -31
app.py CHANGED
@@ -135,12 +135,8 @@ def generate_xml(sequence_name, segments, source_name, fps=25):
135
  timebase = int(round(fps))
136
  is_ntsc = "TRUE" if fps % 1 != 0 else "FALSE"
137
 
138
- # --- NAME & PATH LOGIC ---
139
- # We DO NOT force an extension. If the user provided one (e.g. .mp4), keep it.
140
- # If they didn't (e.g. "Multicam1"), keep it raw.
141
- # This is critical for Premiere Multicam linking.
142
- encoded_name = quote(source_name)
143
- path_url = f"file://localhost/{encoded_name}"
144
 
145
  lines = []
146
  lines.append('<?xml version="1.0" encoding="UTF-8"?>')
@@ -189,10 +185,10 @@ def generate_xml(sequence_name, segments, source_name, fps=25):
189
  lines.append(f'\t\t\t\t\t<out>{src_out_frames}</out>')
190
  lines.append(f'\t\t\t\t\t<masterclipid>{master_id}</masterclipid>')
191
 
192
- # --- ROBUST FILE DEFINITION ---
193
  lines.append(f'\t\t\t\t\t<file id="{master_id}">')
194
  lines.append(f'\t\t\t\t\t\t<name>{source_name}</name>')
195
- lines.append(f'\t\t\t\t\t\t<pathurl>{path_url}</pathurl>')
196
  lines.append(f'\t\t\t\t\t\t<rate><timebase>{timebase}</timebase></rate>')
197
  lines.append(f'\t\t\t\t\t\t<duration>8640000</duration>')
198
  lines.append(f'\t\t\t\t\t\t<timecode>')
@@ -248,30 +244,10 @@ def generate_xml(sequence_name, segments, source_name, fps=25):
248
  lines.append(f'\t\t\t\t\t<out>{src_out_frames}</out>')
249
  lines.append(f'\t\t\t\t\t<masterclipid>{master_id}</masterclipid>')
250
 
251
- # Reuse same file definition (Verbose)
252
- lines.append(f'\t\t\t\t\t<file id="{master_id}">')
253
- lines.append(f'\t\t\t\t\t\t<name>{source_name}</name>')
254
- lines.append(f'\t\t\t\t\t\t<pathurl>{path_url}</pathurl>')
255
- lines.append(f'\t\t\t\t\t\t<rate><timebase>{timebase}</timebase></rate>')
256
- lines.append(f'\t\t\t\t\t\t<duration>8640000</duration>')
257
- lines.append(f'\t\t\t\t\t\t<timecode>')
258
- lines.append(f'\t\t\t\t\t\t\t<rate><timebase>{timebase}</timebase></rate>')
259
- lines.append(f'\t\t\t\t\t\t\t<string>00:00:00:00</string>')
260
- lines.append(f'\t\t\t\t\t\t\t<frame>0</frame>')
261
- lines.append(f'\t\t\t\t\t\t\t<displayformat>NDF</displayformat>')
262
- lines.append(f'\t\t\t\t\t\t</timecode>')
263
- lines.append(f'\t\t\t\t\t\t<media>')
264
- lines.append(f'\t\t\t\t\t\t\t<video>')
265
- lines.append(f'\t\t\t\t\t\t\t\t<samplecharacteristics><width>1920</width><height>1080</height></samplecharacteristics>')
266
- lines.append(f'\t\t\t\t\t\t\t</video>')
267
- lines.append(f'\t\t\t\t\t\t\t<audio>')
268
- lines.append(f'\t\t\t\t\t\t\t\t<samplecharacteristics><depth>16</depth><samplerate>48000</samplerate></samplecharacteristics>')
269
- lines.append(f'\t\t\t\t\t\t\t\t<channelcount>2</channelcount>')
270
- lines.append(f'\t\t\t\t\t\t\t</audio>')
271
- lines.append(f'\t\t\t\t\t\t</media>')
272
- lines.append(f'\t\t\t\t\t</file>')
273
 
274
- # SOURCE TRACK MAPPING (Simple Mono)
275
  lines.append('\t\t\t\t\t<sourcetrack>')
276
  lines.append('\t\t\t\t\t\t<mediatype>audio</mediatype>')
277
  lines.append('\t\t\t\t\t\t<trackindex>1</trackindex>')
 
135
  timebase = int(round(fps))
136
  is_ntsc = "TRUE" if fps % 1 != 0 else "FALSE"
137
 
138
+ # NOTE: We intentionally OMIT pathurl for Multicam workflows.
139
+ # This forces Premiere/Resolve to match by NAME in the project bin.
 
 
 
 
140
 
141
  lines = []
142
  lines.append('<?xml version="1.0" encoding="UTF-8"?>')
 
185
  lines.append(f'\t\t\t\t\t<out>{src_out_frames}</out>')
186
  lines.append(f'\t\t\t\t\t<masterclipid>{master_id}</masterclipid>')
187
 
188
+ # --- NAME-ONLY FILE DEFINITION ---
189
  lines.append(f'\t\t\t\t\t<file id="{master_id}">')
190
  lines.append(f'\t\t\t\t\t\t<name>{source_name}</name>')
191
+ # NO PATHURL - Forces bin search
192
  lines.append(f'\t\t\t\t\t\t<rate><timebase>{timebase}</timebase></rate>')
193
  lines.append(f'\t\t\t\t\t\t<duration>8640000</duration>')
194
  lines.append(f'\t\t\t\t\t\t<timecode>')
 
244
  lines.append(f'\t\t\t\t\t<out>{src_out_frames}</out>')
245
  lines.append(f'\t\t\t\t\t<masterclipid>{master_id}</masterclipid>')
246
 
247
+ # Reuse same file definition
248
+ lines.append(f'\t\t\t\t\t<file id="{master_id}"/>')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
 
250
+ # SOURCE TRACK MAPPING
251
  lines.append('\t\t\t\t\t<sourcetrack>')
252
  lines.append('\t\t\t\t\t\t<mediatype>audio</mediatype>')
253
  lines.append('\t\t\t\t\t\t<trackindex>1</trackindex>')