forked from RafaelGodoyEbert/ViralCutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeedback.html
More file actions
1072 lines (1045 loc) · 45.5 KB
/
Copy pathfeedback.html
File metadata and controls
1072 lines (1045 loc) · 45.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>ViralCutter — Production Stage Feedback Report</title>
<style>
:root {
--bg: #0b0b0f;
--surface: #131318;
--surface2: #1b1b24;
--border: #2a2a38;
--accent: #ff6b00;
--accent2: #ff9a44;
--green: #22c55e;
--yellow: #facc15;
--red: #ef4444;
--blue: #3b82f6;
--purple: #a855f7;
--text: #e8e8f0;
--muted: #8888a0;
--radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font-family: 'Segoe UI', system-ui, sans-serif;
font-size: 15px;
line-height: 1.7;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ── HEADER ── */
header {
background: linear-gradient(135deg, #0f0f1a 0%, #1a0a00 100%);
border-bottom: 1px solid var(--border);
padding: 48px 40px 36px;
text-align: center;
}
header .badge {
display: inline-block;
background: var(--accent);
color: #fff;
font-size: 11px;
font-weight: 700;
letter-spacing: 1.5px;
text-transform: uppercase;
padding: 4px 14px;
border-radius: 20px;
margin-bottom: 18px;
}
header h1 {
font-size: 2.6rem;
font-weight: 800;
background: linear-gradient(90deg, #ff6b00, #ff9a44, #ffcc88);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 10px;
}
header p.subtitle {
color: var(--muted);
font-size: 1rem;
max-width: 640px;
margin: 0 auto;
}
header .meta {
margin-top: 22px;
display: flex;
gap: 24px;
justify-content: center;
flex-wrap: wrap;
}
header .meta span {
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 8px;
padding: 6px 16px;
font-size: 13px;
color: var(--muted);
}
header .meta span b { color: var(--text); }
/* ── LAYOUT ── */
.container { max-width: 1100px; margin: 0 auto; padding: 48px 32px; }
.section-title {
display: flex;
align-items: center;
gap: 12px;
font-size: 1.3rem;
font-weight: 700;
color: var(--text);
margin-bottom: 24px;
padding-bottom: 12px;
border-bottom: 1px solid var(--border);
}
.section-title .icon {
width: 36px; height: 36px;
border-radius: 10px;
display: flex; align-items: center; justify-content: center;
font-size: 1.1rem;
flex-shrink: 0;
}
/* ── SCORE CARD ── */
.score-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 16px;
margin-bottom: 48px;
}
.score-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px 18px;
text-align: center;
}
.score-card .label {
font-size: 12px;
color: var(--muted);
text-transform: uppercase;
letter-spacing: 0.8px;
margin-bottom: 10px;
}
.score-card .value {
font-size: 2.2rem;
font-weight: 800;
line-height: 1;
}
.score-card .sub {
font-size: 11px;
color: var(--muted);
margin-top: 6px;
}
.c-green { color: var(--green); }
.c-yellow { color: var(--yellow); }
.c-red { color: var(--red); }
.c-blue { color: var(--blue); }
.c-orange { color: var(--accent); }
.c-purple { color: var(--purple); }
/* ── PIPELINE ── */
.pipeline {
display: flex;
gap: 0;
overflow-x: auto;
padding-bottom: 8px;
margin-bottom: 48px;
}
.pipe-step {
flex: 1;
min-width: 140px;
background: var(--surface);
border: 1px solid var(--border);
padding: 18px 14px;
text-align: center;
position: relative;
}
.pipe-step:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.pipe-step:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.pipe-step:not(:last-child)::after {
content: '▶';
position: absolute;
right: -12px;
top: 50%;
transform: translateY(-50%);
color: var(--accent);
font-size: 14px;
z-index: 2;
}
.pipe-step .icon { font-size: 1.6rem; margin-bottom: 8px; }
.pipe-step .name { font-size: 13px; font-weight: 600; }
.pipe-step .file { font-size: 10px; color: var(--muted); margin-top: 4px; font-family: monospace; }
.pipe-step.ok { border-top: 3px solid var(--green); }
.pipe-step.warn { border-top: 3px solid var(--yellow); }
.pipe-step.info { border-top: 3px solid var(--blue); }
/* ── CARDS ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-bottom: 48px; }
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 22px 24px;
}
.card h3 {
font-size: 1rem;
font-weight: 700;
margin-bottom: 14px;
display: flex;
align-items: center;
gap: 8px;
}
.card ul { list-style: none; }
.card ul li {
padding: 5px 0;
font-size: 14px;
color: var(--muted);
display: flex;
gap: 8px;
align-items: flex-start;
border-bottom: 1px solid var(--border);
}
.card ul li:last-child { border-bottom: none; }
.card ul li .dot {
width: 7px; height: 7px;
border-radius: 50%;
margin-top: 7px;
flex-shrink: 0;
}
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }
.dot-blue { background: var(--blue); }
.dot-purple { background: var(--purple); }
/* ── SEVERITY TABLE ── */
.issue-table { width: 100%; border-collapse: collapse; margin-bottom: 48px; }
.issue-table th {
background: var(--surface2);
text-align: left;
padding: 12px 16px;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 0.8px;
color: var(--muted);
border: 1px solid var(--border);
}
.issue-table td {
padding: 12px 16px;
border: 1px solid var(--border);
font-size: 13.5px;
vertical-align: top;
}
.issue-table tr:hover td { background: var(--surface2); }
.badge-sev {
font-size: 10px;
font-weight: 700;
padding: 2px 10px;
border-radius: 20px;
white-space: nowrap;
}
.sev-critical { background: #7f1d1d; color: #fca5a5; }
.sev-high { background: #7c2d12; color: #fdba74; }
.sev-medium { background: #713f12; color: #fde68a; }
.sev-low { background: #1e3a5f; color: #93c5fd; }
.sev-info { background: #1e293b; color: #94a3b8; }
.badge-cat {
font-size: 10px;
font-weight: 600;
padding: 2px 10px;
border-radius: 20px;
white-space: nowrap;
}
.cat-security { background: #450a0a; color: #fca5a5; }
.cat-perf { background: #052e16; color: #86efac; }
.cat-ux { background: #1e1b4b; color: #c4b5fd; }
.cat-feature { background: #0c4a6e; color: #7dd3fc; }
.cat-debt { background: #292524; color: #d6d3d1; }
.cat-quality { background: #1c1917; color: #a8a29e; }
code {
background: var(--surface2);
border: 1px solid var(--border);
padding: 1px 6px;
border-radius: 4px;
font-family: 'Consolas', monospace;
font-size: 12px;
color: var(--accent2);
}
/* ── ROADMAP ── */
.roadmap { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 48px; }
@media (max-width: 768px) { .roadmap { grid-template-columns: 1fr; } }
.roadmap-col {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px;
}
.roadmap-col h3 {
font-size: 13px;
text-transform: uppercase;
letter-spacing: 1px;
margin-bottom: 16px;
padding-bottom: 10px;
border-bottom: 1px solid var(--border);
}
.roadmap-col .item {
background: var(--surface2);
border-radius: 8px;
padding: 10px 12px;
margin-bottom: 8px;
font-size: 13px;
}
.roadmap-col .item .tag {
font-size: 10px;
color: var(--muted);
margin-top: 4px;
}
/* ── FEATURE MATRIX ── */
.feat-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 14px;
margin-bottom: 48px;
}
.feat-item {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
padding: 14px 16px;
display: flex;
gap: 12px;
align-items: flex-start;
}
.feat-item .status {
width: 22px; height: 22px;
border-radius: 50%;
display: flex; align-items: center; justify-content: center;
font-size: 11px;
font-weight: 700;
flex-shrink: 0;
margin-top: 1px;
}
.status-done { background: #14532d; color: #86efac; }
.status-partial { background: #713f12; color: #fde68a; }
.status-missing { background: #3b0764; color: #e9d5ff; }
.feat-item .content .name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.feat-item .content .note { font-size: 12px; color: var(--muted); }
/* ── SEPARATOR ── */
.section-sep { margin: 40px 0; border: none; border-top: 1px solid var(--border); }
/* ── FOOTER ── */
footer {
background: var(--surface);
border-top: 1px solid var(--border);
text-align: center;
padding: 28px;
font-size: 13px;
color: var(--muted);
}
footer b { color: var(--text); }
</style>
</head>
<body>
<!-- ════════════════════════════════════════════════════════════════ -->
<!-- HEADER -->
<!-- ════════════════════════════════════════════════════════════════ -->
<header>
<div class="badge">Production Stage Review</div>
<h1>ViralCutter — Deep Analysis</h1>
<p class="subtitle">Comprehensive technical assessment of architecture, code quality, performance, security and improvement roadmap.</p>
<div class="meta">
<span>📅 Review Date: <b>March 10, 2026</b></span>
<span>📁 Files Analyzed: <b>18 scripts</b></span>
<span>🔢 Pipeline Steps: <b>8 stages</b></span>
<span>🤖 AI Backends: <b>4 supported</b></span>
<span>🌐 Languages: <b>PT-BR / EN / TR</b></span>
</div>
</header>
<!-- ════════════════════════════════════════════════════════════════ -->
<!-- CONTAINER -->
<!-- ════════════════════════════════════════════════════════════════ -->
<div class="container">
<!-- ── OVERALL SCORES ── -->
<div class="section-title">
<div class="icon" style="background:#1a1a2e">📊</div>
Overall Production Health
</div>
<div class="score-grid">
<div class="score-card">
<div class="label">Maturity</div>
<div class="value c-green">B+</div>
<div class="sub">Solid functional app</div>
</div>
<div class="score-card">
<div class="label">Feature Completeness</div>
<div class="value c-green">82%</div>
<div class="sub">Core pipeline solid</div>
</div>
<div class="score-card">
<div class="label">Code Quality</div>
<div class="value c-yellow">C+</div>
<div class="sub">Debug leftovers + globals</div>
</div>
<div class="score-card">
<div class="label">Security</div>
<div class="value c-yellow">C</div>
<div class="sub">API keys in CLI args</div>
</div>
<div class="score-card">
<div class="label">Performance</div>
<div class="value c-yellow">B−</div>
<div class="sub">Sequential only</div>
</div>
<div class="score-card">
<div class="label">UX / DX</div>
<div class="value c-green">B</div>
<div class="sub">Good Gradio WebUI</div>
</div>
<div class="score-card">
<div class="label">i18n Support</div>
<div class="value c-blue">A−</div>
<div class="sub">3 locales, well integrated</div>
</div>
<div class="score-card">
<div class="label">Issues Found</div>
<div class="value c-red">27</div>
<div class="sub">4 security · 9 debt · 14 features</div>
</div>
</div>
<!-- ── PIPELINE ARCHITECTURE ── -->
<div class="section-title">
<div class="icon" style="background:#0c2a1e">⚙️</div>
Full Processing Pipeline Architecture
</div>
<div class="pipeline">
<div class="pipe-step ok">
<div class="icon">⬇️</div>
<div class="name">Download</div>
<div class="file">download_video.py</div>
</div>
<div class="pipe-step ok">
<div class="icon">🎙️</div>
<div class="name">Transcribe</div>
<div class="file">transcribe_video.py</div>
</div>
<div class="pipe-step ok">
<div class="icon">🤖</div>
<div class="name">AI Segment</div>
<div class="file">create_viral_segments.py</div>
</div>
<div class="pipe-step ok">
<div class="icon">✂️</div>
<div class="name">Cut Clips</div>
<div class="file">cut_segments.py</div>
</div>
<div class="pipe-step ok">
<div class="icon">👤</div>
<div class="name">Face Crop</div>
<div class="file">edit_video.py</div>
</div>
<div class="pipe-step warn">
<div class="icon">📝</div>
<div class="name">Subtitles</div>
<div class="file">adjust_subtitles.py</div>
</div>
<div class="pipe-step warn">
<div class="icon">🔥</div>
<div class="name">Burn Subs</div>
<div class="file">burn_subtitles.py</div>
</div>
<div class="pipe-step info">
<div class="icon">📦</div>
<div class="name">Export XML</div>
<div class="file">export_xml_lib/</div>
</div>
</div>
<!-- ── STRENGTHS ── -->
<div class="section-title">
<div class="icon" style="background:#052e16">✅</div>
What's Working Well — Strengths
</div>
<div class="cards">
<div class="card">
<h3>🤖 <span class="c-green">Multi-AI Backend</span></h3>
<ul>
<li><span class="dot dot-green"></span>Gemini (best quality, rate-limit retry with exponential backoff)</li>
<li><span class="dot dot-green"></span>G4F (free, 13+ models including DeepSeek, Claude, Llama)</li>
<li><span class="dot dot-green"></span>Local GGUF via llama.cpp — true offline usage</li>
<li><span class="dot dot-green"></span>Manual copy/paste fallback for any LLM</li>
</ul>
</div>
<div class="card">
<h3>👤 <span class="c-green">Smart Face Detection</span></h3>
<ul>
<li><span class="dot dot-green"></span>Dual engine: InsightFace (primary) + MediaPipe (fallback)</li>
<li><span class="dot dot-green"></span>1-face and 2-face split-screen modes with auto-detect</li>
<li><span class="dot dot-green"></span>Face identity lock prevents position swap in 2-face mode</li>
<li><span class="dot dot-green"></span>Experimental active speaker detection (MAR + motion scoring)</li>
<li><span class="dot dot-green"></span>Dead zone stabilization to prevent camera jitter</li>
</ul>
</div>
<div class="card">
<h3>📝 <span class="c-green">Subtitle System</span></h3>
<ul>
<li><span class="dot dot-green"></span>Rich preset system: Hormozi, MrBeast, Word Killer, TikTok, etc.</li>
<li><span class="dot dot-green"></span>Live static HTML preview + slow animated video preview</li>
<li><span class="dot dot-green"></span>Word-by-word highlight mode with dynamic resizing</li>
<li><span class="dot dot-green"></span>Timeline-aware positioning for 2-face split layout</li>
<li><span class="dot dot-green"></span>Async translation to 11 languages via deep-translator</li>
</ul>
</div>
<div class="card">
<h3>⚡ <span class="c-green">GPU-Aware Encoding</span></h3>
<ul>
<li><span class="dot dot-green"></span>Auto-detects NVIDIA NVENC, AMD AMF, Intel QSV, Apple VideoToolbox</li>
<li><span class="dot dot-green"></span>Graceful CPU fallback (libx264 ultrafast)</li>
<li><span class="dot dot-green"></span>Encoder result cached to avoid re-detection overhead</li>
<li><span class="dot dot-yellow"></span>burn_subtitles.py only tries NVENC → CPU (misses AMD/Intel)</li>
</ul>
</div>
<div class="card">
<h3>🔄 <span class="c-green">Smart Caching & Resumability</span></h3>
<ul>
<li><span class="dot dot-green"></span>Skips re-download if input.mp4 already exists</li>
<li><span class="dot dot-green"></span>Skips re-transcription if SRT/TSV/JSON already present</li>
<li><span class="dot dot-green"></span>Prompts to reuse existing viral_segments.txt</li>
<li><span class="dot dot-green"></span>Prompts to skip cutting if cuts/ folder is populated</li>
</ul>
</div>
<div class="card">
<h3>🌐 <span class="c-green">WebUI — Gradio</span></h3>
<ul>
<li><span class="dot dot-green"></span>Three workflows: Full, Cut Only, Subtitles Only</li>
<li><span class="dot dot-green"></span>YouTube URL + Upload Video + Existing Project sources</li>
<li><span class="dot dot-green"></span>Subtitle editor with Dataframe + per-segment re-render</li>
<li><span class="dot dot-green"></span>Library tab with HTML video gallery (FastAPI static mount)</li>
<li><span class="dot dot-green"></span>Process kill button + sticky auto-scroll log output</li>
</ul>
</div>
<div class="card">
<h3>📦 <span class="c-green">Export & Integration</span></h3>
<ul>
<li><span class="dot dot-green"></span>Premiere Pro XML export via export_xml_lib/</li>
<li><span class="dot dot-green"></span>ZIP pack with video + ASS + JSON + face coords</li>
<li><span class="dot dot-green"></span>FastAPI backend for static file serving</li>
<li><span class="dot dot-green"></span>Modular CLI with 30+ argparse parameters</li>
</ul>
</div>
<div class="card">
<h3>🛠️ <span class="c-green">Robustness Features</span></h3>
<ul>
<li><span class="dot dot-green"></span>Raw segment repair — fixes AI output with missing timestamps</li>
<li><span class="dot dot-green"></span>JSON recovery from truncated LLM responses (token limit)</li>
<li><span class="dot dot-green"></span>DeepSeek <think> tag stripping from AI responses</li>
<li><span class="dot dot-green"></span>Windows CP1252 emoji/encoding safe filename sanitization</li>
<li><span class="dot dot-green"></span>yt-dlp with cookie fallback support</li>
</ul>
</div>
</div>
<!-- ── ISSUES TABLE ── -->
<div class="section-title">
<div class="icon" style="background:#2a0a0a">🐛</div>
Issues & Improvement Opportunities — Full Catalog
</div>
<table class="issue-table">
<thead>
<tr>
<th>#</th>
<th>Category</th>
<th>Severity</th>
<th>File / Location</th>
<th>Description & Recommendation</th>
</tr>
</thead>
<tbody>
<!-- SECURITY -->
<tr>
<td>1</td>
<td><span class="badge-cat cat-security">Security</span></td>
<td><span class="badge-sev sev-high">HIGH</span></td>
<td><code>webui/app.py</code></td>
<td><b>API key passed as CLI argument.</b> <code>--api-key <KEY></code> is visible in <code>ps aux</code> / Task Manager to any user on the machine. <b>Fix:</b> Pass via environment variable (<code>env["GEMINI_API_KEY"] = api_key</code>) and read it in main_improved.py using <code>os.environ</code>.</td>
</tr>
<tr>
<td>2</td>
<td><span class="badge-cat cat-security">Security</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>webui/app.py → convert_color_to_ass()</code></td>
<td><b>Persistent debug log file in production.</b> Every color conversion writes to <code>debug_colors.log</code> which grows indefinitely and may leak user color data to disk. <b>Fix:</b> Remove the <code>with open("debug_colors.log")</code> blocks entirely — the function is stable and doesn't need them.</td>
</tr>
<tr>
<td>3</td>
<td><span class="badge-cat cat-security">Security</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>api_config.json</code></td>
<td><b>API keys stored in plain text JSON.</b> File checked into the workspace root. <b>Fix:</b> Use a <code>.env</code> file (listed in <code>.gitignore</code>) and the <code>python-dotenv</code> library for key storage.</td>
</tr>
<tr>
<td>4</td>
<td><span class="badge-cat cat-security">Security</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>scripts/transcribe_video.py</code></td>
<td><b>Aggressive <code>torch.load</code> monkeypatch.</b> Forces <code>weights_only=False</code> globally, bypassing PyTorch's security model safeguard against malicious pickle payloads in model files. <b>Fix:</b> Do this only for the specific affected loading calls, not globally.</td>
</tr>
<!-- TECHNICAL DEBT -->
<tr>
<td>5</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>webui/app.py → run_viral_cutter()</code></td>
<td><b><code>--skip-prompts</code> flag appended twice</b> to the command list (lines ~253 and ~290). Harmless now but a quality signal. <b>Fix:</b> Remove the duplicate append.</td>
</tr>
<tr>
<td>6</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>main_improved.py</code></td>
<td><b>Dead code: <code>organize_output.organize()</code></b> is commented out but the module is still imported. <b>Fix:</b> Either remove the import and comment, or re-enable the call.</td>
</tr>
<tr>
<td>7</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>main_improved.py</code></td>
<td><b>Scattered <code>print(f"DEBUG: ...")</code> statements</b> in production code paths (e.g. <code>DEBUG: Checking input_video state</code>, <code>DEBUG: Download finished</code>). <b>Fix:</b> Use Python's <code>logging</code> module with configurable levels (<code>--verbose</code> flag for debug output).</td>
</tr>
<tr>
<td>8</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>webui/app.py</code></td>
<td><b>Global mutable <code>current_process</code></b> with no thread safety. If two browser tabs submitted jobs simultaneously, there would be a race condition on process management. <b>Fix:</b> Use <code>threading.Lock</code> or scope to a session-level object.</td>
</tr>
<tr>
<td>9</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>scripts/burn_subtitles.py</code></td>
<td><b>Burns only try NVENC → CPU libx264.</b> The encoder detection in <code>edit_video.py</code> correctly handles AMD, Intel and Apple, but <code>burn_subtitles.py</code> skips them. <b>Fix:</b> Call the same <code>get_best_encoder()</code> function from <code>edit_video.py</code> instead of duplicating logic.</td>
</tr>
<tr>
<td>10</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>webui/app.py</code></td>
<td><b><code>temp_subtitle_config.json</code> not cleaned up</b> after processing. File accumulates in the workspace root. <b>Fix:</b> Delete the temp file in a <code>finally</code> block after the subprocess finishes.</td>
</tr>
<tr>
<td>11</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>scripts/adjust_subtitles.py</code></td>
<td><b>Subtitle mode fallback silently uses "no_highlight"</b> for unrecognized mode strings (e.g. <code>"word_by_word"</code> mapped to <code>"palavra_por_palavra"</code> older alias, but not vice versa). Could silently produce wrong style. <b>Fix:</b> Normalize mode strings at ingestion time and log a warning for unknown values.</td>
</tr>
<tr>
<td>12</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>main_improved.py</code></td>
<td><b>Mixed language in code comments</b> (Portuguese and English). Affects readability for international contributors. Comments should be standardized to English.</td>
</tr>
<tr>
<td>13</td>
<td><span class="badge-cat cat-debt">Tech Debt</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>scripts/cut_segments.py</code></td>
<td><b>NVENC check is duplicated</b> inside <code>generate_segments()</code> instead of using the shared <code>get_best_encoder()</code> from <code>edit_video.py</code>. Creates maintenance burden.</td>
</tr>
<!-- PERFORMANCE -->
<tr>
<td>14</td>
<td><span class="badge-cat cat-perf">Performance</span></td>
<td><span class="badge-sev sev-high">HIGH</span></td>
<td><code>main_improved.py</code></td>
<td><b>Clips processed sequentially, not in parallel.</b> For 10 clips, face crop and subtitle burn run one-by-one. <b>Fix:</b> Use <code>concurrent.futures.ProcessPoolExecutor</code> to process multiple clips simultaneously (limited to CPU core count).</td>
</tr>
<tr>
<td>15</td>
<td><span class="badge-cat cat-perf">Performance</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>scripts/transcribe_video.py</code></td>
<td><b>WhisperX model is not persisted between runs.</b> Each processing job reloads the model from disk. For "Subtitles Only" re-runs, this is expensive. <b>Fix:</b> Cache the loaded model in a module-level variable and reuse it within the same process lifecycle.</td>
</tr>
<tr>
<td>16</td>
<td><span class="badge-cat cat-perf">Performance</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>webui/library.py → generate_project_gallery()</code></td>
<td><b>No caching of gallery HTML.</b> The gallery re-scans the filesystem and re-parses JSON on every tab switch or refresh click. <b>Fix:</b> Add a simple mtime-based cache invalidation so the gallery is only rebuilt when files change.</td>
</tr>
<!-- UX -->
<tr>
<td>17</td>
<td><span class="badge-cat cat-ux">UX</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>webui/app.py</code></td>
<td><b>No progress bar or ETA in the WebUI.</b> Users see raw log text with no visual progress. <b>Fix:</b> Parse log lines for key milestones (Download %, Transcription %, Clip N/M) and feed a <code>gr.Progress</code> component or a dynamic HTML progress bar.</td>
</tr>
<tr>
<td>18</td>
<td><span class="badge-cat cat-ux">UX</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>webui/app.py</code></td>
<td><b>No confirmation on Stop button.</b> A mis-click kills the running process permanently. <b>Fix:</b> Add a JS confirmation dialog or a two-step "Stop?" / "Confirm Stop" toggle.</td>
</tr>
<tr>
<td>19</td>
<td><span class="badge-cat cat-ux">UX</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>webui/app.py</code></td>
<td><b>Segments field default is 3 with no max hint.</b> New users don't know they can request 10, 20 or more. <b>Fix:</b> Add an <code>info</code> tooltip or placeholder text suggesting a typical range.</td>
</tr>
<tr>
<td>20</td>
<td><span class="badge-cat cat-ux">UX</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>webui/library.py</code></td>
<td><b>Library tab doesn't display project metadata</b> (total filesize, clip durations, creation timestamp, AI model used). <b>Fix:</b> Read the saved <code>processing_config.json</code> per project and render a summary card.</td>
</tr>
<!-- FEATURE GAPS -->
<tr>
<td>21</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td>All</td>
<td><b>No batch/queue processing.</b> Only one video can be processed at a time via the WebUI. <b>Fix:</b> Add a simple job queue (list of URLs/files) that processes sequentially, with status tracking per job.</td>
</tr>
<tr>
<td>22</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>scripts/download_video.py</code></td>
<td><b>Only YouTube is the tested download source.</b> yt-dlp supports 1000+ sites (TikTok, Instagram, X/Twitter, etc.) but the UI only labels it "YouTube URL". <b>Fix:</b> Rename the field to "Video URL" and test/document other sources.</td>
</tr>
<tr>
<td>23</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-medium">MEDIUM</span></td>
<td><code>main_improved.py</code></td>
<td><b>No desktop notification when processing completes.</b> Long jobs (30–60 min) require the user to actively check. <b>Fix:</b> Use Python's <code>plyer</code> library or a simple system tray notification when the subprocess exits.</td>
</tr>
<tr>
<td>24</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>scripts/edit_video.py</code></td>
<td><b>Only 9:16 vertical output.</b> No option for 1:1 (Instagram square) or 4:5 (portrait feed). <b>Fix:</b> Add an <code>--output-ratio</code> CLI argument and corresponding UI dropdown with presets.</td>
</tr>
<tr>
<td>25</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>webui/subtitle_editor.py</code></td>
<td><b>No undo/redo in the subtitle editor.</b> A wrong save overwrites the JSON permanently. <b>Fix:</b> Keep a backup copy on first load (<code>*.json.bak</code>) and add a "Restore Backup" button.</td>
</tr>
<tr>
<td>26</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>scripts/translate_json.py</code></td>
<td><b>Translation uses only Google Translate (free tier) with no fallback.</b> Rate limits can cause silent failures. <b>Fix:</b> Add a retry/backoff wrapper and expose an optional DeepL API key as alternative.</td>
</tr>
<tr>
<td>27</td>
<td><span class="badge-cat cat-feature">Feature</span></td>
<td><span class="badge-sev sev-low">LOW</span></td>
<td><code>webui/app.py</code></td>
<td><b>No watermark/branding overlay option.</b> Content creators often need a channel watermark. <b>Fix:</b> Add an optional watermark image input and an FFmpeg <code>overlay</code> filter step in the burn pipeline.</td>
</tr>
</tbody>
</table>
<!-- ── FEATURE MATRIX ── -->
<div class="section-title">
<div class="icon" style="background:#0a1628">🗂️</div>
Feature Completeness Matrix
</div>
<div class="feat-grid">
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">AI Viral Selection</div>
<div class="note">Gemini, G4F, Local GGUF, Manual</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">WhisperX Transcription</div>
<div class="note">Word-level timestamps + YT subtitle bypass</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Face Detection & Crop</div>
<div class="note">InsightFace + MediaPipe, 1-face & 2-face</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Dynamic Subtitles (ASS)</div>
<div class="note">Highlight, word-by-word, no-highlight modes</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">GPU Hardware Encoding</div>
<div class="note">NVENC / AMF / QSV / VideoToolbox / CPU</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Subtitle Translation</div>
<div class="note">11 languages via deep-translator (async)</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Subtitle Editor</div>
<div class="note">Dataframe UI with per-segment re-render</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Premiere Pro XML Export</div>
<div class="note">ZIP pack with video + ASS + face coords</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Project Library & Gallery</div>
<div class="note">Video cards with inline preview + download</div>
</div>
</div>
<div class="feat-item">
<div class="status status-done">✓</div>
<div class="content">
<div class="name">Active Speaker Detection</div>
<div class="note">MAR + motion, experimental presets</div>
</div>
</div>
<div class="feat-item">
<div class="status status-partial">~</div>
<div class="content">
<div class="name">Progress Feedback</div>
<div class="note">Raw logs only — no visual progress bar</div>
</div>
</div>
<div class="feat-item">
<div class="status status-partial">~</div>
<div class="content">
<div class="name">Subtitle Backup / Undo</div>
<div class="note">No undo — edits overwrite immediately</div>
</div>
</div>
<div class="feat-item">
<div class="status status-partial">~</div>
<div class="content">
<div class="name">Burn Subtitle Encoder</div>
<div class="note">Only NVENC→CPU (misses AMD/Intel)</div>
</div>
</div>
<div class="feat-item">
<div class="status status-partial">~</div>
<div class="content">
<div class="name">Multi-platform Download</div>
<div class="note">yt-dlp supports many sites, but UI labels only YouTube</div>
</div>
</div>
<div class="feat-item">
<div class="status status-missing">✗</div>
<div class="content">
<div class="name">Batch / Queue Processing</div>
<div class="note">One video at a time only</div>
</div>
</div>
<div class="feat-item">
<div class="status status-missing">✗</div>
<div class="content">
<div class="name">Parallel Clip Rendering</div>
<div class="note">Sequential only — no multiprocessing</div>
</div>
</div>
<div class="feat-item">
<div class="status status-missing">✗</div>
<div class="content">
<div class="name">Aspect Ratio Options</div>
<div class="note">Only 9:16 vertical; no 1:1, 4:5</div>
</div>
</div>
<div class="feat-item">
<div class="status status-missing">✗</div>
<div class="content">
<div class="name">Watermark / Logo Overlay</div>
<div class="note">No branding option</div>
</div>
</div>
<div class="feat-item">
<div class="status status-missing">✗</div>
<div class="content">
<div class="name">Completion Notifications</div>
<div class="note">No push/desktop notification</div>
</div>
</div>
<div class="feat-item">
<div class="status status-missing">✗</div>
<div class="content">
<div class="name">Social Media Direct Upload</div>
<div class="note">Manual upload still required</div>
</div>
</div>
</div>
<!-- ── ROADMAP ── -->
<div class="section-title">
<div class="icon" style="background:#1e1040">🗺️</div>
Suggested Development Roadmap
</div>
<div class="roadmap">
<div class="roadmap-col">
<h3 style="color: var(--red);">🔴 Quick Wins — Do First</h3>
<div class="roadmap-item">
<div class="item">
Remove <code>debug_colors.log</code> writes
<div class="tag">Security · 5 min fix</div>
</div>
<div class="item">
Fix duplicate <code>--skip-prompts</code> in cmd
<div class="tag">Tech Debt · 2 min fix</div>
</div>
<div class="item">
Replace API key CLI arg with env var
<div class="tag">Security · 30 min</div>
</div>
<div class="item">
Add progress milestones to WebUI log
<div class="tag">UX · 1–2 hrs</div>
</div>
<div class="item">
Unify encoder detection in burn_subtitles.py
<div class="tag">Tech Debt · 30 min</div>
</div>
<div class="item">
Add Segments field info tooltip
<div class="tag">UX · 10 min</div>
</div>
</div>
</div>
<div class="roadmap-col">
<h3 style="color: var(--yellow);">🟡 Medium Term — Next Sprint</h3>
<div class="roadmap-item">
<div class="item">
Parallel clip rendering (ProcessPoolExecutor)
<div class="tag">Performance · 4–8 hrs</div>
</div>
<div class="item">
Replace print(DEBUG) with logging module
<div class="tag">Tech Debt · 2–4 hrs</div>
</div>
<div class="item">
Subtitle editor undo (*.json.bak + restore btn)
<div class="tag">UX · 2 hrs</div>
</div>
<div class="item">
Stop button confirmation dialog (JS)
<div class="tag">UX · 1 hr</div>
</div>
<div class="item">
Project metadata in Library tab
<div class="tag">UX · 2–3 hrs</div>
</div>
<div class="item">
Rename "YouTube URL" → "Video URL" + doc
<div class="tag">Feature · 30 min</div>
</div>
</div>
</div>
<div class="roadmap-col">
<h3 style="color: var(--green);">🟢 Long Term — Future Versions</h3>
<div class="roadmap-item">
<div class="item">
Job queue / batch processing
<div class="tag">Feature · 1–2 days</div>
</div>
<div class="item">
Aspect ratio presets (9:16 / 1:1 / 4:5)
<div class="tag">Feature · 4–6 hrs</div>
</div>
<div class="item">
Watermark / logo overlay option
<div class="tag">Feature · 3 hrs</div>
</div>
<div class="item">
Desktop completion notification (plyer)
<div class="tag">Feature · 1 hr</div>
</div>