Post Reply 
Converting flac audio streams for internet radio use
15-03-2023, 19:35
Post: #11
RE: Converting flac audio streams for internet radio use
(15-03-2023 17:19)simoncn Wrote:  Native FLAC is problematical for radio streams because it starts with a header block saying how many audio samples are to follow. If this is set to zero, many renderers will refuse to play the stream.

Despite this... is it possible to turn an ogg/flac stream into a native flac stream using minimstreamer? Similarly to how an HLS/aac stream can be made a straight aac stream?
Find all posts by this user
Quote this message in a reply
15-03-2023, 21:01
Post: #12
RE: Converting flac audio streams for internet radio use
No, this isn't possible. It wouldn't be useful because very few renderers would be able to play it. Transcoding losslessly to WAV is much more useful.
Find all posts by this user
Quote this message in a reply
15-03-2023, 21:22 (This post was last modified: 06-04-2023 14:15 by FakePlasticDunk.)
Post: #13
RE: Converting flac audio streams for internet radio use
Fair enough. I've been trying to see if I can persuade my player - Cambridge Audio NP30 - to play flac streams, as has been claimed it can. So far I've tried Radio Paradise's flac url without any minimserver intervention, then using a playlist entry to say that it's ogg (as above), then adding a transcode of ogg:wav, all to no avail. CA claim it can play internet radio streams in any of the formats in which it can play audio files, which includes flac, ogg, wav, and aac, but this clearly isn't true. I have challenged them on this, but not heard back from them yet. I know they won't change anything now, it's a 'legacy' player, but I'm hoping they can at least give me an accurate statement of what it really can and can't do.
Find all posts by this user
Quote this message in a reply
15-03-2023, 22:30
Post: #14
RE: Converting flac audio streams for internet radio use
PM sent.
Find all posts by this user
Quote this message in a reply
16-03-2023, 17:50 (This post was last modified: 16-03-2023 18:00 by simoncn.)
Post: #15
RE: Converting flac audio streams for internet radio use
If your renderer can't play Ogg/FLAC streams transcoded to WAV using *:wav, try setting *:wav-2GB or *:wav-0KB in stream.transcode instead of *:wav. These settings cause different lengths to be sent in the WAV header. They are described in this section.

Another option is to set stream.transcode to *:L16. This is a lossless format without a length header and should be supported by most renderers.
Find all posts by this user
Quote this message in a reply
16-03-2023, 19:05 (This post was last modified: 06-04-2023 14:16 by FakePlasticDunk.)
Post: #16
RE: Converting flac audio streams for internet radio use
OK, thanks, I'll give all those a go - previous attempts to get the NP30 to play streams transcoded to WAV with *:wav yielded the infamous message in the log "byte-range request could not be satisfied'".
Find all posts by this user
Quote this message in a reply
16-03-2023, 19:11
Post: #17
RE: Converting flac audio streams for internet radio use
(16-03-2023 17:50)simoncn Wrote:  If your renderer can't play Ogg/FLAC streams transcoded to WAV using *:wav, try setting *:wav-2GB or *:wav-0KB in stream.transcode instead of *:wav. These settings cause different lengths to be sent in the WAV header. They are described in this section.

Another option is to set stream.transcode to *:L16. This is a lossless format without a length header and should be supported by most renderers.

OK, sadly all those failed on the NP30 with messages in the minimserver log each time saying "NetworkSource: byte-range request could not be satisfied'"
Find all posts by this user
Quote this message in a reply
16-03-2023, 19:30 (This post was last modified: 06-04-2023 14:16 by FakePlasticDunk.)
Post: #18
RE: Converting flac audio streams for internet radio use
What I said above isn't quite right. I started off trying all those *:<code> options and tried playing the BBC MPEG-DASH streams, and that's what yielded the byte-range request messages. When I tried *:mp3;320k that also yielded a byte-range request message, which seems odd. When I went back to what I had originally, which was aac:mp3;320k, all worked fine.

So then I tried the Radio Paradise ogg/flac stream
http://stream.radioparadise.com/flac
with ogg specified in the #EXTINF line, and went through all the *:<code> options, and ogg:<code> just for good measure. None of these generated byte-range request messages, but none of them played either.
Find all posts by this user
Quote this message in a reply
17-03-2023, 11:01 (This post was last modified: 17-03-2023 11:04 by simoncn.)
Post: #19
RE: Converting flac audio streams for internet radio use
There are a number of variables that can affect whether or not a renderer will play a transcoded radio stream, as follows:

1) The MIME type sent for the transcoded stream on the HTTP streaming response
2) The MIME type (if any) sent by the server and control point to the renderer before the renderer sends the HTTP request
3) The file extension (if any) of the stream URL sent by the server and control point to the renderer before the renderer sends the HTTP request
4) The content length (if any) sent for the transcoded stream in the Content-Length HTTP header of the HTTP streaming response
5) The length (if any) sent for the transcoded stream in the header block of the HTTP stream (only applies for formats such as WAV and FLAC that have a header block with a length field)

For the test native FLAC streams that I provided via PM, the length 5) was zero but the length 4) was not zero. A real radio stream would have a length of zero for both 4) and 5), so the test you did doesn't necessarily mean that the NP30 would be able to play a real native FLAC stream with zero for both 4) and 5).

Your tests with Radio Paradise would not have produced a valid result because the MIME type 1) used by Radio Paradise is application/ogg and the ogg MIME type used by MinimStreamer stream.transcode (for local files in Ogg/Vorbis format) is audio/ogg. For a valid test, you need to remove ogg from the EXTINF line, then do a rescan and use *:wav-2GB or *:wav-0KB in stream.transcode.

For *:wav-2GB, the transcoded WAV stream will have 2GB-1 for length 5) and nothing for length 4). For *:wav-0KB, the transcoded WAV stream will have zero for length 5) and nothing for length 4). For *:L16, length 5) does not apply and there will be nothing for length 4).

Please try the above and let me know what happens.
Find all posts by this user
Quote this message in a reply
24-03-2023, 16:04 (This post was last modified: 06-04-2023 14:08 by FakePlasticDunk.)
Post: #20
RE: Converting flac audio streams for internet radio use
OK, I've tried the Radio Paradise flac stream URL with ogg removed from the EXTINF line, the two *:wav transcodes, and the *:L16 transcode, and the NP30 just hangs for all of them.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)