项目作者: Digiex

项目描述 :
This script automates media conversion to a universal MP4 format using FFmpeg.
高级语言: Shell
项目地址: git://github.com/Digiex/M4V-Converter.git
创建时间: 2014-03-26T20:08:58Z
项目社区:https://github.com/Digiex/M4V-Converter

开源协议:GNU General Public License v3.0

下载


M4V-Converter

This script automates media conversion to a universal MP4 format using FFmpeg.

Fully integrates with NZBGet so that media converts automatically
on post-process! SABnzbd is also supported although it does not
get a WebUI config, though can still be configured using a config file!

Tested on x86-64 alpine/ubuntu/macOS and arm64 macOS (Apple Silicon/M1)

Found a bug? Report it here!

Dependencies

Requires bash version 4 or greater, ffmpeg, ffprobe and jq

Ubuntu:

  1. apt-get update
  2. apt-get install ffmpeg jq

Alpine:

  1. apk update
  2. apk add bash ffmpeg jq

macOS: Requires Homebrew

  1. brew update
  2. brew install bash ffmpeg jq

When using macOS the default bash is still only version 3 and if you want to use the NZBGet.app or SABnzbd.app with the script you will need to do the following to correct PATH issues:

  1. Find the PATH to bash, which bash This should return either /opt/homebrew/bin/bash (arm64) or /usr/local/bin/bash (x86) depending on your Mac architecture

    • NZBGet: Open the NZBGet webui, go to settings, extension scripts, look for ShellOverride, give it the PATH to the newer version of bash. This should look like: .sh=/opt/homebrew/bin/bash
    • SABnzbd: Edit the script, change line 1 #!/usr/bin/env bash to the PATH of the newer version of bash. This should look like: #!/opt/homebrew/bin/bash

One solution that works for both is to set a launchctl environment variable, You can do so with the following:

  1. launchctl setenv PATH $PATH
  2. killall Dock

If you have the NZBGet.app or SABnzbd.app already running you will need to restart them.

NOTE: If you choose not to use the launchctl solution, remember to also set the PATH for ffmpeg, ffprobe and jq in either the NZBGet webui or mp4.conf for SABnzbd

Usage

Example commands

  1. ./mp4.sh -i /path/to/process
  2. ./mp4.sh -v -i /path/to/process -c /path/to/config
  3. ./mp4.sh -v -i /path/to/process --video-codec=hevc --dual-audio=true --normalize=true

Docker

Example Docker commands

  1. docker run -it --rm \
  2. -v /path/to/process:/input \
  3. ghcr.io/digiex/mp4:latest -i /input
  1. docker create \
  2. --name nzbget \
  3. -p 6789:6789 \
  4. -e PUID=1000 \
  5. -e PGID=1000 \
  6. -e TZ=America/New_York \
  7. -v /path/to/appdata:/config \
  8. -v /path/to/downloads:/downloads \
  9. ghcr.io/digiex/nzbget:latest
  1. docker create \
  2. --name sabnzbd \
  3. -p 8080:8080 \
  4. -e PUID=1000 \
  5. -e PGID=1000 \
  6. -e TZ=America/New_York \
  7. -v /path/to/appdata:/config \
  8. -v /path/to/downloads:/downloads \
  9. ghcr.io/digiex/sabnzbd:latest

Docker Compose

Examples for docker-compose

  1. nzbget:
  2. image: ghcr.io/digiex/nzbget:latest
  3. container_name: nzbget
  4. environment:
  5. - PUID=1000
  6. - PGID=1000
  7. - TZ=America/New_York
  8. - UMASK_SET=022
  9. volumes:
  10. - /path/to/appdata:/config
  11. - /path/to/downloads:/downloads
  12. ports:
  13. - 6789:6789
  14. restart: unless-stopped
  1. sabnzbd:
  2. image: ghcr.io/digiex/sabnzbd:latest
  3. container_name: sabnzbd
  4. environment:
  5. - PUID=1000
  6. - PGID=1000
  7. - TZ=America/New_York
  8. - UMASK_SET=022
  9. volumes:
  10. - /path/to/appdata:/config
  11. - /path/to/downloads:/downloads
  12. ports:
  13. - 8080:8080
  14. restart: unless-stopped

Configuration

Running the script once ./mp4.sh will create a mp4.conf file, You may edit
these settings to your liking. You can also specify a location to this
file (if one already exists) by using -c /path/to/mp4.conf or --config=/path/to/mp4.conf.

This project makes use of the following:

Useful links:

Enjoy