Skip to content

Parrallel and Threads do not work in docker #498

Closed

Description

@johntdyer

Is this a new issue that can be reproduced using the latest version?

  • This is a new issue that can be reproduced.

Which operating systems reproduce the issue?

  • Windows
  • Docker
  • Other

Version information.

OS Version: Debian 12
Docker Version: Run docker --version.
Docker Image: E.g. latest, latest-debian.
PlexCleaner getversioninfo: Run PlexCleaner getversioninfo.

Unable to use parallel or thread command flags

services:
  plexcleaner:
    image: docker.io/ptr727/plexcleaner:latest
    container_name: PlexCleaner
    restart: unless-stopped
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1 # alternatively, use `count: all` for all GPUs
              capabilities: [gpu]
    # user: nonroot:users
    command:
      - /PlexCleaner/PlexCleaner
      - monitor
      - --settingsfile=/mnt/media-tools/PlexCleaner/PlexCleaner.jsonc
      - --logfile=/mnt/media-tools/PlexCleaner/PlexCleaner.log
      - --preprocess
      - --parallel
      - --threadcount=10
      - --mediafiles=/media/movies
      - --mediafiles=/media/tvshows
    environment:
      - TZ=America/New_York
    volumes:
      - /media:/media
      - /mnt/media-tools:/mnt/media-tools
    labels:
      wud.watch: true

   

Steps to reproduce?

Steps to reproduce:

  • I did this.
  • Then I did that.
  • And this happened.
    Expectation:
  • I expected this to happen.

Commandline.

services:
  plexcleaner:
    image: docker.io/ptr727/plexcleaner:latest
    container_name: PlexCleaner
    restart: unless-stopped
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1 # alternatively, use `count: all` for all GPUs
              capabilities: [gpu]
    # user: nonroot:users
    command:
      - /PlexCleaner/PlexCleaner
      - monitor
      - --settingsfile=/mnt/media-tools/PlexCleaner/PlexCleaner.jsonc
      - --logfile=/mnt/media-tools/PlexCleaner/PlexCleaner.log
      - --preprocess
      - --parallel
      - --threadcount=10
      - --mediafiles=/media/movies
      - --mediafiles=/media/tvshows

Relevant log output.

09:44:02 [INF] <1> Exit Code : 1
Unrecognized command or argument '--parallel'.
Unrecognized command or argument '--threadcount=10'.

Description:
  Monitor for file changes and process changed media files

Usage:
  PlexCleaner monitor [options]

Options:
  --settingsfile <settingsfile> (REQUIRED)  Path to settings file
  --mediafiles <mediafiles> (REQUIRED)      Path to media file or folder
  --testsnippets                            Create short media file clips
  --testnomodify                            Do not make any media file modifications
  --preprocess                              Pre-process all monitored folders
  --logfile <logfile>                       Path to log file
  --logappend                               Append to existing log file
  --logwarning                              Log warnings and errors only
  --debug                                   Wait for debugger to attach
  -?, -h, --help                            Show help and usage information


09:44:05 [INF] <1> Exit Code : 1
➜  root@core  /common/shared-config/docker

Settings file.

{
"$schema": "https://raw.githubusercontent.com/ptr727/PlexCleaner/main/PlexCleaner.schema.json",
"SchemaVersion": 4,
"ToolsOptions": {
// Use system installed tools or tools directory
"UseSystem": false,
"RootPath": ".\Tools\",
// Tools directory is relative to PlexCleaner binary locations
"RootRelative": true,
// Automatically check for and update new tool versions on launch
"AutoUpdate": true
},
"ProcessOptions": {
// Files to skip, use * and ? wildcards, non-ascii characters must be JSON escaped
"FileIgnoreMasks": [
".ass",
"
.fuse_hidden*",
".jpg",
"
.nfo",
".partial~",
"
.sample.",
"
.sample",
".smi",
"
.srt",
".ssa",
"
.vtt"
],
// Keep all tracks flagged as original language
"KeepOriginalLanguage": true,
// Remove EIA-608 Closed Captions embedded in video streams
"RemoveClosedCaptions": true,
// Set IETF language tags when not set
"SetIetfLanguageTags": true,
// Set track flags based on track title keywords
"SetTrackFlags": true,
"ReMuxExtensions": [
".asf",
".avi",
".dv",
".m2ts",
".m4v",
".mp4",
".ts",
".vob",
".wmv"
],
// Re-encode video if the Format, Codec, and Profile values match
// Empty fields will match with any value
// Use FfProbe attribute naming, and the printmediainfo command to get media info
"ReEncodeVideo": [
{
"Format": "h264",
"Profile": "Constrained Baseline@30"
},
{
"Format": "indeo5"
},
{
"Format": "mpeg2video"
},
{
"Format": "mpeg4",
"Codec": "dx50"
},
{
"Format": "msmpeg4v2",
"Codec": "mp42"
},
{
"Format": "msmpeg4v3",
"Codec": "div3"
},
{
"Format": "msrle"
},
{
"Format": "rawvideo"
},
{
"Format": "vc1"
},
{
"Format": "wmv3"
}
],
// Re-encode audio if the Format matches
// Use FfProbe attribute naming, and the printmediainfo command to get media info
"ReEncodeAudioFormats": [
"adpcm_ms",
"flac",
"mp2",
"opus",
"pcm_s16le",
"pcm_u8",
"vorbis",
"wmapro",
"wmav2"
],
// Keep tracks if the language tags match, use RFC-5646 format
"KeepLanguages": [
"af",
"en",
"in",
"ja",
"ko",
"zh"
],
// Preferred audio tracks in order and by Format
// Use MkvMerge attribute naming, and the printmediainfo command to get media info
"PreferredAudioFormats": [
"ac-3",
"dts-hd high resolution audio",
"dts-hd master audio",
"dts",
"e-ac-3",
"truehd atmos",
"truehd"
],
// Delete empty folders
"DeleteEmptyFolders": true,
// Delete non-MKV files not in KeepExtensions or ReMuxExtensions lists
"DeleteUnwantedExtensions": true,
// Re-mux files in ReMuxExtensions list to MKV
"ReMux": true,
// De-interlace interlaced media
"DeInterlace": true,
// Re-encode audio and video tracks as specified in ReEncodeVideo and ReEncodeAudioFormats
"ReEncode": true,
// Set tracks with undefined language to DefaultLanguage
"SetUnknownLanguage": true,
// Default track language in RFC-5646 format
"DefaultLanguage": "en",
// Remove tracks if track language is not in KeepLanguages
"RemoveUnwantedLanguageTracks": false,
// Remove duplicate tracks of the same type, language, and attributes
// Audio tracks will use PreferredAudioFormats to select the preferred audio track
"RemoveDuplicateTracks": false,
// Remove tags, titles, and attachments
"RemoveTags": true,
// Speedup re-processing by caching state in sidecar files
"UseSidecarFiles": true,
// Invalidate sidecar cache when tool versions change
"SidecarUpdateOnToolChange": false,
// Verify containers and media streams
"Verify": true,
// Restore media file modified timestamp to original pre-processed value
"RestoreFileTimestamp": false,
// List of files to skip, exact match, non-ascii characters must be JSON escaped
"FileIgnoreList": []
},
"ConvertOptions": {
// FFmpeg commandline options
"FfMpegOptions": {
// Video encoding option following -c:v
// "Video": "libx264 -crf 22 -preset medium",
"Video": "h264_nvenc -crf 22 -preset medium",
// Audio encoding option following -c:a
"Audio": "ac3",
// Global options
// "Global": ""
"Global": "-hwaccel cuda -hwaccel_output_format cuda"
},
// HandBrake commandline options
"HandBrakeOptions": {
// Video encoding options following --encode
"Video": "x264 --quality 22 --encoder-preset medium",
// Audio encoding option following --aencode
"Audio": "copy --audio-fallback ac3"
}
},
"VerifyOptions": {
// If verify fails attempt media repair by re-encoding
"AutoRepair": true,
// Delete files that fail verification
"DeleteInvalidFiles": false,
// Add media files that fail verification to the FileIgnoreList
"RegisterInvalidFiles": false,
// Warn when bitrate in bits per second is exceeded
"MaximumBitrate": 100000000
},
"MonitorOptions": {
// Time to wait in seconds after detecting a file change
"MonitorWaitTime": 60,
// Time to wait in seconds between file retry operations
"FileRetryWaitTime": 5,
// Maximum number of file retry operations
"FileRetryCount": 2
}
}

Log file.

No response

Media file information.


Activity

  1. added
    bug
    on Apr 18, 2025
  2. ptr727 commented on Apr 18, 2025

    @ptr727
    Owner

    Docs and code are wrong, parallel currently only enabled for process command, not for monitor.
    Will address in next version.
    Thanks for reporting.

  3. johntdyer commented on Apr 21, 2025

    @johntdyer
    Author

    so if I am trying to process / optimize my entire library should I use process w/ threading and then at some point once I've determined its processed the backlog would I then migrate to the monitor mode? Guess I am trying to understand how a user would use your tool with a large established library

  4. ptr727 commented on Apr 21, 2025

    @ptr727
    Owner

    Either way, process until you are happy and then monitor, or monitor --preprocess to process first on every run then monitor changes after processing ends (yes there can be a race condition between iterate files, process, monitor, where new files are added during processing and before monitoring starts.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions