how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

About encoding, codec settings, muxers and filter usage
NewtownGuy
Blank Cone
Blank Cone
Posts: 50
Joined: 11 Feb 2014 19:01

how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

Postby NewtownGuy » 01 Jun 2018 02:18

I want to simultaneously create rtsp and livehttp video streams from the same live H.264 source in cvlc. I can individually create either kind of stream just fine, and I can also create two rtsp streams simultaneously using the 'duplicate' tag, so my basic setup is right. However, something is wrong when I try to do the two kinds of streams at the same time in a single command.

This runs in linux and the commands are written in bash. My frame rate, $fps, is 10 fps. /home/vout1 is my live H.264 source. Folders and the server URL are defined by variables. Note that I had to add dst= when I went from the single command to the combined command.

Here's the working rtsp command:

Code: Select all

cvlc -vvv stream:///home/vout1 --sout '#rtp{sdp=rtsp://:8554/}' --demux=h264 --h264-fps=$fps
Here's the working livehttp command:

Code: Select all

cvlc -vvv stream:///home/vout1 --sout "#standard{access=livehttp{seglen=5,delsegs=true,numsegs=2,index=$streaming_video_folder/stream.m3u8,index-url=$server_URL/stream-###.ts},mux=ts{use-key-frames},dst=$streaming_video_folder/stream-###.ts}}" --h264-fps=$fps --demux=h264
Here's a working command that creates two rtsp streams:

Code: Select all

cvlc -vvv stream:///home/vout1 --sout '#duplicate{dst=rtp{sdp=rtsp://:8554/},dst=rtp{sdp=rtsp://:9554/}}' :demux=h264 :h264-fps=$fps
Here's the non-working combined, rtsp and livehttp command:

Code: Select all

cvlc -vvv stream:///home/vout1 --sout '#duplicate{dst=rtp{sdp=rtsp://:8554/},dst=standard{access=livehttp{seglen=5,delsegs=true,numsegs=2,index=$streaming_video_folder/stream.m3u8,index-url=$server_url/stream-###.ts},mux=ts{use-key-frames},dst=$streaming_video_folder/stream-###.ts}}' :demux=h264 :h264-fps=$fps
I don't get any streams and I get a multitude of these errors:

[0xca4540] access_output_livehttp access out error: cannot open `-treaming_video_folder/stream-001.ts' (No such file or directory)

For some reason, the previously working variable name, $streaming_video_folder, has been transformed to the erroneous, -treaming_video_folder.

Can someone tell me the proper syntax for the combined command ? Thank you in advance.

StCyr
Blank Cone
Blank Cone
Posts: 12
Joined: 23 Mar 2018 16:32

Re: how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

Postby StCyr » 01 Jun 2018 11:28

Might simply be because in the simple LiveHttp command, you're using "index-url=$server_URL" while in the combined RTSP+LiveHttp you're using "index-url=$server_url"

NewtownGuy
Blank Cone
Blank Cone
Posts: 50
Joined: 11 Feb 2014 19:01

Re: how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

Postby NewtownGuy » 01 Jun 2018 15:07

Many thanks, StCyr, for finding one of my typos. A second typo, which caused the mixup with '-treaming_video_folder', was my use of single quotes instead of double quotes around the entire duplicate string. This caused bash to not see my variable names. Here's a working command, with a few other but minor edits:

Code: Select all

cvlc -vvv stream:///home/vout1 --sout "#duplicate{dst=rtp{sdp=rtsp://:8554/},dst=standard{access=livehttp{seglen=5,delsegs=true,numsegs=2,index=$streaming_video_folder/stream.m3u8,index-url=$server_URL/stream-###.ts},mux=ts{use-key-frames},dst=$streaming_video_folder/stream-###.ts}}" --demux=h264 --h264-fps=$fps
This syntax problem is now solved. However, I am getting countless "main mux warning: late buffer for mux input", and "mux_ts mux warning: packet with too strange dts", messages, which I've never been able to get rid of.

Ghengis
Blank Cone
Blank Cone
Posts: 17
Joined: 10 Apr 2008 15:14

Re: how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

Postby Ghengis » 05 Jun 2018 12:17

I think 90% of the problems I've seen with VLC command line would be solved if there was a "dry run" option that just echoed back the actual arguments as VLC understands them, without doing anything. Between shell interpolation, quotes/escapes, variable substitution... I spent the better part of an hour tracking down an issue where I'd accidentally put a space after a comma in a big transcode blurb.

NewtownGuy
Blank Cone
Blank Cone
Posts: 50
Joined: 11 Feb 2014 19:01

Re: how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

Postby NewtownGuy » 05 Jun 2018 13:35

I agree with that provided there's enough information to figure out what is going on. The syntax of my command above became even more complex when I needed to "nice" it, which meant I needed some kind of quotes around the entire cvlc command, which already had embedded quotes. I could not use single quotes because, as explained above, bash would not see my variable names. I solved the problem by placing a \ in front of the embedded quotes, and double quotes around the entire cvlc command. Another thing that needs clarification is whether or not URLs needs a trailing /.

Luna Moon
Blank Cone
Blank Cone
Posts: 15
Joined: 08 Feb 2018 14:30
VLC version: 2.1.5
Operating System: Windows
Location: Europe
Contact:

Re: how to simultaneously create rtsp and livehttp video streams in cvlc from the same live source?

Postby Luna Moon » 12 Jun 2018 16:14

I think 90% of the problems I've seen with VLC command line would be solved if there was a "dry run" option that just echoed back the actual arguments as VLC understands them, without doing anything.
That is a great idea and would help indeed. Maybe that could be a possible implementation in the future?


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 40 guests