Transcoding is the process of converting media from one format to another. Madsonic'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:\madsonic\transcode
Linux /var/madsonic/transcode
Mac /Library/Application Support/Madsonic/transcode
Note that two transcoders can be chained together. Madsonic comes pre-installed with ffmpeg which supports a huge range of audio and video formats.
The recommended settings for audio transcoding is:
mp3 audio ffmpeg -i %s -map 0:0 -b:a %mbk -v 0 -f mp3 -
The recommended settings for video transcoding is:
flv 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 -ar 44100 -v 0 -f mp3 -
The recommended HTTP Live Streaming (HLS) command is:
ffmpeg -ss %o -t %d -i %s -s %wx%h -v 0 -b:v %bk -maxrate %bk -bufsize 256k -flags -global_header -map 0:v:0 -map 0:%k -ac 2 -f mpegts -c:v libx264 -preset superfast -c:a aac -b:a 96k -strict -2 -threads 0 -copyts -
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.
The recommended settings for audio transcoding is:
mp3 audio ffmpeg -i %s -map 0:a:0 -b:a %mbk -v 0 -f mp3 -
The recommended downsample command is:
ffmpeg -i %s -map 0:a:0 -b:a %mbk -v 0 -f mp3 -
The recommended HTTP Live Streaming (HLS) command is:
ffmpeg -ss %o -t %d -i %s -s %wx%h -v 0 -b:v %bk -maxrate %mbk -bufsize 256k -flags -global_header -map 0:v:0 -map 0:%k -ac 2 -f mpegts -c:v libx264 -preset superfast -c:a aac -b:a 96k -strict -2 -threads 4 -copyts -
Note that %s
is substituted with the path of the original file at run-time, and %mb
is substituted with
the max bitrate of the player.
%t
, %a
and %l
are substituted with the song's title, artist and album.
You can add your own custom transcoder given that it fulfills the following requirements:
%s
with the path of the given music file.%t
with the title of the given music file.%l
with the album name of the given music file.%a
with the artist name of the given music file.%f
with the file name of the given file.%mb
with the max bitrate. (only with Madsonic 6.3.x)%b
with the -10% calculated bitrate of the max bitrate.%o
with the video time offset (used for scrubbing).%d
with the video duration (used for HLS).%w
with the video image width.%h
with the video image height.%z
with the stream link (used for HDRUN).c:\madsonic\transcode
(or /var/madsonic/transcode
)?