Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c4e4910
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.idea/ | ||
*.iml | ||
*.iws | ||
.DS_* | ||
_.* | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Handbrake on Synology Nas | ||
|
||
This project is the companion code to [this](http://ivo2u.nl/dA) blog post. | ||
|
||
It contains the code necessary to get Handbrake CLI working on your Synology NAS. | ||
|
||
## usage | ||
|
||
* Copy scripts in the bin folder to your synology ~/bin folder | ||
* make sure the ~/bin folder is part of your PATH | ||
* make sure the files are executable `chmod +x ~/bin/m4v*` | ||
* Change the `CONVERTED_FILE_LOCATION` in `m4v.sh` to point to a location on your NAS | ||
* Change directory to you have a `*.mkv` file to convert | ||
* `m4v.sh "<your movie>.mkv"` wait and see it arrive in `CONVERTED_FILE_LOCATION` | ||
|
||
Note that the first time will take longer because Docker needs to download the image | ||
of course convertion will always take quite a bit of time so you might want to start | ||
conversions from a `screen` (read about in on the internet) to be able to log off. | ||
|
||
Have fun, | ||
|
||
Ivo. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
############################################################################### | ||
# Please change the following variables to suit your needs | ||
############################################################################### | ||
|
||
# Place where the m4v files should be saved to... | ||
CONVERTED_FILE_LOCATION="/volume1/video/m4v/inbox" | ||
|
||
############################################################################### | ||
# DO NOT CHANGE CODE BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING | ||
############################################################################### | ||
SAVEIFS=$IFS | ||
IFS=$(echo -en "\n\b") | ||
mkv="$(basename $1)" | ||
map="$(dirname $1)" | ||
m4v="${mkv%.*}.m4v" | ||
m4v="$(basename $m4v)" | ||
docker run --rm \ | ||
--cpuset-cpus="1-2" \ | ||
--name handbrake \ | ||
-v "$(pwd)/$map:/input:ro" \ | ||
-v "${CONVERTED_FILE_LOCATION}:/output:rw" \ | ||
supercoder/docker-handbrake-cli:latest \ | ||
-i "/input/$mkv" \ | ||
-o "/output/$m4v" \ | ||
-e x264 -q 20.0 -r 30 --pfr -a 1 -E faac -B 160 -6 dpl2 -R Auto \ | ||
-D 0.0 --audio-copy-mask aac,ac3,dtshd,dts,mp3 --audio-fallback ffac3 \ | ||
-f mp4 -X 1280 -Y 720 --loose-anamorphic --modulus 2 -m \ | ||
--x264-preset medium --h264-profile high --h264-level 3.1 | ||
IFS=$SAVEIFS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
find . -iname "*mkv" -print0 | while read -d $'\0' file | ||
do | ||
m4v.sh "$file" | ||
test $? -gt 0 && break; | ||
done |