>
> As I convert to Liquidsoap 2.0.0, I might be losing metadata through an
> FFmpeg filter.
> ...
> Am I losing it because the conversion to 'raw' discards the metadata,
> leaving only the audio?
>
This workaround is doing the job -- but is it correct?
I define a little function to read metadata before the audio is sent
through ffmpeg.raw.encode.audio, and then insert that metadata directly
into the Icecast stream using icy.update_metadata
def handle_metadata(m) =
t = m["title"]
a = m["artist"]
icy.update_metadata(host="127.0.0.1", port=8000, password="[PASSWORD]",
mount="test.aac", [("title", t), ("artist", a)])
end
Then, the handle_metadata() function is called before track boundaries
disappear i.e. before any crossfade function.
radio.on_track(handle_metadata)
Importantly, in the output.icecast call, I switch icy_metadata="false"
because otherwise the "title" string changes to "Unknown" sometimes. Don't
know why.
Now, what I'd really like to do is delay the metadata by a few seconds
because the audio processing involves a 15-second gain detection window.
But that's next.
JW
>
> Here is the audio processor, followed by a wrapper using the
> ffmpeg.raw.encode.audio function to enter the processing, and the
> ffmpeg.raw.decode.audio function to leave the processing.
>
> def audio_process(s) =
> def mkfilter(graph) =
> s = ffmpeg.filter.audio.input(graph, s)
> s = ffmpeg.filter.dynaudnorm(graph, s, gausssize=25, correctdc=true,
> altboundary=true, maxgain=12., targetrms=1.)
> s = ffmpeg.filter.aresample(graph, s, sample_rate=192000)
> s = ffmpeg.filter.alimiter(graph, s, limit=0.95, attack=5.,
> release=80., asc=true, asc_level=1.)
> s = ffmpeg.filter.aresample(graph, s, sample_rate=48000)
> ffmpeg.filter.audio.output(graph, s)
> end
> ffmpeg.filter.create(mkfilter)
> end
>
> def audio_process_wrap(s) =
> a = ffmpeg.raw.encode.audio(%ffmpeg(%audio.raw), s)
> a = audio_process(a)
> ffmpeg.raw.decode.audio(a)
> end
>
> with best wishes,
> John
>
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users