VLC Streaming

From Playing with linux...
Jump to navigation Jump to search

Streaming with VLC from the command line

Logitech C910

I've tried the Logitech C910, but it won't focus to infinity without an extra lens.

Logitech C920

The Logitech C920 still doesn't focus fully to infinity, but the picture is clear enough.

I have streamed to a site-local multicast address with transcoding, because the C920 gives a standard image format of yuy2, which isn't stream-able in a transport stream.

cvlc -vvvv --v4l2-width=1920 --v4l2-height=1080 --v4l2-aspect-ratio=16\:9 --v4l2-fps=30 --v4l2-sharpness=255 \
--v4l2-power-line-frequency=1 --v4l2-set-ctrls={"009A090C=0"}--live-caching=150 v4l2:///dev/video0 --sout \ 
'#transcode{vcodec=mp4v,acodec=none,vb=12000,ab=0}:rtp{mux=ts,dst=239.255.255.45,port=5004,sdp=sap,name="localstream"}' \
--ttl 1 

There's also the possibility to stream without transcoding, but the following doesn't work well, because the webcam just isn't fast enough while building the mjpeg frames.

cvlc -vv --v4l2-chroma=MJPG --v4l2-width=1920 --v4l2-height=1080 --v4l2-aspect-ratio=16\:9 --v4l2-fps=30 \
--live-caching=100 v4l2:///dev/video0 --sout '#rtp{mux=ts,dst=239.255.255.45,port=5004,sdp=sap,name="localstream"}' \
--ttl 1

BT878

The following has worked for years with a BT878-based capture card:

vlc -vvv v4l2:///dev/video0:input=1:width=720:height=576 --sout '#transcode{vcodec=mp4v,acodec=none,vb=2000,ab=0}:rtp{mux=ts,dst=239.255.79.42,port=1234,sdp=sap,name="test"}' --ttl 1