Skip to content

Commit

Permalink
Change to libx265 codec + add compress feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jaymoulin committed Mar 21, 2024
1 parent 20399ff commit 7dc1d36
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
> [!IMPORTANT]
> As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support my work.
> [!NOTICE]
> (This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)
> [!NOTICE]
> THIS REPOSITORY IS AUTO-UPDATED BY [GITHUB-RELEASE-NOTIFIER](https://github.com/femtopixel/github-release-notifier) (https://github.com/femtopixel/github-release-notifier)
![logo](https://github.com/jaymoulin/docker-rpi-plex-video-converter/raw/master/logo.png)

Raspberry PI - Plex Video converter - Docker Image
Expand All @@ -9,17 +18,14 @@ Raspberry PI - Plex Video converter - Docker Image
[![Buy me a coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png "Buy me a coffee")](https://www.buymeacoffee.com/jaymoulin)
[![Buy me a coffee](https://ko-fi.com/img/githubbutton_sm.svg "Buy me a coffee")](https://www.ko-fi.com/jaymoulin)

DISCLAIMER: As-of 2021, this product does not have a free support team anymore. If you want this product to be maintained, please support on Patreon.

(This product is available under a free and permissive license, but needs financial support to sustain its continued improvements. In addition to maintenance and stability there are many desirable features yet to be added.)

THIS REPOSITORY IS AUTO-UPDATED BY [GITHUB-RELEASE-NOTIFIER](https://github.com/femtopixel/github-release-notifier) (https://github.com/femtopixel/github-release-notifier)

This image purpose is to convert unsupported video files by Plex for Raspberry to mp4 which is supported.

Just run the container to convert all videos files to convert recursively on your `media` volume :
Please note that this package is also hosted on Github Container Registry, just add `ghcr.io/` before the image name (`docker pull ghcr.io/jaymoulin/rpi-plex-video-converter` instead of `jaymoulin/rpi-plex-video-converter`)

> [!NOTICE]
> 0.7.0 update : you can add a `compress=28` environment variable to compress all .mp4 files in the media path. The higher the number, the less the compression
```
docker run --rm -t -v /path/to/your/media/folder:/media jaymoulin/rpi-plex-video-converter
```
Expand Down
12 changes: 10 additions & 2 deletions convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ for f in **/*.{avi,ogm,wmv,AVI,OGM,WMV,flv,FLV,mkv,MKV,mov,MOV,m4v,M4V}; do
printf '\033[1;34;40m'
echo "Converting $f"
printf '\033[0m'
ffmpeg -i "$f" -strict experimental -c:v libx264 "${f:0:-4}.mp4" && rm "$f"
ffmpeg -i "$f" -strict experimental -c:v libx265 "${f:0:-4}.mp4" && rm "$f"
done
for f in **/*.{divx,DIVX,webm,WEBM}; do
printf '\033[1;34;40m'
echo "Converting $f"
printf '\033[0m'
ffmpeg -i "$f" -strict experimental -c:v libx264 "${f:0:-5}.mp4" && rm "$f"
ffmpeg -i "$f" -strict experimental -c:v libx265 "${f:0:-5}.mp4" && rm "$f"
done
if [[ ! -z "$compress" ]]; then
for f in **/*.{mp4,MP4}; do
printf '\033[1;34;40m'
echo "Compressing $f"
printf '\033[0m'
ffmpeg -i "$f" -vcodec libx265 -crf $compress "${f:0:-4}-compressed.mp4" && rm "$f"
done
fi

0 comments on commit 7dc1d36

Please sign in to comment.