Commit graph

251 commits

Author SHA1 Message Date
markv9401
7e16cb8d65
Update rffmpeg.py
Fixed absent '-hwaccels' special parameter
2020-11-20 20:39:34 +01:00
Joshua M. Boniface
b5ea20e079 Clean up properly on unclean termination 2020-11-20 12:04:31 -05:00
Joshua M. Boniface
a74806722a Include square brackets in quote handler 2020-08-16 20:13:45 -04:00
Joshua M. Boniface
e5f351f5b4 Correct typo in command path 2020-08-12 09:28:22 -04:00
Joshua M. Boniface
dcd08f6713 Support independent fallback commands
Allow specifying separate fallback commands. Not required, and will use
the main commands if not specified.

Closes #2
2020-08-11 23:23:27 -04:00
Joshua M. Boniface
a0cda2755e
Merge pull request #1 from mothlyme/master
Fix a bug where pipe symbols break execution
2020-08-11 23:15:26 -04:00
Joshua M. Boniface
18b7acf562 Fix ordering of statefile and its removal 2020-08-11 20:24:07 -04:00
Joshua M. Boniface
d61a6c5bf3 Clean up filenotfound error and log retcode 2020-08-11 20:20:38 -04:00
52462
9bd28ea079 Fix a bug where pipe symbols break execution
When a pipe symbol is introduced in any ffmpeg flag bash tries to pipe
the output to the second half of the command instead of passing it to
ffmpeg. Therefore it is necessary to escape
2020-07-11 01:42:24 +02:00
Joshua M. Boniface
bd277855e8 Mention hardware accel in local fallback 2020-06-30 18:35:51 -04:00
Joshua M. Boniface
4cc50686ea Add local fallback mode
Fall back to using the local ffmpeg binary (at the same path as the
remote system) if we are unable to reach a remote server. Prevents
rffmpeg from getting stuck if it can find no valid remote servers.
2020-06-30 18:16:39 -04:00
Joshua M. Boniface
1e51fccba4 Refactor rffmpeg to support bad host checking
Allow rffmpeg to determine if a host is "bad", i.e. if the SSH
connection times out or fails, for instance due to an unreachable host
down for maintenance. In such a case, instead of exiting abruptly, we
will mark the host as "bad" in the current state file, and then retry
the whole process, skipping the bad hosts. If other rffmpeg processes
start while the current one is still running, they will also treat the
host as "bad", until the original process ends at which point the
statefile marking it bad will be removed and it will be retried by
future processes. This helps ensure that redundancy of transcode hosts
can actually be achieved, as before if the first host was down, the
process would simply fail, retry, and then fail again if the down host
was first in the list.

This required some major refactoring of the code, including
functionalizing various elements of the process as well as adding an
infinite loop to the main execution in order to keep looping through
hosts after marking one as bad.
2020-06-30 15:22:06 -04:00
Joshua M. Boniface
ded1d6304a Mention redundancy in README 2020-06-30 14:29:59 -04:00
Joshua M. Boniface
28b72c922a Add connection timeout to SSH command 2020-06-30 13:28:09 -04:00
Joshua M. Boniface
809e900588 Fix bad step reference 2020-06-30 12:58:39 -04:00
Joshua M. Boniface
47ac42c45a Remove reference to transcode directory 2020-06-30 12:57:47 -04:00
Joshua M. Boniface
775d2009c4 Mention unrecommended full-network export ACLs 2020-06-30 12:55:51 -04:00
Joshua M. Boniface
b341305ff1 Move Docker caveat up 2020-06-30 12:53:39 -04:00
Joshua M. Boniface
37db1e7a60 Update README to reflect full data path
Without the full path, various alternative uses of ffmpeg (e.g. subtitle
extraction, image extraction) were not working. Recommend exporting the
entire Jellyfin data directory instead and make note that changing path
locations may alter this. Also includes some other tweaks to make this
work (e.g. putting the ssh public key step earlier in the NFS export).
2020-06-30 12:50:49 -04:00
Joshua M. Boniface
4285b9c380 Fix bad path to ffprobe 2020-06-04 12:09:44 -04:00
Joshua M. Boniface
bc14cdf2bd Add LICENSE file 2020-06-04 12:09:44 -04:00
Joshua M. Boniface
34a47c07bd
Use BaseLoader for YAML configuration file 2020-03-24 09:33:42 -04:00
Joshua M. Boniface
e58df24e7f Use consistent logger function naming 2020-02-26 18:26:00 -05:00
Joshua M. Boniface
fe91730d56 Fix typo in error output 2020-02-26 16:35:09 -05:00
Joshua M. Boniface
72a1da23a7 Clean up handling of stdout/stderr/stdin 2020-02-23 23:56:24 -05:00
Joshua M. Boniface
e431c4072b Remove the SSH pseudoterminal
This caused some issues with ffprobe if the remote command ever sends
something to stderr (which then gets sent to stdout locally, causing
format issues).

However, from some testing, this was original though needed to ensure
the 'q' sent to FFmpeg was sent directly over the pipe, but this seems
to not be required (any longer?).
2020-02-23 23:54:12 -05:00
Joshua M. Boniface
f83ab6de74 Major revamp fixing some bugs
From top to bottom:
1. Use dict comprehension instead of try/catch
2. Never output anything to stdout; this breaks Jellyfin's parsing
3. Print more helpful debug messages including PID
4. Fix broken handling of full command paths vs. basenames
5. Use stdout=stdout for ffprobe
6. Only quote arguments that need it (bad shell chars)
2020-02-08 03:22:18 -05:00
Joshua M. Boniface
d664e8c766 Include encoders/decoders strings in stdout fix 2020-02-08 02:19:04 -05:00
Joshua M. Boniface
6a62ae4c83 Revert "Remove bad workaround with stdout"
This reverts commit 750461620e.
2020-02-08 02:17:14 -05:00
Joshua M. Boniface
750461620e Remove bad workaround with stdout
Not needed and breaks encoding parameter selection.
2020-02-08 02:07:15 -05:00
Joshua M. Boniface
48b9741af5 Update README with new setup information 2020-02-08 00:35:43 -05:00
Joshua M. Boniface
022334e1e9 Fix stdout/stderr when running -version 2020-02-05 20:16:09 -05:00
Joshua Boniface
e88f6f5bdc Add nice output code message 2019-11-13 11:35:11 -05:00
Joshua Boniface
487e18edf1 Add file logging support 2019-11-13 11:14:53 -05:00
Joshua Boniface
6751b41e6a Debug to stdout instead of stderr
The output of this script is backwards, since Jellyfin captures the
stderr for its own processing instead of the stdout.
2019-11-13 11:03:51 -05:00
Joshua Boniface
bb3ad49db0 Mention NFS tuning options 2019-11-02 17:47:04 -04:00
Joshua Boniface
a142f48821 Set output of subprocess to stderr
Required otherwise Jellyfin doesn't pick up the output properly.
2019-11-02 16:24:47 -04:00
Joshua Boniface
9e5235a9fc Add default SSH arguments as example 2019-10-19 19:11:11 -04:00
Joshua Boniface
773c5d032c Set nicer comments and defaults 2019-10-19 19:10:03 -04:00
Joshua Boniface
7f6a519d1c Remove unneeded imports 2019-10-19 19:06:02 -04:00
Joshua Boniface
65e4bfbccc Mention UID compatibility 2019-10-19 19:01:49 -04:00
Joshua Boniface
01f1ceebba Add section on hosts selection to README 2019-10-19 18:50:03 -04:00
Joshua Boniface
df28fce595 Improve clarity in README 2019-10-19 18:43:23 -04:00
Joshua Boniface
251b6be574 Fix typo in readme 2019-10-19 18:42:08 -04:00
Joshua Boniface
d6d797622c Properly support ffprobe mode too 2019-10-19 18:33:43 -04:00
Joshua Boniface
94cebebfb5 Mention SSH key acceptance and testing command 2019-10-19 18:20:36 -04:00
Joshua Boniface
62d192a9ce Nicer comment on ffmpeg path 2019-10-19 18:18:00 -04:00
Joshua Boniface
41eb400bb0 Use proper arg layout 2019-10-19 18:15:14 -04:00
Joshua Boniface
7e03fad19f Mention dependencies 2019-10-19 18:13:00 -04:00
Joshua Boniface
f317fd6ef7 Add README 2019-10-19 18:10:05 -04:00