Skip to content

Stream partial resolution while recording in full resolution (DWVO) - #629

Open
brandonhs wants to merge 3 commits into
mainfrom
621-stream-partial-resolution-while-recording-in-full-resolution-dwvo
Open

brandonhs wants to merge 3 commits into
mainfrom
621-stream-partial-resolution-while-recording-in-full-resolution-dwvo

Conversation

@brandonhs

Copy link
Copy Markdown
Member

Summary

Adds a "Stream Resolution" setting (Full, 1/2, 1/4, 1/8) for synchronized cameras that are recording a DWVO. The live stream is scaled down for bandwidth-limited links. The recording keeps the full-resolution frames for post-processing. Like endpoints, the scale is read live, so changing it doesn't restart the stream or split the recording into a new file.

  • jpeg_scaler.py (new): on Jetson, frames are scaled with the hardware JPEG codec (nvjpegdec → nvvidconv → nvjpegenc) through one long-running gst-launch process, one frame in and one frame out. If those elements are missing or the pipeline fails or stalls, it falls back to libjpeg-turbo, which decodes straight to the smaller size in the DCT domain. If neither is available, frames are sent full size.
  • stream_scale: a new field (1, 2, 4 or 8, default 1) on the stream, stream info and saved settings models. Old settings files still load.
  • Dependencies: PyTurboJPEG==1.8.3 (2.x needs libjpeg-turbo 3, which Debian 12, Ubuntu 22.04 and JetPack don't have), plus the libjpeg-turbo system package in install_requirements.sh and the Dockerfile.
  • Frontend: a "Stream Resolution" dropdown, shown for a synchronized leader in recording mode.

Not yet tested on an Orin NX. The GStreamer path was tested locally with software elements on GStreamer 1.20 (the same version as JetPack 6). If nvjpeg fails on the device, it falls back to libjpeg-turbo and logs a warning.

When #504 lands, PyTurboJPEG needs to be added to the pyproject dependencies.

Fixes #621

Type of change

  • Bug fix
  • Feature / Refactor
  • Breaking change
  • Misc.

Quick Checklist

  • I have reviewed my own code.
  • I have tested these changes locally.
  • I have tested these changes on the following platforms (optional):
    • SVC
    • microSVC (optional)
    • SVC Pro

Synchronized recordings can be streamed at 1/2, 1/4 or 1/8 of the recorded
resolution while the recording keeps full resolution frames. Frames are scaled
with the Jetson hardware JPEG codec when available, falling back to
libjpeg-turbo.
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Preview build: preview-pr-629 (v0.9.0-pr629.fdb5e41, built from fdb5e41)

curl -s https://raw.githubusercontent.com/DeepWaterExploration/dweOS/main/install.sh | sudo bash -s preview-pr-629

Rebuilt on every push. Closing this pull request deletes the preview.

Re-encoding at a fixed quality of 80 cut the bitrate far more than the
resolution did (400 to 30 Mbps at half resolution), since cameras send
higher quality frames. Each frame is now re-encoded at the quality read
from its own quantization table.
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.

Stream partial resolution while recording in full resolution (DWVO)

1 participant