Transcoding

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:

Windows  c:\subsonic\transcode
Mac  /Library/Application Support/Subsonic/transcode
Linux  /var/subsonic/transcode

Note that two transcoders can be chained together. Subsonic comes pre-installed with ffmpeg which supports a huge range of audio and video formats.

Recommended configuration

The recommended settings for audio transcoding is:

Step 1  ffmpeg -i %s -ab %bk -v 0 -f mp3 -

The recommended settings for video transcoding is:

Step 1  ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast -threads 0 -

The recommended downsample command is:

ffmpeg -i %s -ab %bk -v 0 -f mp3 -

The recommended HTTP Live Streaming (HLS) command is:

ffmpeg -ss %o -t %d -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f mpegts -vcodec libx264 -preset superfast -acodec 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.

Troubleshooting

  • 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.