Stream USB Capture Device

*nix specific usage questions
Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 21:35

For CLI, the basic syntax is:

Code: Select all

vlc [input_source] --sout=#transcode{vcodec=mp2v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test}
Your sout options are exactly what you see in the output string when setting up a stream in the GUI, with the exception that command line uses double hyphen "--" instead of colon ":" to introduce the sout option.

Your [input source] you can get from the Open Capture Device GUI. Select the capture device as you normally do, then check "Show More options". The MRL is your [input_source]. The additional options just below that should be added to the command line as well, with the same change of colon ":" to double hyphen "--" to introduce each option.

If it's not confidential info or security risk, you can post it here as the command line show most clearly in a compact way what is going to happen and will help greatly with future troubleshooting.

You can definitely set this up in a startup script, or have a shortcut icon for other volunteers to easily open. Which distro are you running?

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 22:03

Hi All

I don't think there is any security risks as the LAN is totally isolated and NOT on the net plus there is a secondary alarm system.
:sout=#transcode{vcodec=mp2v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test} :no-sout-all :sout-keep
The MRL is v4l2://
The input is:
cvlc -vvv v4l2:///dev/video0

I am playing around with simpler versions of the string first and leaving the client as manual setup until the server cli is done.
Have tried various strings, but can't seem to find where the log file is and what name it is. No problem when using gui as I can set it in there.

Regards

Test Result:
cvlc -vvv v4l2:///dev/video0 --sout=#transcode{vcodec=mp2v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none} --rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test} --no-sout-all --sout-keep
VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7)
vlc: unknown option or missing mandatory argument `--rtpdst=192.168.0.255'
Try `vlc --help' for more information.

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 22:17

Oh I didn't make it clear enough. The double hyphen is only at the start of the option, to introduce it. Colons inside options stay as they are. The one before "rtp" should stay because it's part of the sout.

Code: Select all

cvlc -vvv v4l2:///dev/video0 --sout=#transcode{vcodec=mp2v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test}
Also you can specify the log file on the command line as well with

Code: Select all

--file-logging --logfile=/home/user/cvlc.log

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 22:45

Hi All

Sorry for testing your patience.
That string now seems to work by announcing : VLC media player 3.0.8 Vetinari (revision 3.0.8-0-gf350b6b5a7) and a blinking cursor.
However, the normal way of opening the client /Media/Open Network Stream rtp://192.168.0.255:5004/Test
just sits there with the progress bar oscillating back and forth (looking ?)
Trying from the command line, but not sure of the structure or wether to use rtsp or rsp.
Regards

Edit: Log file on client says : playlist is empty
Log file on Server includes these lines of interest:
main error: stream chain failed for `transcodescodec=none'
main error: cannot start stream output instance, aborting
main debug: dead input

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:18

I don't know where that came from. It's supposedly for subtitles. Just remove it.

Code: Select all

cvlc -vvv v4l2:///dev/video0 --sout=#transcode{vcodec=mp2v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test}

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 23:22

I did and then the next field becomes an error (samplerate=44100)
main error: stream chain failed for `transcodesamplerate=44100:rtpname=Test'
main error: cannot start stream output instance, aborting

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:25

Does this have any audio? If not, try this:

Code: Select all

cvlc -vvv v4l2:///dev/video0 --no-sout-audio --sout=#transcode{vcodec=mp2v,vb=800}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test}

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 23:38

Hi All
main error: stream chain failed for `transcodevb=800:rtpname=Test'
main error: cannot start stream output instance, aborting
main debug: dead input
Then removing vb=800
main error: stream chain failed for `transcode{vcodec=mp2v}:rtpname=Test'
main error: cannot start stream output instance, aborting
main debug: dead input

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:42

Do you get the same error using vlc instead of cvlc?
Ty adding --no-sout-all on the end. I didn't think it was needed but maybe it is in your case.
Paste again the full command line you're using.

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 23:45

Yes, the GUI opens but is stopped.
Log file has same error lines.
vlc -vvv v4l2:///dev/video0 --sout=#transcode{vcodec=mp2v,vb=800,acodec=mpga,ab=128,channels=2,samplerate=44100}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap}
Took the name off the end to try that
main error: stream chain failed for `transcodesamplerate=44100:rtpsap--no-sout-all'
main error: cannot start stream output instance, aborting
main debug: dead input
Last edited by Dinosaur1946 on 07 Jul 2022 23:50, edited 1 time in total.

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:49

Oh wait I think it has to do with quoting. The shell is trying to parse the curly brackets before passing it to VLC.

Here we go again:

Code: Select all

cvlc -vvv v4l2:///dev/video0 --no-sout-audio --no-sout-all --sout='#transcode{vcodec=mp2v,vb=800}:rtp{dst=192.168.0.255,port=5004,mux=ts,sap,name=Test}'

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 23:51

That's working
Do we need to go back to the full string ?
Last edited by Dinosaur1946 on 07 Jul 2022 23:52, edited 1 time in total.

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:51

I really wish someone else would chime in on this thread.

Not your fault Dinosaur, I'm not at all an expert myself, and not a very good teacher, either.

But why is there no one else pointing out the obvious things?

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:54

That's working
Do we need to go back to the full string ?
If it's working then it's working!
The shorter the string, the better. Fewer things to clog up the pipe.
If you're not using audio or subtitles, then you don't need the other stuff.
Last edited by Mercury048 on 07 Jul 2022 23:55, edited 1 time in total.

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 07 Jul 2022 23:55

I think because it is getting to long winded.
You have done pretty good sofar.

I will play around with it now we have the format correct and see if I can get the client from cli as well.
If not and I am stuck, I will start a new thread.

Enjoy your day (or night)

Regards

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 07 Jul 2022 23:57

Client should be dead simple, I can do that right now:

Code: Select all

vlc rtp://192.168.0.255:5004/Test

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 08 Jul 2022 00:04

You didn't even give me the chance to try my version, :)
But that worked straight away.

Did you look at the pdf I posted in the earlier posts, cause I will remove it later.

Mercury048
Blank Cone
Blank Cone
Posts: 85
Joined: 20 Jan 2008 02:15

Re: Stream USB Capture Device

Postby Mercury048 » 08 Jul 2022 00:19

Yes, I got it.
The evening is just starting here.
I'm glad we got something working.
:)

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 08 Jul 2022 00:29

08:30 am here on the Sunny Queensland coast.
Once again , Many Thanks.

Dinosaur1946
Blank Cone
Blank Cone
Posts: 30
Joined: 02 Jul 2022 23:00
VLC version: 3.0.8
Operating System: Linux

Re: Stream USB Capture Device

Postby Dinosaur1946 » 11 Jul 2022 07:04

Hi All

Just an update, have installed the system at the museum and is working perfectly.
Able to see 48 camera's in 3 locations over a single cat5 with 2 ethernet switches.
One of these switches is just a simple range extender.
Every 5 sec's each of the 9 monitors change to show another batch of camera's.
Three icons on each 3 PC screens run a script:
Run Local 1 (to start streaming)

Code: Select all

#!/bin/sh vlc v4l2:///dev/video0:width=1920,height=1080 --no-sout-audio --no-sout-all --sout='#transcode{vcodec=mp2v,acodec=mpga,ab=128,channels=2,samplerate=15000,scodec=none}:rtp{dst=192.168.0.255,port=5014,mux=ts,sap,name=Admin}'
View Remote 1

Code: Select all

#!/bin/sh vlc rtp://192.168.0.255:5024/Rec
View Remote 2

Code: Select all

#!/bin/sh vlc rtp://192.168.0.255:5004/Coll
That is repeated for the three locations.

Many thanks to the VLC developers for a brillian package and Mercury048 in helping me make it work.

Regards


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 28 guests