Can I use conditional encoder configurations ? #1915
Replies: 6 comments 16 replies
-
This is a feature that is being developed by @smimram as part of the |
Beta Was this translation helpful? Give feedback.
-
@toots Still getting errors
but it could be my script. I'll look into it further later. Thanks |
Beta Was this translation helpful? Give feedback.
-
Will do in a couple of hours. Thanks
On 17 Sep 2021 14:08, Romain Beauxis ***@***.***> wrote:
That's a very interesting idea. I think the first thing we should consider here is a pro-active operator that allows you to test compatibility and particularly with ffmpeg copy encoder without having to setup the whole streaming machinery and catching it up.
Would you mind sharing a quick example of your code so I can get an idea about how you're going at it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1915 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB627QOSXBFASUWHACC72XLUCM4T7ANCNFSM5D6CV2TA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
I'm writting this script for someone else but have there permission to share code, so I'll get a script together , i need to have a think. Thanks |
Beta Was this translation helpful? Give feedback.
-
I was looking at your script in relation to #19413 and had a couple of thoughts about how to do it with the current First, I totally understand the need to relax the typing system as @smimram is trying to do, this'll make everything much easier to write. However, it's not clear if we can do it safely or, at least, this might need some time to be implemented right. Meanwhile, here's how you can do it with the current typing system:
For 1. this means cramming everything that uses specific encoder type into a single function. For 2. this means asking yourself what you really need to do on the created source and store that instead of the source itself. Something like this: def create_source_with_encoder(encoder, params) =
s = single("/path/to/security.m4a")
....
output.icecast(encoder, s, ...)
def shutdown() =
source.shutdown(s)
end
shutdown_callbacks := [( id, shutdown), ...!shutdown_callbacks]
end
if should_encode then
create_source_with_encoder(%ffmpeg(format="adts", %audio(codec="aac"), ...), ...)
else
create_source_with_encoder(%ffmpeg(format="adts", %audio.copy, ...), ...)
end
def shutdown_source(id) =
shutdown = list.assoc(id, !shutdown_callbacks)
shutdown()
end This way, you encapsulate the type of the encoder inside Hope this makes sense! |
Beta Was this translation helpful? Give feedback.
-
Seg fault seems to be fixed, ran a 20 min test that didn't crash.
On 21 Sep 2021 14:45, Romain Beauxis ***@***.***> wrote:
Thanks.
I've tried to integrate this code with mine, but get syntax error at the end of shutdown on this line
shutdown_callbacks := (id, shutdown)::!shutdown_callbacks
To be honest I don't understand the double colon.
I have shutdown_callbacks initiated as ref([]),(i guess it is a list), id as a tuple (x,y) and shutdown as in your script.
Oh my, sorry that was me mixing OCaml and liquidsoap syntax..
I'd say we should first focus on confirming that the segfault with ffmpeg is fixed then we can play around cleaning up the script.. 🙂
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1915 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB627QJ6PEKLFG3B5DN6AFLUDCD7BANCNFSM5D6CV2TA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
While using %ffmpeg as an encoder for output.icecast with a switch, i'd like to be able to change from %audio.copy to %audio(codec="libmp3lame", samplerate="44100", bitrate="320k") depending on a switch. The switch changes the stream from input.http ( which doesn't need encoding ) to a playlist which does need encoding.
I've tried this
but get this error
at the if t then line.
I've noticed there are issues with using %ffmpeg with mksafe(s) before it, but if I remove
buffer(mksafe(s))
I get this errorat the switch line.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions