Closed mylselgan closed 4 years ago
Is there a temporary fix by restarting the input if the log received "Switch to safe_blank with forgetful transition" or restarting the input if the output is silence for a specific time or restarting the input in a fixed interval? Please help.
Thanks Toots for taking this issue for To Do list of 1.3.4 release. I am still eagerly waiting for the solution.
Hi @mylselgan. Any chance you'd be able to test the latest code? There's been a lot of bugfixes there lately..
In particular, the gstreamer code has been reworked extensively. It might still need some work, tho. I would suggest to start by getting rid of the adaptative buffer and let the gstreamer input drive the whole streaming clock.
currently I have tested it with Liquidsoap 1.3.3 (installed via opam) ocaml-gstreamer-0.2.3
my current code is
emergency = single("/home/radio/liquidsoap-daemon/media/5-minutes.mp3")
gst = mksafe(input.gstreamer.audio(pipeline="uridecodebin
uri=http://any mms or m3u8 or shoutcast url"))
gst = buffer(mksafe(gst))
gst = mksafe(gst)
s = fallback(track_sensitive=false,[gst,emergency])
It still feeds blank after few minuets or few hour. I will post the log here in few hours.
I tried few times to build and install liquidsoap from source but failed. I will try once again today.
You should be able to transition to the latest code pretty easily with opam
:
git clone --recursive https://github.com/savonet/ocaml-gstreamer.git
cd ocaml-gstreamer
opam pin add .
# Installs gstreamer..
cd ..
# All the other updates are already in except ocaml-gstreamer
opam update
git clone --recursive https://github.com/savonet/liquidsoap.git
cd liquidsoap
opam pin add .
That should be more or less all you'll need.
Once you've updated, I would try this code:
emergency = single("/home/radio/liquidsoap-daemon/media/5-minutes.mp3")
gst = input.gstreamer.audio(pipeline="uridecodebin uri=http://any mms or m3u8 or shoutcast url")
s = fallback(track_sensitive=false,[gst,emergency])
Tried to update gstreamer but failed. Please check the attached log
also tried `opam depext gstreamer.dev' but still no success.
Do you have autoconf
installed? I can give more specific instructions if you let me know what OS you are using.
After installing autoconf gstreamer dev is successful but liquidsoap failed.
server detail:
Ubuntu Xenial (16.04 LTS) (GNU/Linux 4.4.0-119-generic x86_64 )
System load: 0.15
Memory usage: 0.0%
Usage on /: 31%
Local Users: 1
Image build: 2018-04-26
Disk vda: l_ssd 25G
I have attached install log and liquidsoap log (above script running on Liquidsoap 1.3.3 (installed via opam) ocaml-gstreamer-0.2.3)
Oh, thanks for reporting. It's actually a bug in gstreamer
. Just in time before the release :-)
Here's how to update:
cd <path to>/ocaml-gstreamer
git pull origin master
opam update
opam reinstall -y gstreamer
updated the git 57077b8..a9ad8df master -> origin/master 1 file changed, 4 insertions(+) radio@scw-019aaf:~/liqsource/ocaml-gstreamer$ opam update
install gstreamer > success install liquidsoap > failed removed gstreamer and install liquidsoap > success then install gstreamer > installation of mm and gstreamer success but liquidsoap fails again
install log file attached. installlog.txt
Are you sure you did install the updated gstreamer
?
Yes, tested in two different servers. Also tried by removing ocaml-gstreamer folder and re clone it. I will try again in a newly installed server in few minutes.
Ok you were right, there was a typo in my fix. Should be good now.
Installation success Liquidsoap 1.3.3+scm gstreamer=0.3.0 Loaded GStreamer 1.8.3 0
Started suggested test script now with a m3u8 input. output is successful. I will monitor it for three days and report here the result.
Glad to hear. Fingers crossed!
I tried
emergency = single("/home/radio/liquidsoap-daemon/media/5-minutes.mp3")
gst = input.gstreamer.audio(pipeline="uridecodebin uri=http://m3u8 url")
s = fallback(track_sensitive=false,[gst,emergency])
with a m3u8 live stream. It worked close to 48 hours then switched to the emergency single. the m3u8 is available but i don't know why it is not switching back to m3u8 again. It seems to be a big improvement because previously it successfully played maximum 8 hours only.
Log file attached
Thanks for these! I've added a default restart on Gstreamer input and output that should resolve your issue. Would you mind trying? Feel free to re-open the ticket if that didn't fix it..
cd ocaml-gstreamer git pull opam pin add . opam reinstall -y gstreamer cd .. cd liquidsoap git pull opam pin add . opam reinstall -y liquidsoap
Is this the correct way to update the latest commit?
I think so!
I tested for 3 days and it works fine without any issue. Thanks @toots for taking time to fix this. You helped me to reduce number of physical servers thus saving lots of electricity power. You guys indirectly helping for a green environment with this project. Thank you all.
HI, sorry for this again
Error while restarting pipeline: Gstreamer.Failed 1536298845.313377 [input(dot)gstreamer(dot)audio_video_6184:3] Will retry again in 3.00
while cheching log file, it retried several 1000 times then connected once then failed again then finally switched to emergency file.
I waited for 2 days then restated the liquidsoap daemon it outputs the audio now.
Attached a 3.5MB logfile. liqdev.log
Would you mind sharing your script as well? Either here or privately. Thks!
I sent it to your email as it contains the real output settings.
Hi please reopen this issue now I have which files cause this gstreamer error. Gstreamer works fine for few hours but fails to reconnect if any issue happens and feeds blank audio Note: script is not fallback to emergency mp3 file and retries gstreamer source every 3 seconds.
I have tried with following configurations, liquidsoap 1.1.3, 1.1.6, 1.3.7, 1.4-dev gstreamer=0.3.0 and dev gst-launch-1.0 version 1.14.0 GStreamer 1.10.0 and gst-launch-1.0 version 1.17.0 GStreamer 1.17.0 (GIT)
$ opam list
# Packages matching: installed
# Name # Installed # Synopsis
base v0.12.0 Full standard library replacement for OCaml
base-bigarray base
base-bytes base Bytes library distributed with the OCaml compiler
base-threads base
base-unix base
camomile 1.0.1 A Unicode library
conf-libpcre 1 Virtual package relying on a libpcre system installation
conf-m4 1 Virtual package relying on m4
conf-openssl 1 Virtual package relying on an OpenSSL system installation
conf-pkg-config 1.1 Virtual package relying on pkg-config installation
cry 0.6.2 The cry library is an implementation of the shout protocol to connect to audio diffusion servers such as icecast
dtools 0.4.1 Library providing various helper functions to make daemons
dune 1.9.1 Fast, portable and opinionated build system
duppy 0.8.0 Library providing monadic threads
gstreamer dev pinned to version dev at git+file:///home/radio/ocaml-gstreamer#master
jbuilder transition This is a transition package, jbuilder is now named dune. Use the dune
lame 0.3.3 Bindings for the lame library which provides functions for encoding mp3 files
liquidsoap 1.3.7 Swiss-army knife for multimedia streaming
mad 0.4.5 Bindings for the mad library which provides functions for encoding wave audio files into mp3
mm 0.4.0 The mm library contains high-level to create and manipulate multimedia streams (audio, video, MIDI)
ocaml 4.07.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.07.1 Official release 4.07.1
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.0 A library manager for OCaml
ogg 0.5.2 Interface for Ogg Bitstream Library, otherwise known as libogg
opam-depext 1.1.2 Query and install external dependencies of OPAM packages
pcre 7.4.1 Bindings to the Perl Compatibility Regular Expressions library
samplerate 0.1.4 Bindings for the samplerate library which provides functions for changing samplerate of audio data
sexplib0 v0.12.0 Library containing the definition of S-expressions and some base converters
ssl 0.5.7 Bindings for OpenSSL
taglib 0.3.3 Bindings for the taglib library which provides functions for reading tags in headers of audio files
vorbis 0.7.1 Bindings to libvorbis
My current script is.
emergency = single("/home/radio/media/silent/5-minutes.mp3")
url = "/.m3u8 url"
video_source = gstreamer.hls(url)
audio_only = drop_video(video_source)
s = fallback(track_sensitive=false, [audio_only,emergency])
Error Log, gstreamer retires every 3 seconds but failed to connect, works fine if I restart the script manually but fails again after few hours
2019/04/25 14:06:43 [input(dot)gstreamer(dot)audio_video_6646:3] Will retry again in 3.00
2019/04/25 14:06:46 [input(dot)gstreamer(dot)audio_video_6646:3] Restarting pipeline
2019/04/25 14:06:46 [input(dot)gstreamer(dot)audio_video_6646:3] Error while restarting pipeline: Gstreamer.Failed
2019/04/25 14:06:46 [input(dot)gstreamer(dot)audio_video_6646:4] Backtrace: Raised by primitive operation at file "gstreamer.ml" (inlined), line 75, characters 2-94
Called from file "io/gstreamer_io.ml", line 95, characters 17-43
Called from file "tools/tutils.ml", line 80, characters 16-19
Re-raised at file "tools/tutils.ml", line 82, characters 33-40
Called from file "io/gstreamer_io.ml", line 87, characters 8-515
Is there any way we could have access to the file or url (privately if you wish)?
I sent the full script to your email
Hi all!
One thing you can do to make it work with a recent liquidsoap is use the new youtube-dl
protocol. You'll need youtube-dl installed:
emergency = single("/home/radio/media/silent/5-minutes.mp3")
url = "https://www.youtube.com/watch?v=<videoID>"
video_source = gstreamer.hls("youtube-dl:#{url}")
audio_only = drop_video(video_source)
s = fallback(track_sensitive=false, [audio_only,emergency])
Yes my youtube-dl is latest (youtube-dl is up-to-date (2019.04.24) actually this script is works well for few hours but if any error occurred the gsteamer pipeline failed to restart and throws the above error every 3 seconds. it works again if i restart the liquidsoap-daemon again
I will try your script now
@toots The script you provided is not working it just plays the single i use youtube-dl -f 93 -g https://www.youtube.com/watch?v=
here is the log for
emergency = single("/home/radio/media/silent/5-minutes.mp3")
url = "youtube url"
video_source = gstreamer.hls("youtube-dl:#{url}")
audio_only = drop_video(video_source)
s = fallback(track_sensitive=false, [audio_only,emergency])
2019/04/25 20:19:06 >>> LOG START
2019/04/25 20:19:06 [main:3] Liquidsoap 1.3.7
2019/04/25 20:19:06 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] pcre=7.4.1 dtools=0.4.1 duppy=0.8.0 cry=0.6.2 mm=0.4.0 ogg=0.5.2 vorbis=0.7.1 mad=0.4.5 dynlink=[distributed with Ocaml] lame=0.3.3 gstreamer=0.3.0 fdkaac=$
2019/04/25 20:19:06 [gstreamer.loader:3] Loaded GStreamer 1.17.0 1
2019/04/25 20:19:06 [decoder:4] Trying method "META" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder:4] Trying method "WAV" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder.wav/aiff:4] Invalid file extension for "/home/radio/media/silent/5-minutes.mp3"!
2019/04/25 20:19:06 [decoder:4] Trying method "AIFF" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder.wav/aiff:4] Invalid file extension for "/home/radio/media/silent/5-minutes.mp3"!
2019/04/25 20:19:06 [decoder:4] Trying method "MIDI" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder:4] Trying method "IMAGE" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder:4] Trying method "OGG" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder.ogg:4] Invalid file extension for "/home/radio/media/silent/5-minutes.mp3"!
2019/04/25 20:19:06 [decoder:4] Trying method "MAD" for "/home/radio/media/silent/5-minutes.mp3"...
2019/04/25 20:19:06 [decoder.mad:4] Libmad recognizes "/home/radio/media/silent/5-minutes.mp3" as mpeg audio (layer III, 8kbps, 8000Hz, 2 channels).
2019/04/25 20:19:06 [decoder:3] Method "MAD" accepted "/home/radio/media/silent/5-minutes.mp3".
2019/04/25 20:19:06 [decoder.ogg:4] Invalid file extension for "/home/radio/media/silent/5-minutes.mp3"!
2019/04/25 20:19:06 [decoder.gstreamer:4] Invalid file extension for "/home/radio/media/silent/5-minutes.mp3"!
2019/04/25 20:19:06 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2019/04/25 20:19:06 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2019/04/25 20:19:06 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2019/04/25 20:19:06 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2019/04/25 20:19:06 [video.converter:4] Using preferred video converter: gavl.
2019/04/25 20:19:06 [threads:3] Created thread "gstreamer_main_loop" (1 total).
2019/04/25 20:19:06 [audio.converter:4] Using preferred samplerate converter: libsamplerate.
2019/04/25 20:19:06 [threads:3] Created thread "generic queue #1".
2019/04/25 20:19:06 [threads:3] Created thread "generic queue #2".
2019/04/25 20:19:06 [threads:3] Created thread "non-blocking queue #1".
2019/04/25 20:19:06 [threads:3] Created thread "non-blocking queue #2".
2019/04/25 20:19:06 [clock:4] Currently 1 clocks allocated.
2019/04/25 20:19:06 [clock.wallclock_main:4] Starting 1 sources...
2019/04/25 20:19:06 [source:4] Source main gets up.
2019/04/25 20:19:06 [source:4] Source fallback_6664 gets up.
2019/04/25 20:19:06 [source:4] Source drop_video_6662 gets up.
2019/04/25 20:19:06 [drop_video_6662:4] Content kind is {audio=2;video=0;midi=0}.
2019/04/25 20:19:06 [source:4] Source input.gstreamer.audio_video_6660 gets up.
2019/04/25 20:19:06 [input.gstreamer.audio_video_6660:4] Content kind is {audio=2;video=1;midi=0}.
2019/04/25 20:19:06 [input(dot)gstreamer(dot)audio_video_6660:4] Activations changed: static=[drop_video_6662:fallback_6664:main:main], dynamic=[].
2019/04/25 20:19:06 [drop_video_6662:4] Activations changed: static=[], dynamic=[fallback_6664:main:main].
2019/04/25 20:19:06 [source:4] Source single_6657 gets up.
2019/04/25 20:19:06 [single_6657:3] "/home/radio/media/silent/5-minutes.mp3" is static, resolving once for all...
2019/04/25 20:19:06 [single_6657:4] Content kind is {audio=2;video=0;midi=0}.
2019/04/25 20:19:06 [single_6657:4] Activations changed: static=[], dynamic=[fallback_6664:main:main].
2019/04/25 20:19:06 [fallback_6664:4] Activations changed: static=[main:main], dynamic=[].
2019/04/25 20:19:06 [single_6657:3] Prepared "/home/radio/media/silent/5-minutes.mp3" (RID 0).
2019/04/25 20:19:06 [main:4] Activations changed: static=[main], dynamic=[].
2019/04/25 20:19:06 [main:4] Enabling caching mode: active source.
2019/04/25 20:19:06 [main:3] Connecting mount /ptv for source@myserver.com...
2019/04/25 20:19:06 [main:3] Connection setup was successful.
2019/04/25 20:19:06 [threads:3] Created thread "wallclock_main" (2 total).
2019/04/25 20:19:06 [clock:4] Main phase starts.
2019/04/25 20:19:06 [clock.wallclock_main:3] Streaming loop starts, synchronized with wallclock.
2019/04/25 20:19:06 [fallback_6664:3] Switch to single_6657.
2019/04/25 20:19:06 [single_6657:4] Activations changed: static=[fallback_6664:main:main], dynamic=[fallback_6664:main:main].
2019/04/25 20:24:06 [decoder:4] Decoding "/home/radio/media/silent/5-minutes.mp3" ended: Mad.End_of_stream.
2019/04/25 20:24:06 [single_6657:3] Finished with "/home/radio/media/silent/5-minutes.mp3".
2019/04/25 20:24:06 [single_6657:3] Prepared "/home/radio/media/silent/5-minutes.mp3" (RID 0).
Could you try with the new input.hls
instead of gstreamer.hls
in the latest git?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue was closed for lack of activity. If you believe that it is still relevant, please confirm that it applies to the latest released version of liquidsoap and re-open the ticket. Thanks!
Hi, I am trying to transcode mms stream to output to shoutcast. The following script successfully encodes and gives output as expected, but after some time it stops encoding and feeds blank. The output to shoutcast is stable but no audio. The I script used
Additional Details: Hardware: OpenStack KVM VPS 1vCore, 2.4 GHz, 2 GB RAM, 10 GB SSD Ubuntu 16.04 Server (64 bits) Liquidsoap 1.2.0 , gstreamer 0.2.1 (with all required plugins)
The Log Output