last day (15 days later) » 

09:45
15
A: Use webcam from laptop on desktop pc

RaffaAsuming both machines are connected in a network and the PC can reach the laptop's IP. Please follow these steps: On the laptop Install v4l-utils and ffmpeg by running: sudo apt install v4l-utils ffmpeg Install matroska media container like so: sudo apt install libmatroska6v5 Run the following ...

@JohnDoe This means missing v4l2 format. Install it by running sudo apt install v4l-utils ffmpeg on both
@JohnDoe run sudo modprobe -r v4l2loopback then run ls /dev/video* and note the existing cameras like /dev/video0 /dev/video1 /dev/video2 ... etc then run sudo modprobe v4l2loopback exclusive_capse=1 and run again ls /dev/video* a new camera will be added like so /dev/video0 /dev/video1 /dev/video2 /dev/video3 use the new camera in the commands under test instead of /dev/video0
@JohnDoe Did you install v4l2loopback this way sudo apt install v4l2loopback-dkms v4l2loopback-utils?
@JohnDoe Try this from the PC instead nc Laptop_IP 9999 | mplayer - and if it works then it is most likely v4l2loopback is the cause. so reinstall it the right way or the package available for Ubuntu 18.0 is outdated, I tested it on Ubuntu 19.10 and it works flawlessly.
@JohnDoe Check the version with apt policy v4l2loopback-utils v4l2loopback-dkms. I tested it on version 0.12.2-1 of v4l2loopback
@JohnDoe Answer updated to minimize latency
@JohnDoe No problem. Please check the updated answer. There will be sound latency because no compression is used.
I'm getting pipe:: Invalid data found when processing inputKB sq= 0B f=0/0 when I run nc Laptop_IP 9999 | ffmpeg -i /dev/stdin -codec copy -f v4l2 /dev/video0
@FitzWatson Yoy need to change Laptop_IP to the actual IP of the laptop which can be something like 192.168.1.116 for example. Use the GUI of network manager or run ip address in the terminal to find out what the actual laptop's IP is and use that instead.
I'm streaming from user A in laptop to user B in the same laptop. So I replaced it with localhost. Is that ok?
I've followed this guide and am now trying to get webcam in the xephyr session
@FitzWatson Yes localhost or 127.0.0.1 should work, but open a new terminal for that command and leave the first terminal open to keep ffmpeg -i /dev/video0 -codec copy -f matroska - | nc -l 9999 running . I have not looked at the link you provided though and do not know whether it is compatible or not.
09:45
I did this: 1) Opened new terminal and ran ffmpeg -i /dev/video0 -codec copy -f matroska - | nc -l 9999. Webcam led on. 2) Opened new terminal and ran nc 127.0.0.1 9999 | ffmpeg -i /dev/stdin -codec copy -f v4l2 /dev/video0. 3) This gave /dev/stdin: Invalid data found when processing input
@FitzWatson Test it with nc 127.0.0.1 9999 | mplayer - in the second terminal instead and make sure the command in the first terminal is running and if it works then you need to work with the format and see what is best for your solution. This test should work if you have followed the instructions in the answer correctly.
This is the output of the mplayer command. pastebin.com/4eq4KjQs
If I add lirc=no in .mplayer/config, it changes to: pastebin.com/ukNEiemP
I apologize I do not have much time on hand but have you tried vlc
nc 127.0.0.1 9999 | vlc -
or ffplay
nc 127.0.0.1 9999 | ffplay -
to rule out format issues
Yes, it looks like format issue
try vlc or ffplay
there is a reason I added those as extra test methods in my answer
not all formats are supported on all systems the same way
that is always what gives people hard time
formats support
any luck with vlc or ffplay?
10:01
Here's the ffplay output: pastebin.com/iRrNr5mY
The command in the first terminal exits and the Camera LED goes off. you need to restart the command in the first terminal and make sure Camera LED is on each time before testing in the second terminal :)
the led was on in all the tests
restart the comand and test with vlc again
-- logger module started --
main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
mjpeg error: cannot peek
-- logger module stopped --
This is the vlc log file
Ctrl+c in the first terminal then rerun the first command
Vlc output normal
but any video?
10:06
@Raffa Could you explain what this msg means?
yes
there is another version of vlc
called headless vlc
o cvlc
I should use that?
for running vlc with no configured display
that is just a general message when you run vlc from terminal it assumes that no display is connected or configured and prints an advice
you have a display
no
yes
it's a laptop
$ nc 127.0.0.1 9999 | cvlc -
VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e)
This command doesn't exit
I waited 10 secs and then did Ctrl+C
OK?
10:10
It didn't play anything either
should we first try streaming a mp4?
I suggest you reboot your system and follow the instructions in the answer again and test from the second terminal with vlc first then ffplay them mplayer like in the answer
If that did not work I suggest you post anew question
I apologize again I have to go now.
Ok. Thanks for your assisstance
I wish I could help more.
bye
Bye mate :)

last day (15 days later) »