Commit graph

501 commits

Author SHA1 Message Date
6aa3b0ec82 chore(docker): keep runtime caches out of the bind-mounted repo
All checks were successful
CI / unit (pull_request) Successful in 45s
CI / backend-e2e (pull_request) Successful in 1m21s
CI / dashboard-e2e (pull_request) Successful in 2m23s
HOME=/tmp + MPLCONFIGDIR/HF_HOME/YOLO_CONFIG_DIR stop matplotlib, fontconfig and ASR caches writing into the host bind mount (unwritable by the non-root appuser). A persistent huggingface-cache named volume holds the model downloads; .fontconfig/ is now gitignored.
2026-10-05 19:23:27 +01:00
38045a3c50 feat(dashboard): native schedule date picker
All checks were successful
CI / unit (pull_request) Successful in 46s
CI / backend-e2e (pull_request) Successful in 1m21s
CI / dashboard-e2e (pull_request) Successful in 2m25s
Replace the dd/mm/yyyy free-text field with a native date input (min=today, dark chrome) and parse YYYY-MM-DD; time input, payload and publish logic unchanged.
2026-10-05 18:23:21 +01:00
7c260b3fa1 fix(dashboard): stop discarding the saved Postiz base URL every load
The retired maintainer default is now blanked once (marker-guarded) instead of on every read, so a self-hoster whose own Postiz instance lives on that host no longer has to retype the URL each session.
2026-10-05 18:23:21 +01:00
a3c877e032 feat(dashboard): attach a cadence handoff bundle to clip jobs
All checks were successful
CI / backend-e2e (pull_request) Successful in 1m21s
CI / unit (pull_request) Successful in 47s
CI / dashboard-e2e (pull_request) Successful in 2m28s
Optional .zip picker in the local-file flow; uploads via POST/PUT /api/uploads (kind=handoff) and passes handoff_id to /api/process so clipwright skips re-transcription.
2026-10-05 17:30:42 +01:00
79341f0a38 feat(pipeline): integrate profiles, layout, handoff, and provenance
All checks were successful
CI / unit (pull_request) Successful in 45s
CI / backend-e2e (pull_request) Successful in 1m20s
CI / dashboard-e2e (pull_request) Successful in 2m28s
2026-10-05 17:01:08 +01:00
446bbbe061 feat(bridge): shorts-to-long-form bridge + dashboard UI 2026-10-05 17:01:08 +01:00
2d77269337 feat(packaging): title validator + thumbnail concept roles + mobile safe areas 2026-10-05 17:01:08 +01:00
ba1d337f3a feat(layout): code/terminal vertical layout + screencast dead-wire fix 2026-10-05 17:01:08 +01:00
655cff2f64 feat(clips): word-aligned punch-ins + hook-first boundaries 2026-10-05 17:01:08 +01:00
ea251a1128 feat(profiles): channel profiles + shared prompt mapping 2026-10-05 17:01:08 +01:00
a00fe8544d feat: download a clip as a title-named folder bundle (#7)
All checks were successful
CI / unit (push) Successful in 44s
CI / backend-e2e (push) Successful in 1m14s
CI / dashboard-e2e (push) Successful in 2m24s
The per-clip download button now fetches a new
GET /api/jobs/{job_id}/clip/{clip_index}/download endpoint that packages the
saved clip as a ZIP shaped like a folder named after the clip title:

    <title>/clip.mp4
    <title>/description.txt

Titles are sanitized into a single filesystem-safe path segment, and the
archive is named <title>.zip. File resolution mirrors download-all (live
record, then metadata URL, then canonical derived name). The frontend keeps
its streaming progress UI and derives the filename from Content-Disposition.

Reviewed-on: #7
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-05 14:41:20 +01:00
91a5465f81 chore: drop watermark feature, CLI, docs, design.md; consolidate requirements (#6)
All checks were successful
CI / unit (push) Successful in 45s
CI / backend-e2e (push) Successful in 1m16s
CI / dashboard-e2e (push) Successful in 2m29s
- Remove the watermark feature end to end (watermarked.py, apply_watermark/
  mark_delivery/watermark_filter, WATERMARK env, assets/) and its tests; self-host
  delivery is now unconditionally clean.
- Delete the unused cli/ package and .github/workflows/publish-cli.yml.
- Delete docs/ (compliance) and design.md; drop the dangling references in the
  legal page and the design-token/ui comments.
- Consolidate requirements: requirements.txt (runtime) + requirements-test.txt
  (unit + E2E); remove requirements-e2e.txt and requirements-ml-e2e.txt and
  point both CI jobs at the single test file. Add libgl1 to the unit job
  (scenedetect -> opencv-python links libGL).

Verified in the CI container: unit 701 passed; API E2E 209; pipeline E2E 127;
Playwright 19 passed / 1 skipped.

Reviewed-on: #6
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-05 11:11:37 +01:00
0040aa49da test/e2e-coverage (#5)
All checks were successful
CI / dashboard-e2e (push) Successful in 1m44s
CI / unit (push) Successful in 29s
CI / backend-e2e (push) Successful in 1m17s
Reviewed-on: #5
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:28:46 +01:00
1dec0dd1af chore/dead-code-removal (#4)
All checks were successful
CI / backend-tests (push) Successful in 28s
CI / frontend-build (push) Successful in 20s
Reviewed-on: #4
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 22:11:11 +01:00
719946b3cd refactor/package-layout (#3)
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-build (push) Successful in 9m48s
Reviewed-on: #3
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:47:12 +01:00
d56455e555 fix(publish): channel-by-id selection, DD/MM/YYYY scheduling, app-first boot (#1)
All checks were successful
CI / backend-tests (push) Successful in 32s
CI / frontend-build (push) Successful in 31s
- Postiz publishing now selects exact channels by integration id; identifier
  mapping fixes instagram-standalone (was 'not connected') and multiple channels
  per network (was first-only); settings.__type uses the real identifier
- Publish modal lists all channels, DD/MM/YYYY + HH:MM scheduling with validation,
  surfaces backend errors and a success confirmation
- Remove AWS/S3 clip backup and ElevenLabs voice dubbing (server, UI, tests, docs)
- Boot straight into the app; remove the landing/launch screen
- CI backend-tests runs in a python:3.11-slim container (Forgejo has no 3.11 cache)

Reviewed-on: #1
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:07:42 +01:00
80e59db429 docs: simplify README and clarify OpenShorts fork provenance
Some checks failed
CI / backend-tests (push) Failing after 14s
CI / frontend-build (push) Successful in 30s
2026-10-04 18:14:33 +01:00
ace54c6e77 chore: rename OpenShorts to Clipwright
Some checks are pending
CI / backend-tests (push) Waiting to run
CI / frontend-build (push) Waiting to run
- Rebrand all text, package/CLI (clipwright_cli), env vars (CLIPWRIGHT_*),
  localStorage keys, Docker container names and webhook header
- Rename/relocate assets, skills/, n8n examples, font map; delete dead MCP
  metadata (server.json, glama.json) and generated egg-info
- Canonical site URL -> https://git.pbento.pt/pedro-bento/clipwright
- Preserve fork provenance (upstream OpenShorts attribution in README/NOTICE/LICENSE)
2026-10-04 18:07:07 +01:00
4e82d60cbc fix: harden Postiz integration and align docs/CLI/n8n after review
- Postiz URL is now required (no built-in host); a key can never be sent to a default instance
- /api/postiz/scheduled normalizes scheduled_date and widens the default window
- Disabled channels are refused for posting; frontend excludes them from connected platforms
- 4xx instead of 500 on missing clip URL / bad schedule date; Postiz error bodies truncated
- Add tests/test_postiz.py (24 tests); fix remaining cloud-removal test drift
- CLI defaults to localhost:8000; n8n workflows fixed against the real routes
- Remove dead media-token auth code, stale copy (download_url/402) and doc drift
2026-10-04 17:25:17 +01:00
edcfeaf9d5 refactor: remove cloud/ billing mode and flatten to self-hosted-only
- Delete the entire cloud/ package (Stripe billing, auth/OAuth, metering, API keys,
  account erasure, lifecycle/digest emails, R2 archive, autopilot, MCP OAuth,
  proxy ledger, managed keys) and all BILLING_ENABLED branches in app.py
- Keep self-host behavior via no-op shims; /api/config now returns
  {youtubeUrlEnabled, jobRetentionSeconds, localLlm}
- Remove cloud tests (31 files), alembic/, log_view.py, requirements-billing.txt,
  docker-compose.cloud.yml; update CLI to Postiz + /api/config; clean docs/skills
- Flatten dashboard: remove auth/billing/pricing/history chrome, inert config-only AuthContext
- Fix residual test drift; lint + build + compile all green
2026-10-04 17:02:55 +01:00
fbabb4ec5d refactor: self-hosted fork — Postiz publishing, drop AI Shorts/UGC/agent/autopilot/MCP, fix Studio image API, remove upload cap
- Replace Upload-Post with a self-hosted Postiz client (postiz.py) and /api/postiz/* endpoints
- Remove AI Shorts, UGC gallery, AI Agent tab, Autopilot, MCP/agent layer, and their UIs
- Fix YouTube Studio thumbnail generation (google-genai >=2 Interactions API) and blocking download
- Make the video upload size cap configurable/unlimited (MAX_FILE_SIZE_MB, default 0)
- Update SEO/marketing/docs to the single-product self-hosted reality; lint+build green
2026-10-04 16:30:44 +01:00
juancarlos.cavero
06a119c280 feat(mcp): caption presets and the new caption options in add_subtitles
/api/subtitle takes a named preset (subtitles.CAPTION_PRESETS, the same
looks the dashboard offers); fields sent alongside it override that part.
The MCP add_subtitles tool exposes preset, effect, reveal, one_word, shadow
and border_width, and gives a resized line the budget that keeps it on one
line, as the dashboard does. A test keeps the server and dashboard preset
ids in sync.
2026-10-01 18:35:37 +02:00
juancarlos.cavero
9cc0a0feb0 feat(captions): size control and trending caption presets
The subtitle modal had no size control: the font size was pinned at 24
while clips ship at 44, so re-applying captions from the modal halved them.
It now opens on the shipped look and offers S/M/L/XL, with fewer characters
per line as the text grows so a line still fits the 9:16 frame.

New in generate_ass: a "highlight" effect (opaque box behind the active
word via a second BorderStyle 3 style, black text on light boxes), "reveal"
(words appear as they are spoken), a drop shadow, and an outline of 0 when
a shadow carries the contrast. /api/subtitle takes reveal, shadow,
max_chars (1 = one word at a time) and max_duration.

Presets added: Default, Hormozi, Pill, Lime box, One word, Clean. Anton and
Montserrat are selectable, and the preview uses the burn's scale and line
budget so what plays in the modal is what gets burned.
2026-10-01 17:48:42 +02:00
juancarlos.cavero
cb37ae3aec feat(watermark): serve the free-plan mark as a copy, so paying removes it from existing clips
Every file the pipeline and the clip editor write is now clean. On the free
plan the served file is a wm_<final> copy with the mark burned in
(main.mark_delivery, last step after captions; app._deliver for the editor
endpoints, decided from the caller's plan), and both twins go to R2. An
upgrade re-points the user's library at the clean twins from the Stripe
webhook (cloud.videos.unmark_user_library): no render, no source video,
and the dashboard chases the job result until no served URL carries wm_.

Before, the mark rode the reframe encode, so every derivative inherited it
and the upgrade modal's "upgrade to remove the watermark" was false for the
clips already made. The first cancellation for "clip quality" (29-sep) was a
user who paid 15 minutes after their first job and kept the mark on every
download and restyle.

- /videos guard refuses a marked job's clean deliverables (.marked dotfile),
  so the twin cannot be fetched by stripping the prefix off a URL; editor
  scratch files stay servable. Re-checked after an R2 restore.
- Walk-backs treat wm_ as the outermost layer; _canonical_clip_file globs it.
- Jobs from before this scheme (mark burned into the canonical) never get a
  second copy; a failed mark still serves under the wm_ name.
- Watermark notice once per job when the clips land on a free account, and
  before the first download if skipped; tracked with source=results|download.
  Upsell/banner/win-back copy now promise the instant removal.
2026-10-01 09:35:53 +02:00
juancarlos.cavero
faff66de0b feat(download): skip the static IPs when the probe already saw them bot-checked
Since 30-sep-2026 YouTube bot-checks anonymous requests from every one of
our non-residential IPs per video: the same video fails on the 3 statics
and the server's own IP, with every player client, and the paid residential
proxy answers it. The metering probe learns that verdict first; the
download then repeated four anonymous attempts (~8 s, four more hits on IPs
YouTube is scoring) before reaching the paid proxy for the same answer.
The probe now leaves a one-shot verdict per URL, app.py passes it to the
job as DOWNLOAD_SKIP_STATICS=1 (and into the resume manifest), and
plan_download_attempts drops the free attempts when a paid proxy exists.
2026-09-30 16:30:04 +02:00
juancarlos.cavero
8ee8ae36c6 feat(alerts): page when the YouTube session cookies stop being recognised
The pool probe says UP while one static still answers, and the ledger
alert names IPs, so a rotated cookie session (every download anonymous,
statics bot-checked one by one, jobs on the per-GB proxy) went unnoticed
for ~900 MB on 30-sep-2026. The static probes already fetch the watch
page with the cookies attached; read the ytcfg LOGGED_IN marker yt-dlp
itself uses and open a one-strike incident naming the fix.
2026-09-30 13:27:09 +02:00
victorcavero14
29c54fa04c feat(cancel): retention offer as the last step, resume from the account page
The Stripe portal stops cancelling (its config, 2026-09-28), so the dashboard
flow is the only way out and carries the portal's retention coupon:
- GET /api/billing/retention-offer: live monthly plan, no discount on it, never
  offered before (retention_offer in the Stripe sub metadata). Any Stripe error
  means no offer, never a stuck flow. Coupon id from RETENTION_COUPON_ID.
- POST /api/billing/retention-offer/accept: applies the coupon, stores the
  feedback with outcome=retained, alerts "Cancel saved".
- POST /api/billing/resume + "Keep my subscription": undo a scheduled cancel,
  which the portal did with the cancel feature now off.
- cancellation_feedback.outcome (additive column).
2026-09-28 19:03:38 +02:00
juancarlos.cavero
42942aecfe feat(feedback): in-app cancel flow with reason + review, and a sign-up survey
- POST /api/billing/cancel: closed-list reason, optional detail, 1-5 rating and
  review; cancels at period end in Stripe with cancellation_details, then stores
  cancellation_feedback. Account page opens CancelPlanModal (3 steps).
- Portal cancellations: churn alert now carries Stripe's feedback value.
- POST /api/onboarding/survey + /api/me onboarding_survey_pending: accounts under
  7 days get one skippable screen before the clip tutorial (what they want to
  make, where they heard of us, who they are). Stored in onboarding_surveys and
  tracked as SignupSurveyAnswered with per-goal props.
- Both new tables are user-owned and erased with the account.
2026-09-28 18:27:00 +02:00
victorcavero14
9837228365 feat(free-plan): one whole first video per network every 30 days
A stack of Google accounts from one IP used to get a 60-minute first video
each. first_video_grants keeps an HMAC of the client IP (never the IP), not
tied to the user row, counting only grants whose reservation is live; a
network that already had one gets the first-N-minutes cut instead.
2026-09-28 13:33:22 +02:00
victorcavero14
c7dab3dbf4 feat(landing): say the first video is free up to 60 min, then 20 min a month
Hero trust line, cloud card, pricing header, final CTA, pricing page, tool
gate, the crawler fallback, the default SEO CTA and the Cloud summary in
seo/data.js.
2026-09-28 13:29:14 +02:00
victorcavero14
725aebf1a3 feat(funnel): first free video clipped whole, auto-partial instead of the wall, lifecycle emails
- Free source past the balance: first video (<= 60 min) clipped whole for the
  balance, any other clipped to the first N minutes. No 402 wall for free
  accounts with >= PARTIAL_MIN_MINUTES left.
- cloud/lifecycle.py: welcome, first-clip nudge, win-back (optional
  WINBACK_PROMO_CODE from env) and abandoned-checkout recovery via
  after_expiration.recovery + checkout.session.expired.
- Commercial emails go through send_commercial_email: opt-out honoured,
  unsubscribe footer and List-Unsubscribe headers (out-of-minutes too).
2026-09-28 13:05:43 +02:00
victorcavero14
89f0309343 ci: publish the CLI to PyPI on cli-vX.Y.Z tags (Trusted Publishing) 2026-09-27 21:24:48 +02:00
Víctor Cavero
965ffa90fb docs(readme): the clone directory is lowercase openshorts 2026-09-27 21:05:26 +02:00
Víctor Cavero
63ca93e704 chore(license): move the cloud/ exception to NOTICE so GitHub detects the MIT license 2026-09-27 20:58:14 +02:00
victorcavero14
77d3a1143e feat(hooks): "edit hook" with a typeface picker; a preview that matches
- The clip button and modal are "edit hook" (was "viral hook"), and the
  submit says "update hook" when the clip already has one.
- Typeface picker: Montserrat, Anton, Serif, all bundled so the server
  render (hooks.HOOK_FONTS, /api/hook `font`) and the Remotion preview
  (HOOK_FONTS in remotion/lib/fonts.ts) use the same file and size.
  Unset keeps each style's own typeface, so existing styles render as
  before.
- The preview box is a true 9:16 (it was taller than the video, so the
  hook sat off where it lands); style swatches are larger, drawn in the
  real typeface, and "Pills" shows pills.
- Entrance options are hidden when they cannot apply (server re-render)
  instead of shown greyed out.
- Autopilot: skipped videos can be clipped again by hand (private videos
  used to be misread as Shorts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:57:30 +02:00
victorcavero14
a9818832b3 fix(autopilot): no ownership checkbox; private videos said as such
- The connected channel (YouTube's own OAuth) is the proof the content is
  the user's: the "I own the content" checkbox is gone, and switching
  Autopilot on records rights_ack_at by itself. "Clip it" no longer
  requires it either.
- Private videos read as "already a short": /shorts/<id> answers 200 for
  them too. is_youtube_private (oEmbed 401/403) runs first; a manual clip
  says "private on YouTube, set it to Unlisted", and the automatic poll
  leaves the video unclaimed so it is picked up once it goes public
  (scheduled uploads are private until then). They cannot be clipped:
  the YouTube Data API lists the owner's uploads but never serves the file.
- A pasted private video stops downloading as soon as yt-dlp says so
  (before the per-GB proxy) and tells the user why, instead of "YouTube
  blocked the request".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:51:08 +02:00
victorcavero14
c26178776f fix(autopilot): "clip it" tells you what happened, next to the button
Without the rights confirmation the button only set the page notice,
which renders at the top of the tab, far above the video list: the click
looked like it did nothing. The confirmation checkbox and the button's
feedback (started, not clipped and why, errors) now sit right above the
list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:37:04 +02:00
victorcavero14
a8509249da feat(hooks): "pill" hook style, the new default
Every line of the hook gets its own white rounded box with black bold
sans (Montserrat ExtraBold, SIL OFL, bundled in fonts/ with its license),
the look short-form viewers know from TikTok. It replaces the serif
white card as the default for auto hooks, the editor's hook modal and
the /api/hook default; the other six styles stay selectable.

- hooks.py: _draw_pills renders the stack for the FFmpeg path.
- Remotion HookOverlay mirrors it (box-decoration-break: clone), so the
  editor preview matches the burned result.
- The generate form says the hook text, style, position and size can be
  changed per clip afterwards; the saved style preference moves to a v2
  key so the old stored default does not pin people to the serif card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:34:54 +02:00
victorcavero14
0ef20db988 fix(dashboard): real log times, stage progress, cards that use the width
Logs
- Each job log line records when it arrived (app._TimedLog) and
  /api/status returns log_times; the dashboard showed new Date() on every
  render, so every line had the same, moving clock.
- The cloud log view shows every stage: download %, early audio,
  transcription %, finding moments, layout, clips found, and per clip
  creating / framed / ready. Progress updates its own line instead of
  adding one per step. Lines glued to yt-dlp's \r progress bar (the
  parallel transcription prints onto it) are split, so its % shows again.
  "Found N clips" matched the old "viral clips" wording only.

Result cards
- The results grid only goes to two columns when each card gets ~600px
  (auto-fill) instead of at the xl breakpoint, where the side panel was
  squeezed and the copy buttons spilled out of the card.
- Card actions take as many per row as fit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 01:25:57 +02:00
victorcavero14
7103f9446f fix(download): range-fetch only sources far longer than the cap
The ranged fetch runs through ffmpeg at ~1-2.5x realtime; a source just
over the cap downloads natively in seconds. A 21-min video on a 19-min
cap took 8 min ranged. Now ranged only with no known duration or when the
source is over 3x the cap and 45+ min longer (finished livestreams).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 00:57:36 +02:00
victorcavero14
696659a828 fix(download): fetch only the paid minutes of a long or endless source
A capped job (MAX_SOURCE_MINUTES, or the SOURCE_CAP_MINUTES safety cap on
every metered job) still downloaded the whole source and cut it after.
On a finished livestream (hours of 1080p60) that meant GBs through the
proxy and a job stuck downloading for tens of minutes, long enough to
outlive a deploy drain and restart on the next instance.

When the source is longer than the cap (plus a margin) or has no known
duration, yt-dlp now downloads only that range (download_ranges);
cap_source_duration still makes the exact cut. Sources within the cap
download exactly as before. The early audio track is skipped for ranged
downloads.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 00:35:04 +02:00
victorcavero14
bb24a5e5ca fix(pipeline): let metered jobs use the early transcript
SOURCE_CAP_MINUTES is set on every metered job, so the early audio path
never ran in production. It is only a safety cap (it cuts a download
clearly longer than the reservation), so the early work now runs there
too and is dropped when the cut actually happens (the file is rewritten
in place: size/mtime change). MAX_SOURCE_MINUTES jobs, which are always
cut, keep the sequential path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-26 00:18:25 +02:00
victormanuel.caverogracia
aaeffcf002 perf(pipeline): transcribe and pick clips while the video downloads
The audio track is fetched on its own, in parallel with the video (same
m4a format the merged mp4 gets), and transcription + the Gemini pick start
as soon as it lands. By the time the video is in, the clips are usually
already chosen and the render starts right away.

- download_youtube_video(on_audio=): background audio-only fetch from the
  already extracted info; never on the per-GB proxy.
- main: uses the early transcript/clips when they are ready; any failure,
  capped sources (the cut is done on the video), checkpoints and
  --transcript keep the old sequential path. EARLY_AUDIO=0 turns it off.

Bench (real downloads, alternating runs): render starts 2-17 s sooner
with fast downloads and replayed Gemini; the transcript is identical.
Also drops internal details from comments and CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 23:51:18 +02:00
victormanuel.caverogracia
a404a11673 fix(hooks): say why the combined hook+captions pass failed
3 of 40 prod clips fell back to the two-pass path with no visible reason:
the job log truncates the CalledProcessError (argv first). Log the exit
code and the last non-progress stderr lines instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 21:13:42 +02:00
victormanuel.caverogracia
1679f8d7dc docs(claude): what the 25-sep speed work changed and how it was measured
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:42:07 +02:00
victormanuel.caverogracia
991cdef3ba perf(download): extract the video once per attempt, not twice
ydl.download([url]) re-ran the whole extraction (player clients, API JSON,
m3u8) that extract_info had just done: 4-9 s of round trips per attempt.
The unprocessed info is now handed to process_ie_result. Same file (MD5)
on a real 1080p video; falls back to ydl.download for playlists and
anything without formats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:39:21 +02:00
victormanuel.caverogracia
6e660d8f92 perf(pipeline): GPU cut, CPU VAD, cheap blur, hook+captions in one pass, 6 clip workers
Same clips to the eye (SSIM 0.990-0.9998 vs before, audio identical,
frames checked by eye), faster:
- Cut on the card end to end (NVDEC -> NVENC, hwaccel_output_format cuda)
  for 8-bit 4:2:0 h264/hevc/vp9/av1 sources; byte-identical decoded frames
  to the CPU cut, -64% CPU. Anything else, or a failed GPU cut, decodes on
  the CPU as before.
- Silero VAD on one CPU thread instead of CUDA (one 32 ms chunk per launch):
  transcription 2-3x faster (9 min audio: 28 -> 9 s). Over 3,939 words one
  changed ("claudio" -> "cloud", said "Claude") and a few times moved <=48 ms.
- The blurred backdrop is blurred at quarter size and scaled up
  (ffmpeg_utils.blurred_backdrop): ~45% less CPU on those segments.
- hooked_ and subtitled_ come out of ONE ffmpeg (hooks.add_hook_to_video
  also=...), one decode instead of two; subtitled_ is one generation fewer.
  Same filenames, so the editor's walk-back is unchanged. Falls back to the
  two passes if the combined one fails.
- CLIP_WORKERS default 3 -> 6: -14-16% wall per job at load 48-67, same CPU,
  peak VRAM 12 GB of 20.

Bench on balrog (3 Carlos Gracia videos, old/new side by side).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 20:28:22 +02:00
victormanuel.caverogracia
90b10c1902 perf(render): burn the watermark in the reframe encode; read AV1 sources
- The free-plan watermark (~97% of jobs) rode a pass of its own: decode
  the finished clip, overlay, encode it all again. It now goes into each
  reframe segment's own encode (reframe_v2.render(watermark=True), same
  geometry via main.watermark_filter). One NVENC encode less per clip; the
  v1 fallback and horizontal clips still use apply_watermark. The editor's
  paths (recut.py) are untouched.
- layout_picker.sample_frames falls back to the ffmpeg CLI when OpenCV
  reads no frame: OpenCV's bundled FFmpeg has no AV1 software decoder, so
  AV1 YouTube sources always got the default layout. H.264 sources return
  byte-identical frames (same JPEG MD5).

Bench on balrog, 3 videos, old and new run side by side: job CPU -27 to
-43%, wall -6 to -12%; clips SSIM 0.990-0.999 vs before (one generation
fewer), audio identical, watermark position checked by eye.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 19:47:34 +02:00
victormanuel.caverogracia
a4c92cac2c perf(pipeline): halve a job's CPU with byte-identical clips
Reverts 1d3d20c (NVDEC decode + quarter-size blur): it changed the
delivered pixels (SSIM 0.998-0.9997, not identical), and clips must not
change. Replaces it with two fixes that leave every clip byte-identical.

- Parakeet's onnxruntime pool threads no longer spin
  (transcribe_backends.parakeet_session_options). While the GPU did the
  work they burned ~160 CPU-s per 9 min of audio, the biggest CPU cost of
  a job. The VAD keeps load_vad's defaults: any options there make
  onnx_asr drop its default providers and a word changes.
- analyze_scenes_strategy and split_layout read their sampled frames in
  one forward pass (frame_sampler.read_at) instead of a seek per sample,
  which re-decoded the GOP every time: 89 -> 6 CPU-s for one clip's
  samples, same frames.

Bench on balrog, 3 Carlos Gracia videos (2.5/9/17 min, 15 clips), Gemini
decisions recorded once and replayed: every clip identical to the old
code (decoded-frame MD5s + audio). Serial stage profile of the 9 min
video: 629 -> 273 CPU-s per job; Python side 332 -> 57 CPU-s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 15:40:22 +02:00
victormanuel.caverogracia
cbf0eb37f3 ci: install greenlet explicitly (SQLAlchemy asyncio no longer pulls it in)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-25 13:34:28 +02:00