Skip to content

feat: add support for skipping video transcoding during local QC#81

Open
sumitrigi wants to merge 1 commit into
Techiebutler:mainfrom
sumitrigi:feat/support-for-original-video
Open

feat: add support for skipping video transcoding during local QC#81
sumitrigi wants to merge 1 commit into
Techiebutler:mainfrom
sumitrigi:feat/support-for-original-video

Conversation

@sumitrigi

@sumitrigi sumitrigi commented Jun 23, 2026

Copy link
Copy Markdown

Introduced a new configuration option USE_ORIGINAL_VIDEOS to allow skipping FFmpeg transcoding and serving uploaded videos as-is for local quality control. Updated relevant files to integrate this feature, including environment variables, Docker configuration, and API logic for handling uploads and processing assets.

Summary

Changes

Testing

  • Backend tests pass (python -m pytest apps/api/tests/ -v)
  • Frontend builds (pnpm --filter web build)
  • Tested manually in browser

Screenshots

Introduced a new configuration option `USE_ORIGINAL_VIDEOS` to allow skipping FFmpeg transcoding and serving uploaded videos as-is for local quality control. Updated relevant files to integrate this feature, including environment variables, Docker configuration, and API logic for handling uploads and processing assets.
@ravirajsinh45 ravirajsinh45 linked an issue Jun 25, 2026 that may be closed by this pull request

@ravirajsinh45 ravirajsinh45 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up, @sumitrigi — and thanks @siddhant-rigi for the context on #75. This is a clean, working first cut: I traced it end-to-end and confirmed the happy path holds together. When USE_ORIGINAL_VIDEOS=true, complete_upload marks the version ready, the transcode dispatch is skipped, and the stream endpoint correctly falls back to presigning s3_key_raw. The raw object keeps its video/mp4 Content-Type, so an H.264 MP4 plays inline in the browser. For the stated use case — local QC of H.264 deliverables — it does the job. 👍

Before we merge it into the public repo, though, I'd like to reshape it toward the design we landed on in #75, because as a global switch it has some sharp edges for anyone running a shared instance:

1. Make it a transcoder engine, not an instance-wide boolean.
USE_ORIGINAL_VIDEOS is read globally, so enabling it skips transcoding for every video from every org on the deployment. Per the issue, I'd rather express this as the pluggable path we already have — e.g. TRANSCODER_ENGINE=passthrough — so it slots into the existing engine selection instead of branching complete_upload/_process_video on a side flag. That keeps the decision in one place and avoids a one-env-var footgun.

2. Keep ffprobe + a lossless faststart remux in passthrough mode.
Right now nothing probes the file, so duration_seconds / width / height / fps stay null and no thumbnail is generated (grid/reel thumbnails go blank). And without ffmpeg -c copy -movflags +faststart, originals with the moov atom at the end (common in camera/NLE exports) make the browser do large tail/range fetches before it can seek — noticeable on the ~2GB files this is for. The remux is near-instant and lossless (QC is unaffected), so passthrough should still: probe metadata, generate a thumbnail, and faststart-remux. That gets you the QC speed win without losing the metadata/seek behavior the rest of the app expects.

3. Heads-up on codec compatibility.
Passthrough is only as playable as the source. H.265/HEVC MP4 — which was listed as one of the QC source formats — generally won't play in Chrome/Firefox, and since we're no longer normalizing to H.264 there's no fallback. Worth documenting this caveat clearly so it's not a surprise; H.264 MP4 will be perfect, HEVC/ProRes/MXF won't.

4. Wiring + docs.
The toggle is only added to docker-compose.dev.yml. docker-compose.prod.yml uses env_file: .env.prod, so it'd technically be picked up there if someone hand-added it, but it isn't surfaced for prod and isn't documented anywhere beyond the .env.example line. If this stays a dev/QC-only convenience, let's say so explicitly; if it's a real product feature, let's wire and document it for both.

One smaller note: in passthrough the transcode_complete SSE event isn't published, so other viewers on the project won't get the live "ready" nudge (the uploader is fine, since the response says ready). Minor, but easy to keep consistent once this goes through the engine path.

None of this is a knock on the implementation — the plumbing is correct. It's about making the feature safe to ship to everyone who pulls the repo. If you'd like, I'm happy to pair on the passthrough engine shape. Thanks again for the contribution! 🙏

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.

Need option to stop processing Video.

3 participants