How to share with a given person the webcam stream? #9

Open
opened 2024-03-28 02:28:19 +01:00 by Benjamin_Loison · 7 comments
Owner

Just to have a look to see what is going on.

Can consider sshfs, making a link with HTTPS...

Just to have a look to see what is going on. Can consider sshfs, making a link with HTTPS...
Author
Owner
~/.ssh/authorized_keys:
no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="env -i bash --noprofile --norc -c 'ffmpeg -an -s 1920x1080 -i /dev/video0 -r 10 -b:v 500k -f matroska -'" ssh-ed25519 CENSORED u0_a298@localhost

works fine.

<details> <summary><code>~/.ssh/authorized_keys</code>:</summary> ``` no-port-forwarding,no-agent-forwarding,no-X11-forwarding,command="env -i bash --noprofile --norc -c 'ffmpeg -an -s 1920x1080 -i /dev/video0 -r 10 -b:v 500k -f matroska -'" ssh-ed25519 CENSORED u0_a298@localhost ``` </details> works fine.
Author
Owner
ssh benjamin_loison@pegasus ffmpeg | ffplay -

works fine, but unclear why without ffmpeg it does not work sometimes.

```bash ssh benjamin_loison@pegasus ffmpeg | ffplay - ``` works fine, but unclear why without `ffmpeg` it does not work sometimes.
Author
Owner
Output:
ffmpeg version 7.1.5-0+deb13u1 Copyright (c) 2000-2026 the FFmpeg developers
  built with gcc 14 (Debian 14.2.0-19)
  configuration: --prefix=/usr --extra-version=0+deb13u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-libmfx --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.101 / 61. 19.101
  libavformat    61.  7.103 / 61.  7.103
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  5.100 / 10.  5.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100
[video4linux2,v4l2 @ 0x55f8d43d2240] Cannot open video device /dev/video0: Permission denied
[in#0 @ 0x55f8d43d2040] Error opening input: Permission denied
Error opening input file /dev/video0.
Error opening input files: Permission denied
Connection to pegasus closed.

with another user.

<details> <summary>Output:</summary> ``` ffmpeg version 7.1.5-0+deb13u1 Copyright (c) 2000-2026 the FFmpeg developers built with gcc 14 (Debian 14.2.0-19) configuration: --prefix=/usr --extra-version=0+deb13u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-libmfx --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libcaca --enable-libdvdnav --enable-libdvdread --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared libavutil 59. 39.100 / 59. 39.100 libavcodec 61. 19.101 / 61. 19.101 libavformat 61. 7.103 / 61. 7.103 libavdevice 61. 3.100 / 61. 3.100 libavfilter 10. 5.100 / 10. 5.100 libswscale 8. 3.100 / 8. 3.100 libswresample 5. 3.100 / 5. 3.100 libpostproc 58. 3.100 / 58. 3.100 [video4linux2,v4l2 @ 0x55f8d43d2240] Cannot open video device /dev/video0: Permission denied [in#0 @ 0x55f8d43d2040] Error opening input: Permission denied Error opening input file /dev/video0. Error opening input files: Permission denied Connection to pegasus closed. ``` </details> with another user.
Author
Owner

DuckDuckGo and Google search Linux /dev/video Permission denied.

The Ask Ubuntu answer 1229284:

ls -lh /dev/video0
crw-rw----+ 1 root video 81, 0 Nov  4 22:53 /dev/video0
DuckDuckGo and Google search *Linux /dev/video Permission denied*. [The Ask Ubuntu answer 1229284](https://askubuntu.com/a/1229284): ```bash ls -lh /dev/video0 ``` ``` crw-rw----+ 1 root video 81, 0 Nov 4 22:53 /dev/video0 ```
Author
Owner
groups
Output:
benjamin_loison cdrom floppy sudo audio dip www-data video plugdev users kvm netdev bluetooth lpadmin scanner libvirt docker

from working user.

groups
CENSORED users

from not working user.

```bash groups ``` <details> <summary>Output:</summary> ``` benjamin_loison cdrom floppy sudo audio dip www-data video plugdev users kvm netdev bluetooth lpadmin scanner libvirt docker ``` </details> from working user. ```bash groups ``` ``` CENSORED users ``` from not working user.
Author
Owner
sudo usermod -a -G video CENSORED

does not return anything and solves the issue.

```bash sudo usermod -a -G video CENSORED ``` does not return anything and solves the issue.
Author
Owner

DuckDuckGo and Google search ssh config IPv4.

~/.ssh/config excerpt:
    # Force IPv4 (source: [the Unix Stack Exchange answer 792088](https://unix.stackexchange.com/a/792088))
    AddressFamily inet
DuckDuckGo and Google search *ssh config IPv4*. <details> <summary><code>~/.ssh/config</code> excerpt:</summary> ``` # Force IPv4 (source: [the Unix Stack Exchange answer 792088](https://unix.stackexchange.com/a/792088)) AddressFamily inet ``` </details>
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Benjamin_Loison/linux#9