mirror of
https://github.com/steelbrain/ffmpeg-over-ip.git
synced 2024-10-12 01:34:56 +03:00
🆕 pathMappings -> rewrites
This commit is contained in:
@@ -17,7 +17,7 @@ The server and the client are both configured using JSONC (JSON with comments) c
|
||||
of these files can be flexible. To identify which paths are being used, you can invoke either with `--debug-print-search-paths`.
|
||||
|
||||
Template/example configuration files are provided in this repository for your convinience. Unless the server and the client
|
||||
share the same filesystem, you may have to specify `pathMappings` in the server configuration file.
|
||||
share the same filesystem, you may have to specify `rewrites` in the server configuration file.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ const configSchemaServer = z
|
||||
listenPort: z.number(),
|
||||
authSecret: z.string().min(15).max(100),
|
||||
ffmpegPath: z.string(),
|
||||
pathMappings: z.array(z.tuple([z.string(), z.string()])),
|
||||
rewrites: z.array(z.tuple([z.string(), z.string()])),
|
||||
})
|
||||
.strict()
|
||||
|
||||
@@ -100,7 +100,7 @@ export function rewriteArgsInServer(
|
||||
): string[] {
|
||||
return args.slice().map(item => {
|
||||
let arg = item
|
||||
for (const [from, to] of config.pathMappings) {
|
||||
for (const [from, to] of config.rewrites) {
|
||||
arg = arg.replace(from, to)
|
||||
}
|
||||
return arg
|
||||
|
||||
@@ -22,10 +22,12 @@
|
||||
"ffmpegPath": "/usr/bin/ffmpeg", // type: string
|
||||
// ^ For windows, you may have to use slash twice because of how strings in JSON work, so C:\Windows would be "C:\\Windows" etc
|
||||
|
||||
"pathMappings": [
|
||||
"rewrites": [
|
||||
["/data/movies/", "M:\\movies\\"],
|
||||
["/data/tv/", "M:\\tv\\"],
|
||||
["/config/data/transcodes/", "N:\\transcodes\\"]
|
||||
// ^ VERY IMPORTANT! BOTH input and output MUST have trailing slashes
|
||||
["/config/data/transcodes/", "N:\\transcodes\\"],
|
||||
// ^ VERY IMPORTANT! For path rewrites BOTH input and output MUST have trailing slashes
|
||||
// You can also use rewrites to map codecs, ie:
|
||||
["libfdk_aac", "aac"]
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user