tweaking docs
This commit is contained in:
+2
-2
@@ -34,8 +34,8 @@ MEDIA_GLOB=*.mp3,*.flac,*.m4a
|
||||
|
||||
# If defined, transcode media before streaming it, and cache it to disk. The
|
||||
# strings INFILE and OUTFILE will be replaced with the media source file and
|
||||
# the cached output location, respectively.
|
||||
#
|
||||
# the cached output location, respectively. The default below uses ffmpeg to
|
||||
# transcode to webm with a reasonable trade-off between file size and quality.
|
||||
TRANSCODER=/usr/bin/ffmpeg -i INFILE -c:v libvpx-vp9 -crf 30 -b:v 0 -b:a 256k -c:a libopus OUTFILE
|
||||
|
||||
# where to cache transcoded media files
|
||||
|
||||
@@ -18,8 +18,6 @@ from rich.progress import (
|
||||
|
||||
import groove.path
|
||||
|
||||
from groove.exceptions import ConfigurationError
|
||||
|
||||
|
||||
@rich.repr.auto(angular=True)
|
||||
class Transcoder:
|
||||
@@ -48,7 +46,8 @@ class Transcoder:
|
||||
count = len(sources)
|
||||
|
||||
if not os.environ.get('TRANSCODER', None):
|
||||
raise ConfigurationError("Cannot transcode tracks without a TRANSCODR defined in your environment.")
|
||||
self.console.error("Cannot transcode tracks without a TRANSCODER defined in your environment.")
|
||||
return
|
||||
|
||||
cache = groove.path.cache_root()
|
||||
if not cache.exists():
|
||||
|
||||
@@ -97,7 +97,9 @@ class InteractiveShell(BasePrompt):
|
||||
Groove on Demand will stream audio to web clients in the native format of your source media files, but for maximum
|
||||
portability, performance, and interoperability with reverse proxies, it's a good idea to transcode to .webm first.
|
||||
Use the [b]transcode[/b] command to cache transcoded copies of every track currently in a playlist that isn't
|
||||
already in .webm format. Existing cache entries will be skipped. See also [b]cache[/b].
|
||||
already in .webm format. Existing cache entries will be skipped.
|
||||
|
||||
The default Groove on Demand configuration uses ffmpeg; try [b]groove setup[/b] from the command-line.
|
||||
|
||||
[title]USAGE[/title]
|
||||
|
||||
|
||||
@@ -78,8 +78,10 @@ def serve_track(request, track_id, db):
|
||||
except (NoResultFound, MultipleResultsFound):
|
||||
return HTTPResponse(status=404, body="Not found")
|
||||
|
||||
path = groove.path.media(track['relpath'])
|
||||
logging.debug(f"Service track {path.name} from {path.parent}")
|
||||
path = groove.path.transcoded_media(track['relpath'])
|
||||
if not path.exists():
|
||||
path = groove.path.media(track['relpath'])
|
||||
logging.debug(f"Serving track {path.name}")
|
||||
return static_file(path.name, root=path.parent)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user