Skip to content

Add source audio selection, sports framing, closing text and scheduling - #212

Open
Faizanpatel10 wants to merge 2 commits into
mutonby:mainfrom
Faizanpatel10:codex/creator-workflow-upgrades
Open

Faizanpatel10 wants to merge 2 commits into
mutonby:mainfrom
Faizanpatel10:codex/creator-workflow-upgrades

Conversation

@Faizanpatel10

Copy link
Copy Markdown

1. YouTube import, audio, and agent access

Creators can choose the audio YouTube already provides with a source before OpenShorts finds clips. The choice travels through download, transcription, clip selection, and export. This is especially useful for channels that publish several dubbed tracks on a single video.

  • Source audio picker. The YouTube link form can look up selectable audio tracks before generation. It shows localised language names, keeps region codes distinct, recognises audio-description labels, and keeps the source default available. The result and selected track belong to the pasted URL, so replacing the source cannot carry over a previous video's selection.
  • Metadata lookup. POST /api/process/audio-tracks returns a list of language codes. It uses the existing public-source validation, single-video check, entitlement, and probe budget. Successful lookup requires metadata only and the response exposes language codes without exposing extraction links or credentials.
  • Job submission. The source_audio_language option works with /api/process and the job command. The API validates the language code and YouTube source before starting a job. The validated option is part of the persisted command, so a resumed submission keeps the choice.
  • Download and transcription. The existing extractor result is filtered to the chosen audio and compatible video formats before yt-dlp picks quality. Both multiplexed and separate tracks are supported. The selected result is made available as MP4 and transcription reads the audio that actually landed in the combined file. If the requested track is unavailable, the job reports which language was requested.
  • Cache and checkpoints. Each explicit language has its own source-media and transcript cache entries, independent of the default. Language variants use the existing cache cleanup and size limits. The per-job source name also distinguishes the track so its transcript cannot be reused for a different audio stream. Probe facts optionally remember the available language codes, including for earlier callers that only use the duration and resolution.
  • Remote render handoff. The API host prepares a source with an explicit audio selection and hands off the prepared media to the existing remote render path. That protects the selection when the worker and API are on different revisions. Source links using the default track can still go through the existing worker download path.
  • CLI, MCP, and examples. openshorts audio-tracks <url> lists languages and openshorts process <url> --source-audio-language pt-BR selects one. MCP clients can call list_source_audio_tracks and set source_audio_language on process_video. The tool carries the existing MCP OAuth scope and reports errors from the REST route.

2. Sports framing and text editing

  • Sports action mode. The creation form and API offer an explicit camera for sports. The CLI and MCP expose the same option. In the clip editor, a creator can apply Sports action to an existing clip when the source is available. The selected camera is recorded with the clip's edit recipe for subsequent renders. Existing CLI commands still use their original render path when no sports option is supplied.
  • Shot-local detection. The camera samples about four frames per second and at shot boundaries. It looks for the sports ball class in compatible local YOLO weights, caps the analysis image width, rejects weak detections, and requires nearby observations before following a track. Each shot starts with independent observations.
  • Crop and fallback. Supported observations drive a speed-limited horizontal camera with a dead zone. The crop is accepted only when it retains the tracked observations. If evidence is limited, weights are unavailable, or inference fails, the renderer follows concentrated motion or fits the whole shot. Source-backed manual scene positions still take priority. The existing remote command whitelist keeps sports jobs on the primary host.
  • Opening hook timing. The text editor lets creators pick a duration or show the opening hook for the whole clip. The editor restores the saved copy and settings when reopened. For a recut, preview and rendering use the edited duration rather than the enclosing source span.
  • Closing call to action. A clip can have a closing message by itself or after its opening hook. The closing message has its own position, size, and duration, with up to 180 characters and 15 seconds. It uses the selected hook style and typeface. The end of the opening interval is limited to the start of the closing interval.
  • Preview. The editor previews the delivered aspect ratio when metadata is available and offers a shortcut to the last section. The preview uses the top position for Auto. On the server, Auto considers the text's part of the timeline, layout, faces, and caption bands.
  • Render and persistence. FFmpeg renders the opening and closing text in one text-overlay encode and preserves the audio stream. The hook endpoint can save, replace, or remove timed text. It keeps the clean source for repeat edits, reapplies existing captions afterward, and stores the settings alongside the clip. Edits write a new file and share the existing rerender lock.
  • Later edits. Trims and manual reframing reapply the stored text after the clean picture is rendered and before captions are burned. A closing message is timed from the new end of the clip. Pro mode restores the text from its saved settings and keeps the opening interval available to its title placement logic.
  • Evidence and limits. The sports checks cover shot boundaries, insufficient detections, bounded motion, and fallback. Field footage and dedicated multi-athlete tracking remain open verification and implementation work. The closing CTA is a text overlay. A separate appended outro card is listed in the feature reference. Public sports and clipping overview · Public hook and CTA guide

3. Publishing, verification, and remaining parity

  • Content calendar. Settings opens an in-app agenda in hosted and self-hosted mode. Batch scheduling also links to the agenda. The calendar groups upcoming posts by local date and shows the publish time, destination names, and post title or source filename. It has refresh, loading, empty, and connection states.
  • Reschedule and cancel. A pending item can move to a future time or be cancelled after confirmation. The client sends an unambiguous timestamp and the API forwards an update to the provider. The list request is scoped to the selected profile, responses are filtered again by profile, and both mutations require a matching post. The self-hosted form repairs a stale selected profile after a successful profile lookup.
  • X publishing. X is available in the clip and batch destination selectors and in the managed account connection flow. It is opt-in for manual clip posting. The backend shares the destination allowlist with scheduling, CLI, Autopilot, and MCP. Upload-Post receives the generated or edited description in its X-specific text field. X availability depends on the connected profile and its provider plan. Upload-Post video publishing · Upload-Post scheduling
  • Verification. Local fixtures cover the selected audio stream against two distinguishable source tracks, audio variant cache separation, persisted job flags, app/API overlay updates, CTA timing at the exact configured boundary, original audio preservation, schedule ownership, and UTC rescheduling. The browser calendar was exercised with mocked provider responses. Dashboard lint and a production build passed. The targeted test runs passed 499 tests, including three remote-worker integration scenarios over loopback. A CPU-only sports smoke export produced 1080×1920 H.264 and kept its audio with the full-frame fallback. Live provider delivery and model quality on labelled sports footage remain to be verified.
  • Public feature reference. The repository includes a source-linked comparison covering import, clipping and ranking, layouts, captions, editing, publishing and calendars, channel automation, REST and MCP, AI templates, credits, and Clip Rewards. It identifies existing capabilities and the work still needed for comparable behavior. Open gaps include a licensed media library, cue-level effects, full status and slot management, dedicated athlete tracking, and the rewards marketplace and payouts. Feature reference · Public API · Public MCP guide
  • Upstream scope. The branch starts from mutonby/openshorts main and keeps these improvements separate from the earlier transcription and visual framing pull request. It uses the existing upstream worker, editor, cache, publishing, and storage entry points.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant