-
-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input.http.set_url(...) -> Decoding failed: File "src/core/io/ffmpeg_io.ml", line 102, characters 8-14: Assertion failed #3338
Comments
Thanks for reporting. I'm looking at it right now. Due to the tricky nature of these asynchronous mechanisms, it's possible the fix will have to be for |
Hi, I just tested on this version: Liquidsoap 2.2.5+git@0122d0b and it is still there. This is more or less the same script but nicer :-)
It is in
|
Can you think of any temporary workaround? Like would it matter if I used an external decoder or something like that? |
I tried to wait for status "stopped" in a while loop before changing url and starting it again. It works a little better but I still get the same result sooner or later. Or the status never gets from "stopping" to "stopped". |
I added a rewrite of the operator's restart logic in Any chance you could test there to see if the issue is fixed for you? |
I would love to do that, but I have nerver successfully compiled from source. But maybe I never found the "right" instructions. :-) |
How do you install it otherwise? |
I apt install the latest deb package. |
Ok. you can find debian packages on each github action build. As of now, the latest Please note that If you're interested to be an early tester, tho, we should be able to give quick feedback and fixes on this branch. |
Hi @toots, Version: 2.3+git@485d746
I saw the following errors:
|
Thank you I did not know about that builder action for every commit. Very nice! I see that you exerianced som trouble too. I did not have time to test alot but… In my test script it only logs the asertion fail once. So I added output.icecast… and that disconnects after the first url change and never comes back. I will test this version more on monday. Just an additional question: Would it be possible to completely realocate the source every time I change url without loosing referenses to other parts of the script? |
Hi @oskarburman, s1 = input.http("http://icecast/m1")
s2 = input.http("http://icecast/m2")
# t = rotate([s1, s2])
t = switch([
({f(s1)}, s1),
({f(s2)}, s2)
])
output.icecast(enc, s, mount="m3", host="icecast", fallible=true) |
The switching would probably work well, but IP addresses can change and can be added. I also don't want to stream anything else than the current stream. That is to save bandwidth and for the sender to be able to tell if they are online by monitoring icecast connections. |
Thanks for the test @vitoyucepi! Could you try with #3891 ? You won't need the explicit |
@toots,
Is it possible to make Build config
|
I think that you need to add a This seems to work here:
|
@oskarburman,
Nah, that didn't work.
And what about these errors?
Scriptenc = %ffmpeg(format="mp3", %audio(codec="libmp3lame"))
output.icecast(enc, sine(220.), mount="m1", host="icecast", id="output_m1")
output.icecast(enc, sine(880.), mount="m2", host="icecast", id="output_m2")
urls=["http://icecast:8000/m1", "http://icecast:8000/m2"]
index = ref(0)
s = input.http("", id="http_input")
def change_source()
url = list.nth(urls, index())
index := (index() + 1) mod 2
log.important("switching to #{url}", label="change_source")
s.set_url(url)
end
thread.run(change_source, every=20.)
# s = buffer(buffer=5., s)
output.icecast(enc, s, mount="m3", host="icecast", fallible=true, id="output_m3") |
I have not been able to run the latest code which don't need start/stop. (Have not found an artifact with that code, although the start/stop is not important for me (I can do it manually). Don't know if there is something else that I would benefit from) I am running: Liquidsoap 2.3.0+git@24857a7 Adding a buffer makes it a lot better. At least when I switch between local streams like the sine waves. Does not work well if I use some for example Swedish Radio P1 and P3 "http://http-live.sr.se/p3-mp3-128" streams (only testing with those). I can only hear sound occasionally. Mostly silent = unable to connect to new stream. But, if I use my own streams, created with liquidsoap from a sound card on a different computer it almost works all the time. If I reencode the Swedish Radio with liquidsoap it... well works better than direct from the source but not as good as if liquidsoap from sound card. My streams are 44.1kHz and P1 and P3 are 48kHz. I don't think that should matter though. |
|
Ok. If the goal is to switch between http live sources without interruption, I don't think that setting the url is the way to go, with or without a buffer. Http is a pretty payload/latency heavy protocol so it's hard to know how long it will take to get the next source ready and, as soon as you change the url, your current buffer stars running down. The proper way to do it should be by toggling between two sources and making sure that the new source gets played when ready. I think you could achieve with with a track insensitive switch like this:
Then you can switch to s1 or s2 by changing this ref. Once you toggle it, the target source will start playing as soon as it's ready.
|
Hi, yes I know that is a much safer approach. In my big script I always fade out to silence (or actually to low gain noise -> encoding complete silence has not worked well) with a switch like you proposed. And that works better than the testscript but sometimes when I stop the input.http() it goes into "[input.http:2] Decoding failed: File "src/core/io/ffmpeg_io.ml", line 114, characters 8-14: Assertion failed" and if that happens it is hard to get it back to working state again. I need to be able to reuse input.http since I don't how many sources I need to switch between. Could the reason it works better in the large script be because most of the time there is no consumer of input.http when I stop it? So if I set an even longer delay between "switch to silence" and "input.http.stop()", maybe it will work bettter. I will test this and report back. |
Hi, I don't seem to have this problem any more.
With Liquidsoap 2.3.0+git@1dc6fac
But it keeps working or recovers = Perfect!. I did see a segfault twice but that may be something unrelated. If you ask me you can close this. But I saw that there is a related Issue, so maybe not. I just wanted to let you know where I am in this. |
Describe the bug
When I change the url of a input.http with set_url(...) it sometimes can't play the new stream. In my real script it does not happen that often, but in this test it happens often.
In this log file it worked the first time but not after that.
Version details
Liquidsoap 2.2.1+git@b9b936d
Debian 12 amd64
Install method
sudo apt install ./liquidsoap-b9b936d_2.2.1-debian-bookworm-1_amd64.deb
The text was updated successfully, but these errors were encountered: