I am about to commit a change to the transcoding framework that enables
the ability to declare, in convert.conf, certain capabilities of each
defined transcoder. 

This is mostly in response to problems that have arisen with the
new-streaming changes but is also driven by a desire to be able to make
better use of the capabilities of transcoders. The specific
new-streaming problem is that the assumption was made that all
transcoders are capable of transcoding from stdin, with the filename
specified as "-". This is simply not true, although there are not many
exceptions (mov123 is one example). It also seems that some transcoders
do not behave well when reading from stdin – perhaps alac.

The main change is the addition of an optional -capabilities-
declaration to each transcoder specification. Here is a simple
example:

Code:
--------------------
    
  wav mp3 * *
        # IFB:{BITRATE=-B %B}
        [lame] –v $BITRATE$ $FILE$ -
  
--------------------


This declares three capabilities: *I* => can read from stdin (via "-"),
*F* => can read from a named file, *B* => can perform bitrate limiting.
In the last case an optional substitution argument is given – I hope
the syntax is self-explanatory. The list of supported capabilities and
substitutions will be specified in convert.conf.

The syntax is rather strict and the parsing somewhat primitive. The
-capabilities- line must start with whitespace-hash-whitespace and
there can be no trailing whitespace. Substitution variables must be
composed of alpha-numeric characters plus underscore (match the perl
regex "\w+"). There is no way to escape the presence of literal '}' or
'%' characters in the substitution string.

The transcoder selection algorithm has changed but is not drastically
different. It uses the concept of -required- and -desired-
capabilities. A transcoder can only be selected if it meets all the
required capabilities. After that, the first one which supports the
largest number of desired capabilities will be selected.

What capabilities are desired and required is hard-coded based on
various conditions.

There remain certain hard-coded assumptions. For example,
bitrate-limiting is only desired if the input stream exceeds the
bitrate limit for the player (any of the players in the sync-group).
This assumes that the chosen stream-format will not increase the
bitrate which may not be a valid assumption. There are lots of loose
ends like this which may need tidying up.

When the command-line is substituted, unused substitutions (\$\w+\$)
will be removed.

There is still quite a bit to do but I want to give people the
possibility to test the fundamentals. So far, I have only tested on
Linux (x86_64). I have tested various combinations of flac, lame, sox
and mplayer and have not tested alac, mppdec, mac, wvunpack, wmadec or
mov123. I also have not tested FLAC-FLAC transcoding used for
whole-album FLAC files with cue sheets. Testing of these transcoders
and on Windows and Mac platforms would be very helpful.

I hope that these changes will fix the following bugs:

'9638' (http://bugs.slimdevices.com/show_bug.cgi?id=9638): mov123 and
wmadec transcoding broken with new streaming
'8828' (http://bugs.slimdevices.com/show_bug.cgi?id=8828): FLACs with
cue sheets not working in 7.3 branch
'8858' (http://bugs.slimdevices.com/show_bug.cgi?id=8858): Can't play
.m4a files with new streaming code
'8859' (http://bugs.slimdevices.com/show_bug.cgi?id=8859): Can't play
ape files with new streaming code
'4266' (http://bugs.slimdevices.com/show_bug.cgi?id=4266): Bitrate
limiting does not work for MP3 streams

It may fix: '9794' (http://bugs.slimdevices.com/show_bug.cgi?id=9794)
ALAC transcoding introduces static at end of files, but that is only a
guess and the cause of this in not known.

People using their own custom transcoder configurations may need to
adjust their definitions.

With further work I expect this framework to fix the following:
'8327' (http://bugs.slimdevices.com/show_bug.cgi?id=8327):
Squeezecenter should downsample high-sample-rate files

and it should be possible to add seeking for some transcoded formats
for which seeking is supported by the transcoder but is not supported
in SC directly. 

This change, on its own, will break AlienBBC. I have fixes ready.

I hope to check this in later today.

Alan.


-- 
awy
------------------------------------------------------------------------
awy's Profile: http://forums.slimdevices.com/member.php?userid=7480
View this thread: http://forums.slimdevices.com/showthread.php?t=54331

_______________________________________________
beta mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/beta

Reply via email to