Git Product home page Git Product logo

sabnzbd-postprocess-videos's Introduction

sabnzbd-postprocess-videos

Post-processing videos and related files to provide you with a cleaner end-result

This post-processing script does the following

  • Flattens the contents
    • Sometimes uploaders embed video and other file types in a crazy folder structure, first we flatten this out so we can process everything.
  • Removes files smaller than 60MB
    • This is of course an arbitrary number I chose based on experience, anything smaller than that is typically NOT something we need.
  • Attempts to fix obfuscated video file names
    • Only works with downloads that contain a single video file, i.e. it won't work with TV seasons or multi-part movie downloads. In other words, there can only be one primary video file in the folder to be processed for this to work.
  • Removes Title and Comments metadata
    • This is done to avoid media libraries like Plex reading from the metadata as opposed to file name. I recently ran into a scenario where Plex had read a file's metadata title and used that in the library as opposed to parsing the file name. This has caused some wild names to appear in my library.

Dependencies

  • python3
  • ffmpeg (for metadata removal)

SABnzbd Configuration

  1. Set a scripts folder under: Settings > Folders > Scripts folder

image

  1. Drop the script into the folder you set and make sure sabnzbd has rights (Linux: sudo chmod +x process_videos.py)
  2. Set the script to run for certain categories under: Settings > Categories (i.e. TV or Movies or any other video categories you might have)

image

Note: This script will remove subtitle files due to their small size. I personally do not use sub files and prefer hard subs embedded in my videos.

sabnzbd-postprocess-videos's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

richrad

sabnzbd-postprocess-videos's Issues

Stripping Subtitles

on debian:
Linux gettech 5.10.0-19-amd64 #1 SMP Debian 5.10.149-2 (2022-10-21) x86_64 GNU/Linux
Running mxlinux as desktop, running sonarr/sabnzbd docker, sabnzbd is modified via enviroment:
-e DOCKER_MODS=mdhiggins/sma-mod:latest, this includes ffmpeg from: jrottenberg/ffmpeg

Here's my location:

ls -all /home/me/.config/appdata/sabnzbd/data/

total 12
drwxr-xr-x 2 me me 4096 Dec 5 09:39 .
drwxrwxr-x 7 me me 4096 Dec 5 09:37 ..
-rwxr-xr-x 1 me me 3376 Dec 5 09:39 process_videos.py

output from ffprobe, after processing in sabnzbd

ffprobe -i Manifest\ -\ S04E03\ -\ High\ Flight\ WEBRip-1080p.mkv
ffprobe version 4.3.5-0.1+mx21+1 Copyright (c) 2007-2022 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --prefix=/usr --extra-version=0.1+mx21+1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[matroska,webm @ 0x5585fbca1a00] Could not find codec parameters for stream 2 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[matroska,webm @ 0x5585fbca1a00] Could not find codec parameters for stream 3 (Subtitle: hdmv_pgs_subtitle (pgssub)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, matroska,webm, from 'Manifest - S04E03 - High Flight WEBRip-1080p.mkv':
Metadata:
ENCODER : Lavf59.27.100
Duration: 00:43:03.20, start: 0.000000, bitrate: 3181 kb/s
Stream #0:0: Video: hevc (Main), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
DURATION : 00:42:00.934000000
Stream #0:1: Audio: eac3, 48000 Hz, 6 channels, fltp (default)
Metadata:
DURATION : 00:43:03.200000000
Stream #0:2: Subtitle: hdmv_pgs_subtitle (default)
Metadata:
DURATION : 00:40:57.245000000
Stream #0:3: Subtitle: hdmv_pgs_subtitle
Metadata:
DURATION : 00:41:05.295000000

What can I change to remove subtitles?
Would you consider adding down mixing from one audio to another?
The image mdhiggins/sma-mod:latest has this capability, however he is using an .ini file, and I can find no explanation on methods of subtitle removal, it down mixes the the audio just fine.
I much prefer your method of coding the ffmpeg calls, nice job.
Thanks for taking the time to put this together.
sabnzbd.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.