Hi Daniel,

When it comes to video stream, liquidsoap is indeed a little more
experimental. Sam was the principal architect of this part of the
application so I'm also learning about it each time I look at it.

As far as I can see, input.udp is a very basic source. It should support
the same decoders as input.http and etc. Decoders are picked based on the
mime type declared with input.udp. The list of mime types are associated
decoders can be found here:
https://www.liquidsoap.info/doc-1.3.4/settings.html under Decoder Settings
-> Mime-types used for guessing audio formats

When it comes to video input and output, I believe that the most successful
approach so far has been to peruse the various gstreamer tools. This way
you can take advantage of gstreamer's capacities in term of receiving data,
decoding it and the same on the way out.

The main operators for gstreamer input and output are:
  input.gstreamer.audio, input.gstreamer.video, input.gstreamer.audio_video
and
  output.gstreamer.audio, output.gstreamer.video,
output.gstreamer.audio_video

The scripted library has a section dedicated to various uses of those
gstreamer operators:
https://github.com/savonet/liquidsoap/blob/master/scripts/gstreamer.liq

Hope this helps!
Romain

Le dim. 18 nov. 2018 à 11:38, Daniel Cantarín via Savonet-users <
savonet-users@lists.sourceforge.net> a écrit :

> Hi there.
>
> I've used liquidsoap in the past with audio streams, and it was amazing. I
> loved it. So I now want to use it again, but this time with video streams.
> Things don't go well so far on that front, so I'm writting with a few
> questions regarding liquidsoap functionalities.
>
> TL;DR version:
>
>     1) Does "input.udp" support video streams?
>     2) Where can I see the full list of supported MIME types by
> "input.udp"?
>     3) Can I handle h264/aac input video streams with liquidsoap?
>     4) Can liquidsoap act solely as packetizer/muxer/whatever-its-called,
> or even just as proxy, instead of fully transcode the output video?
>     5) Can I read rawvideo without echoing the input on the console?
> (please note I DO want to see debug output)
>     6) Can I use input.ffmpeg with custom commands?
>
> Full version:
>
> My plan is to use LS as live video stream orchestrator (not generator),
> with simple use cases such as "output a blank video when the input is
> offline" or "switch to this other stream when I say so, without fades or
> any other fancy stuff".
> This way, I pretend to use LS as an intermediary, between my input streams
> (that I may or may not generate myself), and the actual final encoders
> (which may not be in the same computer).
> I would then receive streams on my server, pass them through liquidsoap,
> and then output them to another network endpoint.
> This should have low CPU usage, as most of the time liquidsoap should just
> be copying the input to another output without touching the video frames,
> and the only truly generated video is a blank one.
>
> So, my first test was with the "fallback" function for an UDP input
> stream, like this:
>
> input1 = input.udp(
>   host="127.0.0.1",
>   port=10001
> )
> input2 = blank()
> source1 = fallback( [ input1, input2 ] )
> output.dummy( source1 );
>
>
> That should read a test mpegts stream sent with ffmpeg, like this:
>
> ffmpeg -re -f lavfi -i testsrc=s=640x480  -cbr 1 -r 25 -c:v mpeg2video -f
> mpegts udp://127.0.0.1:10001
>
>
> This is a typical setup where I receive a video stream via UDP. However,
> "fallback" and "dummy" give me type errors regarding "source" type and the
> one "input.udp" returns, which in the docs says it's "active_source", but
> in the output shows some dynamic type I don't fully understand
> ("(?id:_,?buffer:_,_)->_"). I know nothing about ocaml, and didn't used
> liquidsoap since about 2012, so I'm kinda slow on this. Checking online,
> I've saw some syntax regarding type casting in liquidsoap (in this case,
> would be "(input1 : source)"), but didn't worked either.
>
> In order to change that behaviour, I've also tested the other "input.udp"
> parameters, and eventually saw the last unnamed string param. There I can
> put a MIME type for my input video. But not a single MIME type for mpeg2
> video worked: they all returned error saying the MIME type is not
> recognized. This gave me another doubt. I can see the docs mentioning "avi"
> for video input type everywhere. I could change the liquidsoap's input
> video type in my example (that is, change mpeg2 to something else, like
> avi), but I don't want liquidsoap as video encoder, and forcing avi means
> that the output must be transcoded to whatever I need. So, ideally,
> liquidsoap would be able to handle different video types (avi, raw, mpeg,
> h264, and so on).
>
> With this in mind, playing around a while with the options I've found,
> I've also tried this:
>
> input1 = input.external.rawvideo(
>   restart=false,
>   restart_on_error=false,
>   "ffmpeg -i udp://127.0.0.1:10001 -f rawvideo pipe:0"
> )
>
>
> But this floods my console with raw video (absolutelly undesirable), and
> other external inputs didn't worked either (I can see in the docs almost
> all input methods imply audio input).
> So now I'm full of doubts about what I can an can't do with liquidsoap
> regarding video streams.
> I could keep on trying different setups, but I guess maybe it's a good
> idea to ask you people about liquidsoap actual functionalities first.
> Would anyone please give me a hand with this?
>
> Thank you all.
>
>
> _______________________________________________
> Savonet-users mailing list
> Savonet-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/savonet-users
>
_______________________________________________
Savonet-users mailing list
Savonet-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to