Transcoding is the process of converting media from one format to another. Subsonic's transcoding engine allows for streaming of media that would normally not be streamable, for instance lossless formats. The transcoding is performed on-the-fly and doesn't require any disk usage.
The actual transcoding is done by third-party command line programs which are installed in:
Note that two transcoders can be chained together. Subsonic comes pre-installed with ffmpeg which supports a huge range of audio and video formats.
The recommended settings for audio and video transcoding are:
|mp3 audio||ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -|
|flv/h364 video||ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -c:v libx264 -preset superfast -threads 0 -|
|mkv video||ffmpeg -ss %o -i %s -c:v libx264 -preset superfast -b:v %bk -c:a libvorbis -f matroska -threads 0 -|
The recommended downsample command is:
|ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -|
The recommended HTTP Live Streaming (HLS) command is:
|ffmpeg -ss %o -t %d -i %s -async 1 -b:v %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -c:v libx264 -preset superfast -c:a libmp3lame -threads 0 -|
Note that "%s" is substituted with the path of the original file at run-time, and "%b" is substituted with the max bitrate of the player. "%t", "%a" and "%l" are substituted with the song's title, artist and album.
Adding custom transcoders
You can add your own custom transcoder given that it fulfills the following requirements:
- It must have a command line interface.
- It must be able to send output to stdout.
- If used in transcoding step 2 it must be able to read input from stdin.
- Is the transcoder installed in c:\subsonic\transcode (or /var/subsonic/transcode)?
- Is the transcoder activated for your player (in Settings > Players)?
- Is the proper file extension added to the list of recognized file types (in Settings > General)?
- If it still doesn't work, please check the Subsonic log.