Skip to content

feat(storage): make MP4 faststart configurable ([storage] mp4_faststart) - #632

Closed
hotkhwan wants to merge 1 commit into
opensensor:mainfrom
hotkhwan:mp4-faststart-option
Closed

hotkhwan wants to merge 1 commit into
opensensor:mainfrom
hotkhwan:mp4-faststart-option

Conversation

@hotkhwan

@hotkhwan hotkhwan commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Every recorded MP4 segment is finalised with movflags=+faststart, which re-reads the whole segment and re-writes it with the moov atom at the front. On network storage this roughly triples the I/O: measured on a 41-camera site recording ~8.7 MB/s to a single-disk NFS share, the NAS saw ~15 MB/s of writes plus ~13.6 MB/s of reads, and playback reads slowed to 3-8 MB/s.

Add [storage] mp4_faststart (default true, the current behaviour) so a site recording to a NAS or slow HDD can skip the rewrite. Players that use HTTP range requests, including the web UI, play either layout. The option is read from and written back to the ini, exposed in the settings API, and applies to segments opened after a change.

Every recorded MP4 segment is finalised with movflags=+faststart, which
re-reads the whole segment and re-writes it with the moov atom at the front.
On network storage this roughly triples the I/O: measured on a 41-camera
site recording ~8.7 MB/s to a single-disk NFS share, the NAS saw ~15 MB/s
of writes plus ~13.6 MB/s of reads, and playback reads slowed to 3-8 MB/s.

Add [storage] mp4_faststart (default true, the current behaviour) so a site
recording to a NAS or slow HDD can skip the rewrite. Players that use HTTP
range requests, including the web UI, play either layout. The option is
read from and written back to the ini, exposed in the settings API, and
applies to segments opened after a change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution to lightNVR! 🎉

Before we can merge your pull request, we need you to sign our Contributor License Agreement (CLA).

Why a CLA?
lightNVR uses a dual-licensing model. While the project is freely available under GPLv3, OpenSensor Engineering also offers commercial licenses. The CLA ensures we can continue offering both options.

To sign the CLA, please reply to this comment with exactly:

I have read the CLA Document and I hereby sign the CLA

You only need to sign once, and it applies to all future contributions.


ℹ️ More about the CLA

The CLA grants OpenSensor Engineering the right to:

  • Include your contributions under GPLv3 (open source)
  • Offer commercial licenses that include your contributions

You retain copyright of your contributions and can use them in other projects.

- - - I have read the CLA Document and I hereby sign the CLA - - - You can retrigger this bot by commenting **recheck** in this Pull Request. Posted by the **CLA Assistant Lite bot**.

@hotkhwan

hotkhwan commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #633

@hotkhwan hotkhwan closed this Oct 9, 2026
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.

2 participants