feat: transcode streams with ffmpeg
- FfmpegTranscoder with maxBitRate, format fallback to MP3 and timeOffset - direct play when no transcode is required, preserving HTTP Range support - transcoded responses are chunked audio/mpeg with process cleanup - unit tests for policy and real ffmpeg output - smoke test covers maxBitRate, timeOffset and format fallback
This commit is contained in:
1 parent
722f486c3a
commit
18a1d7cd19
9 files changed
+254
-4
No files matched your search
@@ -34,6 +34,7 @@ import win.taptap.musicmanager.scanner.CoverArtService
|
||||
import win.taptap.musicmanager.scanner.MediaScanner
|
||||
import win.taptap.musicmanager.subsonic.respondSubsonicError
|
||||
import win.taptap.musicmanager.subsonic.routes.subsonicRoutes
|
||||
import win.taptap.musicmanager.transcoding.FfmpegTranscoder
|
||||
|
||||
private val log = LoggerFactory.getLogger("win.taptap.musicmanager.Application")
|
||||
|
||||
@@ -49,6 +50,7 @@ fun main() {
|
||||
|
||||
val applicationScope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||
val coverArtService = CoverArtService(config.dataDir)
|
||||
val transcoder = FfmpegTranscoder(config.ffmpegPath)
|
||||
val scanner = MediaScanner(library, coverArtService)
|
||||
if (MediaRepository.countSongs() == 0L) {
|
||||
log.info("Song table is empty, starting initial library scan")
|
||||
@@ -95,6 +97,7 @@ fun main() {
|
||||
users = users,
|
||||
library = library,
|
||||
coverArtService = coverArtService,
|
||||
transcoder = transcoder,
|
||||
startScan = { scanner.start(applicationScope) },
|
||||
scanStatus = { scanner.status() },
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user