You are not logged in.

#1 2019-11-28 02:31:53

Guido Budack
Member
From: Switzerland/Philippines
Registered: 2019-05-02
Posts: 19
Website

VLC transcode<->duplicate chain

Problem: I want to stream the video part of my webcam signal to a remote server so I can use it as a surveillance camera with, lets say 24h buffering 1fps, resulting in about 1.5GB disk-usage/day.

Later on I will take care for the connection to my server, tls certificates, opening ports etc. pp. - so far my testing is local.

After a lot of digging and testing I came to the following result:

If I use this one liner:

cvlc --verbose --no-audio v4l2:///dev/video0 --sout='#transcode{vcodec=h264,venc=x264}:duplicate{dst=standard{access=file,mux=ts,dst="/home/me/Downloads/webcam-stream.mp4"},dst=standard{access=http,mux=ts,dst=127.0.0.1:8080,sap="Webcam-Stream",name=Webcam-Stream}'

I discovered that the processing takes a while until the vlc engine starts trans-coding to the file.
However, as long as I try to connect to the live-stream under 127.0.0.1:8080 in another terminal I need to do it quickly because, if the trans-coder started already to write data to the file,
the engine is either too busy processing or doesn't recognize the connecting attempt called by this following line:

cvlc http://127.0.0.1:8080

After a while I get an error message in the terminal where I entered the second one-liner:

Failed to open VDPAU backend libvdpau_i965.so: Can't open the shared-object-file: file not found

some more cryptic stuff and the stream freezes in the pop-up window.




Any suggestions how to improve the  scenario?
I don't like it at all so far and in particular as a second issue the fact that I terminate the programs by Ctrl-C.


Please don't bother me with ideas like changing the codec/encoder - please focus on the problem of the non popping up window respectively the freezing of the live-stream after the trans-coding started.

Greets

G.

Last edited by Guido Budack (2019-11-28 11:16:51)

Offline

#2 2019-11-28 16:47:55

Guido Budack
Member
From: Switzerland/Philippines
Registered: 2019-05-02
Posts: 19
Website

Re: VLC transcode<->duplicate chain

I see, this post seems to be very interesting. :-|

Since I saw a lot of people struggle while digging in the web for information I will post one more of my own results here.
The following instructions seems to me to be a fair compromise between network load, image quality and cpu load.

cvlc --verbose --no-audio v4l2:///dev/video0 --sout='#transcode{vcodec=theo,venc=theora{quality=7},vb=512,fps=1,scale=0.5,width=640,height=480,threads=4}:standard{access=http,mux=ogg,url=127.0.0.1}'

After additional testing I edited this post as I came to the result that the above one-liner works but doesn't bring the expected result!
The final stream of the above command is a MPEG-4 stream put into a OGG container.
I tried different scenarios and came to the result that the theora codec is not functioning properly in VLC - either while trying to use it for transcoding nor for duplicating or streaming.
I can not get rid of the thought that certain things are 'kept simple' here...

Example: in VLC, if you use the GUI to form a command for the console, these oftentimes don't work or at least are not 1:1 transferable from the GUI output into a console.
Very frustrating and time consuming to find out things which acceptably function.

Actually I use this ->

cvlc --verbose --no-audio --no-sout-audio --width 640 --height 480 v4l2:///dev/video0 --sout='#transcode{vcodec=h264,venc=x264,vb=256,fps=1,acodec=none,scodec=none}:standard{access=file,mux=ts,dst=/home/user/webcam-stream/stream.mp4}'

one-liner now (and still tweaking for lower bandwidth etc) to stream to a local file.


Then I use this ->

sshfs root@x.x.x.x:/where-ever/webcam-stream ~/webcam-stream -o IdentityFile=~/.ssh/id_rsa

after I have read this ->

https://www.digitalocean.com/community/ … s-over-ssh

article to establish a synced mount to my server and the surveillance camera is ready to take over....


Hope it helps someone out there.

Regards.

G.

Last edited by Guido Budack (2019-12-04 11:49:33)

Offline

Board footer

Powered by FluxBB