Skip to content
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

liquidsoap/gstreamer freezes on stream start #630

Closed
MCOfficer opened this issue Sep 20, 2018 · 17 comments
Closed

liquidsoap/gstreamer freezes on stream start #630

MCOfficer opened this issue Sep 20, 2018 · 17 comments

Comments

@MCOfficer
Copy link

MCOfficer commented Sep 20, 2018

I'm attempting to use gstreamer for rtmp streaming. I was able to eliminate all errors in the gstreamer log, and am now using this script, based on Per Gunnarsson's last testing video:

set("frame.video.width", 1920)
set("frame.video.height", 1080)

audio = mksafe(single("test.m4a"))
source = video.volume(audio)

output.gstreamer.audio_video(
      video_pipeline=
        "videoconvert ! x264enc bitrate=2000 ! video/x-h264,profile=main ! queue ! mux.",
      audio_pipeline=
        "audioconvert ! voaacenc bitrate=128000 ! queue ! mux.",
      pipeline=
        "flvmux streamable=1 name=mux ! rtmpsink location=\"rtmp://a.rtmp.youtube.com/live2/foobar\"",
      source)

sidenote: i'm doing this because output.youtube.live fails with several syntax errors - should i file an issue for that?

However, once the actual streaming starts (after [playlist(dot)txt:3] Prepared <AUDIOFILE> (RID 170)), all output simply stops. i waited for half an hour (the test file runs 4 minutes), with no lifesign. even with GST_DEBUG=*:6, there's no additional output. when i set GST_DEBUG to 2 (only errors), i get only liquidsoap output. needless to say that nothing ever arrives at the youtube server.

i was concerned about video.volume being too resource intensive, but the process only uses moderate amounts of RAM and almost no CPU.

when i finally hit Ctrl-C, all i get is

2018/09/20 14:01:50 [main:3] Shutdown started!
2018/09/20 14:01:50 [main:3] Waiting for threads to terminate...
2018/09/20 14:01:50 [threads:3] Shuting down thread gstreamer_main_loop
2018/09/20 14:01:50 [threads:3] Thread "gstreamer_main_loop" terminated (1 remaining).
2018/09/20 14:01:50 [threads:3] Shuting down thread wallclock_gstreamer

, but the process doesn't shut down. not even killall is able to get to it, only killall -s KILL (or kill -9).

i am once again stumped.

@ghost
Copy link

ghost commented Sep 20, 2018

I tried your script on Debian testing and your script works fine for me.

I have liquidsoap installed from opam.

Regards,

Per Gunnarsson

@MCOfficer
Copy link
Author

MCOfficer commented Sep 20, 2018

i should've shared my setup.
liquidsoap was v1.3.4, gstreamer v0.3.0 (basically latest versions all across the board - i reinstalled via opam just a few hours ago).

since i don't need video.youtube.live (thanks to you), i tried the version from the repo (1.1.1). it seemed to work fine, i even got a few more debug messages beyond the point where 1.3.4 froze (gstreamer saying that it completed state change to PLAYING). But after that, it froze again.

I watched on YT's "Live Control Room", and for a brief second after said messages appeared, YT told me the stream was "good", probably indicating that it received data from gstreamer. there was no playback, though, and it almost immediately went back to "no signal".

Once again, my server was nowhere near it's capacity limits. I even provided the video as static image instead of video.volume. It's not a connection problem either, unless my upload speed to YT is for some reason only good with videos.

@ghost
Copy link

ghost commented Sep 20, 2018

I have from opam:
liquidsoap 1.3.3-1
gstreamer 0.2.3 (this is ocaml-gstreamer if I get things right)

from repo:
libgstreamer1.0-0 (1.14.2-2)
libgstreamer1.0-0-dev (1.14.2-2)

and

gstreamer1.0-plugins* (1.14.2-1)

Which operating system are you using?

@MCOfficer
Copy link
Author

MCOfficer commented Sep 20, 2018

ubuntu 18.04, with the following packages:
libgstreamer1.0-0 (1.14.1-1~ubuntu18.04.1)
libgstreamer1.0-dev (1.14.1-1~ubuntu18.04.1)
gstreamer1.0-plugins* (1.14.1-1~ubuntu18.04.1)
liquidsoap (1.1.1-7.2ubuntu1)

@ghost
Copy link

ghost commented Sep 20, 2018

Maybe we have to wait for Romain, but I guess until then you can increase log level
and post the full log here or on https://pastebin.com .

set("log.file.path","/tmp/test.log")
set("log.level",4)

I don't think the bug is in your script or in your hardware.

@MCOfficer
Copy link
Author

here it is.
2018/09/20 20:55:23 >>> LOG START
2018/09/20 20:55:22 [protocols.external:3] Found "/usr/bin/wget".
2018/09/20 20:55:22 [main:3] Liquidsoap 1.1.1
2018/09/20 20:55:22 [main:3] Using: graphics=[distributed with Ocaml] pcre=7.2.3 dtools=0.3.1 duppy=0.5.1 duppy.syntax=0.5.1 cry=0.2.2 mm=0.2.1 xmlplaylist=0.1.3 lastfm=0.3.0 ogg=0.4.5 vorbis=0.6.1 opus=0.1.0 speex=0.2.0 mad=0.4.4 flac=0.1.1 flac.ogg=0.1.1 dynlink=[distributed with Ocaml] lame=0.3.2 shine=0.2.0 gstreamer=0.2.0 frei0r=0.1.0 voaacenc=0.1.0 theora=0.3.0 gavl=0.1.5 bjack=0.1.4 alsa=0.2.3 ao=0.2.0 samplerate=0.1.2 taglib=0.3.1 magic=0.7.3 camomile=0.8.4 inotify=1.0 faad=0.3.2 soundtouch=0.1.7 portaudio=0.2.0 pulseaudio=0.1.2 ladspa=0.1.4 dssi=0.1.1 sdl=0.9.1 camlimages=4.2.0 lo=0.1.0 yojson=1.3.2 gd=1.0a5
2018/09/20 20:55:22 [dynamic.loader:3] Could not find dynamic module for fdkaac encoder.
2018/09/20 20:55:22 [dynamic.loader:3] Could not find dynamic module for aacplus encoder.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/sdl.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/faad.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lo.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gavl.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/camlimages.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/pulseaudio.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/mad.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/xmlplaylist.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/voaacenc.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ladspa.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ao.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/taglib.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/bjack.cmxs.
2018/09/20 20:55:22 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/graphics.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gstreamer.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/ogg.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lame.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/opus.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/frei0r.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/gd.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/oss.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/portaudio.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/cry.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/samplerate.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/shine.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/soundtouch.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/dssi.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/theora.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/alsa.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/vorbis.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/speex.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/flac_ogg.cmxs.
2018/09/20 20:55:23 [dynamic.loader:2] Loaded plugin file /usr/lib/liquidsoap/1.1.1/plugins/lastfm.cmxs.
2018/09/20 20:55:23 [decoder:4] Trying method "META" for "test.m4a"...
2018/09/20 20:55:23 [decoder:4] Trying method "WAV" for "test.m4a"...
2018/09/20 20:55:23 [decoder.wav:4] Invalid MIME type for "test.m4a": audio/x-m4a!
2018/09/20 20:55:23 [decoder.wav:4] Invalid file extension for "test.m4a"!
2018/09/20 20:55:23 [decoder:4] Trying method "MIDI" for "test.m4a"...
2018/09/20 20:55:23 [decoder:4] Trying method "IMAGE" for "test.m4a"...
2018/09/20 20:55:23 [decoder:4] Trying method "AAC" for "test.m4a"...
2018/09/20 20:55:23 [decoder.aac:4] Invalid MIME type for "test.m4a": audio/x-m4a!
2018/09/20 20:55:23 [decoder.aac:4] Invalid file extension for "test.m4a"!
2018/09/20 20:55:23 [decoder:4] Trying method "MP4" for "test.m4a"...
2018/09/20 20:55:23 [decoder.mp4:4] Libfaad recognizes "test.m4a" as MP4 (44100Hz,2 channels).
2018/09/20 20:55:23 [decoder:3] Method "MP4" accepted "test.m4a".
2018/09/20 20:55:23 [decoder.taglib:4] Invalid MIME type for "test.m4a": audio/x-m4a!
2018/09/20 20:55:23 [decoder.taglib:4] Invalid file extension for "test.m4a"!
2018/09/20 20:55:23 [decoder.taglib:4] Error while decoding file tags: Invalid file
2018/09/20 20:55:23 [decoder.taglib:4] Backtrace:
Raised at file "str.ml", line 612, characters 31-46
Called from file "str.ml", line 666, characters 10-35

2018/09/20 20:55:23 [decoder.gstreamer:4] Invalid MIME type for "test.m4a": audio/x-m4a!
2018/09/20 20:55:23 [decoder.gstreamer:4] Invalid file extension for "test.m4a"!
2018/09/20 20:55:23 [decoder.ogg:4] Invalid MIME type for "test.m4a": audio/x-m4a!
2018/09/20 20:55:23 [decoder.ogg:4] Invalid file extension for "test.m4a"!
2018/09/20 20:55:23 [metadata.flac:4] Invalid MIME type for "test.m4a": audio/x-m4a!
2018/09/20 20:55:23 [metadata.flac:4] Invalid file extension for "test.m4a"!
2018/09/20 20:55:23 [single:3] "test.m4a" is static, resolving once for all...
2018/09/20 20:55:23 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz master.
2018/09/20 20:55:23 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2018/09/20 20:55:23 [frame:3] Targetting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2018/09/20 20:55:23 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2018/09/20 20:55:23 [decoder:4] Trying method "META" for "test.jpeg"...
2018/09/20 20:55:23 [decoder:4] Trying method "WAV" for "test.jpeg"...
2018/09/20 20:55:23 [decoder:4] Trying method "MIDI" for "test.jpeg"...
2018/09/20 20:55:23 [decoder:4] Trying method "IMAGE" for "test.jpeg"...
2018/09/20 20:55:23 [decoder:4] Trying method "PPM" for "test.jpeg"...
2018/09/20 20:55:23 [decoder:4] Decoder "PPM" failed on "test.jpeg": Image.RGBA32.Invalid_format("Not a PPM file.")!
2018/09/20 20:55:23 [decoder:4] Trying method "SDL/IMAGE" for "test.jpeg"...
2018/09/20 20:55:23 [decoder.sdlimage:4] SDL loaded "test.jpeg" as 24bpp.
2018/09/20 20:55:23 [decoder:3] Method "SDL/IMAGE" accepted "test.jpeg".
2018/09/20 20:55:23 [decoder:3] Method "IMAGE" accepted "test.jpeg".
2018/09/20 20:55:23 [metadata.mp4:4] Invalid MIME type for "test.jpeg": image/jpeg!
2018/09/20 20:55:23 [metadata.mp4:4] Invalid file extension for "test.jpeg"!
2018/09/20 20:55:23 [decoder.taglib:4] Invalid MIME type for "test.jpeg": image/jpeg!
2018/09/20 20:55:23 [decoder.taglib:4] Invalid file extension for "test.jpeg"!
2018/09/20 20:55:23 [decoder.taglib:4] Error while decoding file tags: Invalid file
2018/09/20 20:55:23 [decoder.taglib:4] Backtrace:
Raised at file "hashtbl.ml", line 194, characters 13-28
Called from file "tools/pool.ml", line 101, characters 14-32

2018/09/20 20:55:23 [decoder.gstreamer:4] Invalid MIME type for "test.jpeg": image/jpeg!
2018/09/20 20:55:23 [decoder.gstreamer:4] Invalid file extension for "test.jpeg"!
2018/09/20 20:55:23 [decoder.ogg:4] Invalid MIME type for "test.jpeg": image/jpeg!
2018/09/20 20:55:23 [decoder.ogg:4] Invalid file extension for "test.jpeg"!
2018/09/20 20:55:23 [metadata.flac:4] Invalid MIME type for "test.jpeg": image/jpeg!
2018/09/20 20:55:23 [metadata.flac:4] Invalid file extension for "test.jpeg"!
2018/09/20 20:55:23 [single:3] "test.jpeg" is static, resolving once for all...
2018/09/20 20:55:23 [video.converter:4] Using preferred video converter: gavl.
2018/09/20 20:55:23 [audio.converter:4] Using preferred samplerate converter: libsamplerate.
2018/09/20 20:55:23 [threads:3] Created thread "generic queue #1".
2018/09/20 20:55:23 [threads:3] Created thread "generic queue #2".
2018/09/20 20:55:23 [clock:4] Currently 1 clocks allocated.
2018/09/20 20:55:23 [clock.wallclock_gstreamer:4] Starting 1 sources...
2018/09/20 20:55:23 [source:4] Source gstreamer_6474 gets up.
2018/09/20 20:55:23 [source:4] Source mux_6472 gets up.
2018/09/20 20:55:23 [mux_6472:4] Content kind is {audio=2;video=1;midi=0}.
2018/09/20 20:55:23 [source:4] Source mksafe gets up.
2018/09/20 20:55:23 [source:4] Source single_6464 gets up.
2018/09/20 20:55:23 [test(dot)m4a:4] Content kind is {audio=2;video=0;midi=0}.
2018/09/20 20:55:23 [test(dot)m4a:4] Activations changed: static=[], dynamic=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer].
2018/09/20 20:55:23 [source:4] Source safe_blank gets up.
2018/09/20 20:55:23 [safe_blank:4] Content kind is {audio=2;video=0;midi=0}.
2018/09/20 20:55:23 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer].
2018/09/20 20:55:23 [mksafe:4] Activations changed: static=[mux_6472:output(dot)gstreamer:output(dot)gstreamer], dynamic=[].
2018/09/20 20:55:23 [source:4] Source mksafe gets up.
2018/09/20 20:55:23 [source:4] Source single_6468 gets up.
2018/09/20 20:55:23 [test(dot)jpeg:4] Content kind is {audio=0;video=1;midi=0}.
2018/09/20 20:55:23 [test(dot)jpeg:4] Activations changed: static=[], dynamic=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer].
2018/09/20 20:55:23 [source:4] Source safe_blank gets up.
2018/09/20 20:55:23 [safe_blank:4] Content kind is {audio=0;video=1;midi=0}.
2018/09/20 20:55:23 [safe_blank:4] Activations changed: static=[], dynamic=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer].
2018/09/20 20:55:23 [mksafe:4] Activations changed: static=[mux_6472:output(dot)gstreamer:output(dot)gstreamer], dynamic=[].
2018/09/20 20:55:23 [mux_6472:4] Activations changed: static=[output(dot)gstreamer:output(dot)gstreamer], dynamic=[].
2018/09/20 20:55:23 [output(dot)gstreamer:4] Activations changed: static=[output(dot)gstreamer], dynamic=[].
2018/09/20 20:55:23 [output(dot)gstreamer:4] Enabling caching mode: active source.
2018/09/20 20:55:24 [clock.wallclock_gstreamer:4] Delegating clock to active sources.
2018/09/20 20:55:24 [threads:3] Created thread "wallclock_gstreamer" (1 total).
2018/09/20 20:55:24 [clock:4] Main phase starts.
2018/09/20 20:55:24 [clock.wallclock_gstreamer:3] Streaming loop starts, synchronized by active sources.
2018/09/20 20:55:24 [test(dot)m4a:3] Prepared "test.m4a" (RID 0).
2018/09/20 20:55:24 [test(dot)jpeg:3] Prepared "test.jpeg" (RID 1).
2018/09/20 20:55:24 [mksafe:3] Switch to test(dot)m4a.
2018/09/20 20:55:24 [test(dot)m4a:4] Activations changed: static=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer], dynamic=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer].
2018/09/20 20:55:24 [mksafe:3] Switch to test(dot)jpeg.
2018/09/20 20:55:24 [test(dot)jpeg:4] Activations changed: static=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer], dynamic=[mksafe:mux_6472:output(dot)gstreamer:output(dot)gstreamer].

also: pastebin.com, haste.bin

I'm not sure how to log the gstreamer debug output as well.

@ghost
Copy link

ghost commented Sep 20, 2018

Doh! I upgraded to 1.3.4 and now I run into the same freeze.

@MCOfficer
Copy link
Author

not sure if that's the same freeze, or if something different is going on with my v1.1.1 - either way, i seem to be rather unlucky with liquidsoup.

@MCOfficer
Copy link
Author

MCOfficer commented Sep 21, 2018

the last lines of the gstreamer debug log are:

0:00:12.545231652  6395 0x7f9e181eede0 LOG                     rtmp :0::   0020:  ab c4 75 ed d8 91 b9 e1  d9 23 0e b3 7c 82 3e 92   ..u......#..|.>.
0:00:12.545251372  6395 0x7f9e181eede0 LOG                     rtmp :0::   0030:  84 2d 65 91 9c 05 03 f3  bf 94 3f 14 6f ef 31 46   .-e.......?.o.1F
0:00:12.545270631  6395 0x7f9e181eede0 LOG                     rtmp :0::   0040:  80 16 5f f0 c6 07 d0 17  9c 3b 43 62 98 9b 4d 71   .._......;Cb..Mq
0:00:12.545290131  6395 0x7f9e181eede0 LOG                     rtmp :0::   0050:  6d f0                                              m.
0:00:12.545330851  6395 0x7f9e181eede0 DEBUG               basesink gstbasesink.c:3577:gst_base_sink_chain_unlocked:<rtmpsink0> object unref after render 0x7f9e10013600
0:00:12.545357901  6395 0x7f9e181eede0 DEBUG         GST_SCHEDULING gstpad.c:4324:gst_pad_chain_data_unchecked:<rtmpsink0:sink> called chainfunction &gst_base_sink_chain with buffer 0x7f9e10013600, returned ok
0:00:12.545381550  6395 0x7f9e181eede0 LOG               aggregator gstaggregator.c:1146:gst_aggregator_aggregate_func:<mux> flow return is ok
0:00:12.545404590  6395 0x7f9e181eede0 LOG               aggregator gstaggregator.c:398:gst_aggregator_check_pads_ready:<mux> checking pads
0:00:12.545424710  6395 0x7f9e181eede0 LOG               aggregator gstaggregator.c:456:gst_aggregator_check_pads_ready:<mux:sink_0> pad not ready to be aggregated yet
0:00:12.545452660  6395 0x7f9e181eede0 DEBUG                 flvmux gstflvmux.c:1814:gst_flv_mux_get_next_time_for_segment:<mux> next_time: 0:00:00.000000000
0:00:12.545474309  6395 0x7f9e181eede0 LOG               aggregator gstaggregator.c:664:gst_aggregator_wait_and_check:<mux> Waiting for src on thread 0x7f9e181eede0

(there are hundreds of similar rtmp :0:: lines above this)
so it does send something to YT, but it seems that the thread mentioned in the last message never finishes (which might also be the reason why i can't end liquidsoap, it's waiting for a thread that never ends).

sidenote, i left it running over night, and nothing changed, so it's safe to say that the freeze is a definitive state.

@toots
Copy link
Member

toots commented Sep 21, 2018

Thanks for report y'all. I'll try to have a look at it ASAP.

@toots toots closed this as completed in c458cc5 Sep 23, 2018
@toots
Copy link
Member

toots commented Sep 23, 2018

Happy to report that output.youtube.live now works like a charm here with the above commit :-)

@MCOfficer
Copy link
Author

i'll try to build from source & test it as soon as possible, thanks. what could possibly go wrong?

@toots
Copy link
Member

toots commented Sep 23, 2018

You shouldn't need to recompile for it, just copy paste this in your script:

def output.youtube.live(~id="",
  ~video_bitrate=2000,
  ~audio_encoder="fdkaacenc",
  ~audio_bitrate=128000,
  ~url="rtmp://a.rtmp.youtube.com/live2",
  ~key,
  source) =
  video_pipeline = "videoconvert ! \
      x264enc bitrate=#{video_bitrate} byte-stream=false key-int-max=60 bframes=0 aud=true tune=zerolatency ! \
      video/x-h264,profile=main ! queue ! mux."
  audio_pipeline = "audioconvert ! #{audio_encoder} bitrate=#{audio_bitrate} ! queue ! mux."
  pipeline = "flvmux streamable=true name=mux ! rtmpsink location=\"#{url}/#{key} app=live2\""

  output.gstreamer.audio_video(id=id,video_pipeline=video_pipeline,
    audio_pipeline=audio_pipeline,pipeline=pipeline,source)
end

@MCOfficer
Copy link
Author

MCOfficer commented Sep 23, 2018

too late ;)
I'm kinda stuck though... gstreamer keeps throwing "no element "fdkaacenc"" at me. gstreamer1.0-plugins-bad(v1.14.1-1~ubuntu18.04.1) is installed, and i already recompiled gstreamer, just in case.

for the record, now everything is installed via opam (again), with opam pinning for liquidsoap.

@toots
Copy link
Member

toots commented Sep 23, 2018

Use audio_encoder="voaacenc" :-)

@toots
Copy link
Member

toots commented Sep 23, 2018

I think Debian defaults to voaacenc it's not as good as fdkaac tho. I might switch the default in the future to make it easier for Debian users (which is usually our main distribution target)

@MCOfficer
Copy link
Author

MCOfficer commented Sep 23, 2018

awesome, it works ^^

perhaps you should, idk, make a fallback for fdkaacenc, or something along those lines before releasing it.

thanks a lot, both of you!

toots added a commit that referenced this issue Dec 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants