mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-31 14:33:50 -04:00
Hardcode transcoder prefix to /video
This commit is contained in:
parent
4188e7bcd3
commit
c90d0e7ffc
@ -109,8 +109,6 @@ For example, if your library is split into multiples paths you can edit the `vol
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
volumes:
|
||||
- - ${LIBRARY_ROOT}:/video:ro
|
||||
+ - /my_path/number1:/video/1:ro
|
||||
|
@ -59,8 +59,6 @@ spec:
|
||||
value: "/cache"
|
||||
- name: GOCODER_METADATA_ROOT
|
||||
value: "/metadata"
|
||||
- name: GOCODER_PREFIX
|
||||
value: "/video"
|
||||
- name: GOCODER_SAFE_PATH
|
||||
value: {{ .Values.media.baseMountPath | quote }}
|
||||
- name: POSTGRES_USER
|
||||
|
@ -7,8 +7,6 @@ x-transcoder: &transcoder-base
|
||||
restart: on-failure
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
volumes:
|
||||
- ${LIBRARY_ROOT}:/video:ro
|
||||
- ${CACHE_ROOT}:/cache
|
||||
@ -120,7 +118,6 @@ services:
|
||||
device_ids:
|
||||
- nvidia.com/gpu=all
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=nvidia
|
||||
profiles: ['nvidia']
|
||||
|
||||
@ -129,7 +126,6 @@ services:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=vaapi
|
||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||
profiles: ['vaapi']
|
||||
@ -139,7 +135,6 @@ services:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=qsv
|
||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||
profiles: ['qsv']
|
||||
|
@ -12,8 +12,6 @@ x-transcoder: &transcoder-base
|
||||
cpus: 1
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
volumes:
|
||||
- ${LIBRARY_ROOT}:/video:ro
|
||||
- ${CACHE_ROOT}:/cache
|
||||
@ -147,7 +145,6 @@ services:
|
||||
device_ids:
|
||||
- nvidia.com/gpu=all
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=nvidia
|
||||
profiles: ['nvidia']
|
||||
transcoder-vaapi:
|
||||
@ -155,7 +152,6 @@ services:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=vaapi
|
||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||
profiles: ['vaapi']
|
||||
@ -165,7 +161,6 @@ services:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=qsv
|
||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||
profiles: ['qsv']
|
||||
|
@ -7,8 +7,6 @@ x-transcoder: &transcoder-base
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
volumes:
|
||||
- ${LIBRARY_ROOT}:/video:ro
|
||||
- ${CACHE_ROOT}:/cache
|
||||
@ -105,7 +103,6 @@ services:
|
||||
device_ids:
|
||||
- nvidia.com/gpu=all
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=nvidia
|
||||
profiles: ['nvidia']
|
||||
|
||||
@ -114,7 +111,6 @@ services:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=vaapi
|
||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||
profiles: ['vaapi']
|
||||
@ -124,7 +120,6 @@ services:
|
||||
devices:
|
||||
- /dev/dri:/dev/dri
|
||||
environment:
|
||||
- GOCODER_PREFIX=/video
|
||||
- GOCODER_HWACCEL=qsv
|
||||
- GOCODER_VAAPI_RENDERER=${GOCODER_VAAPI_RENDERER:-/dev/dri/renderD128}
|
||||
profiles: ['qsv']
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
# where to store temporary transcoded files
|
||||
GOCODER_CACHE_ROOT="/cache"
|
||||
# path prefix needed to reach the http endpoint
|
||||
GOCODER_PREFIX=""
|
||||
# base absolute path that contains video files (everything in this directory can be served)
|
||||
GOCODER_SAFE_PATH="/video"
|
||||
# hardware acceleration profile (valid values: disabled, vaapi, qsv, nvidia)
|
||||
|
@ -383,7 +383,7 @@ func run(e *echo.Echo) (err error) {
|
||||
metadata: metadata,
|
||||
}
|
||||
|
||||
g := e.Group(src.Settings.RoutePrefix)
|
||||
g := e.Group("/video")
|
||||
g.GET("/:path/direct", DirectStream)
|
||||
g.GET("/:path/direct/:identifier", DirectStream)
|
||||
g.GET("/:path/master.m3u8", h.GetMaster)
|
||||
|
@ -285,7 +285,7 @@ func RetriveMediaInfo(path string, sha string) (*MediaInfo, error) {
|
||||
extension := OrNull(SubtitleExtensions[stream.CodecName])
|
||||
var link string
|
||||
if extension != nil {
|
||||
link = fmt.Sprintf("%s/%s/subtitle/%d.%s", Settings.RoutePrefix, base64.RawURLEncoding.EncodeToString([]byte(path)), i, *extension)
|
||||
link = fmt.Sprintf("video/%s/subtitle/%d.%s", base64.RawURLEncoding.EncodeToString([]byte(path)), i, *extension)
|
||||
}
|
||||
lang, _ := language.Parse(stream.Tags.Language)
|
||||
idx := uint32(i)
|
||||
@ -312,7 +312,7 @@ func RetriveMediaInfo(path string, sha string) (*MediaInfo, error) {
|
||||
}),
|
||||
Fonts: MapStream(mi.Streams, ffprobe.StreamAttachment, func(stream *ffprobe.Stream, i uint32) string {
|
||||
font, _ := stream.TagList.GetString("filename")
|
||||
return fmt.Sprintf("%s/%s/attachment/%s", Settings.RoutePrefix, base64.RawURLEncoding.EncodeToString([]byte(path)), font)
|
||||
return fmt.Sprintf("video/%s/attachment/%s", base64.RawURLEncoding.EncodeToString([]byte(path)), font)
|
||||
}),
|
||||
}
|
||||
var codecs []string
|
||||
|
@ -256,8 +256,7 @@ func (s *MetadataService) getMetadata(path string, sha string) (*MediaInfo, erro
|
||||
}
|
||||
if s.Extension != nil {
|
||||
link := fmt.Sprintf(
|
||||
"%s/%s/subtitle/%d.%s",
|
||||
Settings.RoutePrefix,
|
||||
"video/%s/subtitle/%d.%s",
|
||||
base64.RawURLEncoding.EncodeToString([]byte(ret.Path)),
|
||||
*s.Index,
|
||||
*s.Extension,
|
||||
|
@ -15,7 +15,6 @@ func GetEnvOr(env string, def string) string {
|
||||
|
||||
type SettingsT struct {
|
||||
Outpath string
|
||||
RoutePrefix string
|
||||
SafePath string
|
||||
HwAccel HwAccelT
|
||||
}
|
||||
@ -31,7 +30,6 @@ type HwAccelT struct {
|
||||
var Settings = SettingsT{
|
||||
// we manually add a folder to make sure we do not delete user data.
|
||||
Outpath: path.Join(GetEnvOr("GOCODER_CACHE_ROOT", "/cache"), "kyoo_cache"),
|
||||
RoutePrefix: GetEnvOr("GOCODER_PREFIX", ""),
|
||||
SafePath: GetEnvOr("GOCODER_SAFE_PATH", "/video"),
|
||||
HwAccel: DetectHardwareAccel(),
|
||||
}
|
||||
|
@ -31,8 +31,7 @@ outer:
|
||||
for codec, ext := range SubtitleExtensions {
|
||||
if strings.HasSuffix(match, ext) {
|
||||
link := fmt.Sprintf(
|
||||
"%s/%s/direct/%s",
|
||||
Settings.RoutePrefix,
|
||||
"video/%s/direct/%s",
|
||||
base64.RawURLEncoding.EncodeToString([]byte(match)),
|
||||
filepath.Base(match),
|
||||
)
|
||||
|
@ -145,10 +145,9 @@ func (s *MetadataService) extractThumbnail(ctx context.Context, path string, sha
|
||||
timestamps := ts
|
||||
ts += interval
|
||||
vtt += fmt.Sprintf(
|
||||
"%s --> %s\n%s/%s/thumbnails.png#xywh=%d,%d,%d,%d\n\n",
|
||||
"%s --> %s\nvideo/%s/thumbnails.png#xywh=%d,%d,%d,%d\n\n",
|
||||
tsToVttTime(timestamps),
|
||||
tsToVttTime(ts),
|
||||
Settings.RoutePrefix,
|
||||
base64.RawURLEncoding.EncodeToString([]byte(path)),
|
||||
x,
|
||||
y,
|
||||
|
Loading…
x
Reference in New Issue
Block a user