Skip to content

Add complete stream saving and durable Continue playback - #1

Merged
devlifeX merged 5 commits into
mainfrom
feature/save-buffered-video
Oct 19, 2026
Merged

devlifeX merged 5 commits into
mainfrom
feature/save-buffered-video

Conversation

@devlifeX

@devlifeX devlifeX commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Network playback loses cached packets as buffers are evicted or audio tracks change, and ordinary watch-later state can be lost when the player terminates abruptly. This adds a complete selected-stream export and a durable Continue action to the context menu.

Continue is the first root-menu item, including legacy custom menus while preserving existing key bindings. Playback checkpoints are written every second and after key playback changes using a flushed temporary file, atomic replacement, and a previous-version backup. Continue reopens the original source at the saved fractional position with playback/track, external-subtitle, video, and connection settings, independently of native watch-later resume. Failed connections, missing external tracks, imprecise seeks, and stale events from the previous stream cannot overwrite the recovery checkpoint. Healthy paused playback can continue without discarding its buffer.

File > Save Buffered Video... pins the video, selected audio, audio delay and connection settings before opening the Save dialog. Complete cached streams can be saved offline. Incomplete or untrustworthy streams are fetched from the beginning in an independent background player, including audio prefixes missing after a track switch. Sources shared by required streams are fetched together; a complete cached video can be combined with separately downloaded selected audio. This conservative completion may re-read more than the missing intervals. Native watch-later resume is disabled for downloads. Transient failures are retried up to three times, without changing foreground playback or later track selections.

Export combines selected video/audio without re-encoding, validates cached packet continuity and complete source reads, compares packet counts and durations for each selected stream before/after muxing, and decodes the result before replacing the destination. Decoder error logs are treated as failures even if FFmpeg exits zero; bad cached payloads are fetched again. Original source gaps and genuinely shorter audio tracks are preserved. Truncated downloads, cancellation, mux errors and failed verification leave an existing destination intact. Closing the window cancels an active export and waits for its cleanup. FFmpeg is included by the x64/ARM64 dependency-update and release scripts; the application does not require FFprobe. Network packet caching is enabled on disk by default with a configurable 512 MiB packet-metadata back-buffer budget, and network videos stay open at EOF.

Windows CI now builds a Release x64 portable artifact on pull requests and every push to main. It bundles the .NET 10 runtime, checksum-verified libmpv, MediaInfo, FFmpeg and the console launcher, compiles translations, and starts the packaged tools on a Windows runner before uploading a ready-to-run ZIP.

Validation:

  • Windows-targeted .NET 10 build passed on Linux with no errors.
  • GitHub Actions Windows x64 Release publish, self-contained dependency packaging, translation compilation, packaged player/libmpv initialization and FFmpeg startup all passed: https://github.com/devlifeX/mpv.net/actions/runs/39273681609
  • Real libmpv integration passed all 18 scenarios (186 passing checks), covering selected external/internal audio and video, switching after buffering, dropped cache ranges, multi-stream EDL, HLS alternate audio renditions, shorter external/internal audio tracks, corrupt cached video, positive/negative audio delay, stale native resume bookmarks, later foreground track and source switches, actual HTTP failure followed by automatic recovery, cancellation during a download, parent-player shutdown, persistent HTTP failure and truncated input. Generated H.264 frames and every AAC packet are compared with the selected source, allowing mpv to omit the encoder priming packet. Required HTTP headers, cached-video reuse, foreground state, destination preservation and cleanup are also checked.
  • MP4 and MPEG-TS cache-export regression passed with the HTTP server explicitly shut down before saving. Checks compare decoded frames, AAC payloads, codecs and duration, and exercise localized filenames/timestamps, changed/stopped playback, async command errors and muxer failure.
  • Continue unit and real libmpv regression passed for atomic state/backup recovery, legacy menu placement, abrupt termination of the actual player process, restart with native watch-later disabled, HTTP failure/retry, interruption of an active TCP stream, and missing external subtitles. Fractional position, connection settings and playback settings are verified.
  • Both Windows FFmpeg dependency archives were inspected: each contains one executable with the expected x64 or ARM64 PE architecture.
  • git diff --check passed.

Runtime limits: Windows GUI interaction and physical power loss still need manual testing; packaged tool startup is verified on the Windows CI runner. Tests use libmpv 0.37 and controlled local HTTP origins, not a live account with expiring credentials. A source must be accessible to supply missing data; the completion pass and full decode verification can take time and need intermediate disk space. Large native cache dumps can temporarily stall playback. Abrupt shutdown can lose playback progress after the last completed checkpoint (normally up to one second plus storage/system delay); precise Continue requires a reachable, seekable source and available external files. Recovery checkpoints contain source URLs and connection settings. Playback state survives restart, while the previous playback cache remains temporary. See the manual and the three test READMEs for reproduction.

@devlifeX devlifeX changed the title Save fully buffered network videos from the context menu Add buffered video saving and durable Continue playback Oct 19, 2026
@devlifeX devlifeX changed the title Add buffered video saving and durable Continue playback Add complete stream saving and durable Continue playback Oct 19, 2026
@devlifeX
devlifeX merged commit eeac5c3 into main Oct 19, 2026
1 check passed
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