gounthar
Posts: 29
Joined: Mon Jul 29, 2013 1:39 pm

v4l2rtspserver and raspidisp

Wed Nov 07, 2018 5:04 pm

Hi,

I have two Raspberry Pi 3B+ running Stretch on hand. On one of them, I have installed v4l2rtspserver and a CSI camera, and I have a rtsp stream that works wonder.
I would love to do almost the same for the second one, except it has no camera. I am trying to use raspidisp to create a rtsp stream from the HDMI output.
Is it possible?

Code: Select all

pi@raspberrypi:~ $ sudo service uv4l_raspidisp status
● uv4l_raspidisp.service - UV4L Raspicam
   Loaded: loaded (/etc/systemd/system/uv4l_raspidisp.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-11-07 17:48:01 CET; 13min ago
 Main PID: 328 (uv4l)
   CGroup: /system.slice/uv4l_raspidisp.service
           └─328 /usr/bin/uv4l -f -k --sched-fifo --mem-lock --config-file=/etc/uv4l/uv4l-raspidisp.conf --driver raspidisp --driver-config-file=/etc/uv4l/uv4l-raspidisp.conf --server-option=-

nov. 07 17:48:01 raspberrypi uv4l[328]: <notice> [core] Loading driver 'raspidisp' from external plug-in's...
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [driver] RaspiDisp Video4Linux2 Driver built Oct  7 2018
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [core] Device detected!
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [core] Trying to load the the Streaming Server plug-in...
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [server] HTTP/HTTPS Streaming & WebRTC Signalling Server v1.1.118 built on Oct  7 2018
nov. 07 17:48:02 raspberrypi uv4l[328]: <warning> [server] SSL is not enabled for the Streaming Server. Using unsecure HTTP.
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [core] Streaming Server loaded!
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [core] Registering device node /dev/video1
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [driver] input display #0 res.: 1920x1080 30fps, crop. window: 0 0 1920 1080, output res.: 1920x1080
nov. 07 17:48:02 raspberrypi uv4l[328]: <notice> [server] Web Streaming Server listening on port 9080
I guess I installed too many things, as I don't need the web streaming server... Anyway.

But I have this output:

Code: Select all

 ./v4l2rtspserver -I 0.0.0.0 -P 2222 -v /dev/video1,hw:0,0
log level:600

[NOTICE] /home/pi/v4l2rtspserver/src/main.cpp:623
        Create V4L2 Source.../dev/video1
[NOTICE] src/V4l2Device.cpp:117
        driver:raspidisp capabilities:5000001 mandatory:4000001
[NOTICE] src/V4l2Device.cpp:120
        /dev/video1 support capture
[NOTICE] src/V4l2Device.cpp:122
        /dev/video1 support read/write
[NOTICE] src/V4l2Device.cpp:123
        /dev/video1 support streaming
[NOTICE] src/V4l2Device.cpp:147
        /dev/video1:YU12 size:1920x1080
[ERROR] src/V4l2Device.cpp:195
        Cannot set pixelformat to:H264 format is:YU12
[ERROR] src/V4l2Device.cpp:195
        Cannot set pixelformat to:MJPG format is:YU12
[ERROR] src/V4l2Device.cpp:67
VIDIOC_STREAMOFF: Bad file descriptor
VIDIOC_REQBUFS: Bad file descriptor
        Cannot init device:/dev/video1
So I tried this

Code: Select all

    v4l2-ctl -d /dev/video1 --list-formats
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'YU12'
        Name        : YUV420
I have read there that I could use v4l2compress in order to transform to h264:

Code: Select all

v4l2compress_h264 /dev/video0 /dev/video10 &
Unfortunately, it uses a kernel module I have yet to compile...

Code: Select all

modprobe v4l2loopback video_nr=10
modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/4.14.71-v7+
I can't find the right kernel source for the time being...

Code: Select all

Building v4l2-loopback driver...
make -C /lib/modules/`uname -r`/build M=/home/pi/v4l2loopback modules
make[1]: *** /lib/modules/4.14.71-v7+/build : Aucun fichier ou dossier de ce type. Arrêt.
Makefile:42 : la recette pour la cible « v4l2loopback.ko » a échouée
make: *** [v4l2loopback.ko] Erreur 2
Thanks.
2*3B at home for the kids
7*3B+ at work for serious business (gitlab-runner, broadcasting conference, openSTF server...)
Hoping to get a few hats in the following weeks

gounthar
Posts: 29
Joined: Mon Jul 29, 2013 1:39 pm

Re: v4l2rtspserver and raspidisp

Wed Nov 07, 2018 6:26 pm

Call me stupid, I just did:

Code: Select all

pi@raspberrypi:~/v4l2loopback $ sudo apt-get install raspberrypi-kernel-headers
and...

Code: Select all

make -C /lib/modules/`uname -r`/build M=/home/pi/v4l2loopback modules
make[1] : on entre dans le répertoire « /usr/src/linux-headers-4.14.71-v7+ »
  CC [M]  /home/pi/v4l2loopback/v4l2loopback.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/pi/v4l2loopback/v4l2loopback.mod.o
  LD [M]  /home/pi/v4l2loopback/v4l2loopback.ko
make[1] : on quitte le répertoire « /usr/src/linux-headers-4.14.71-v7+ »
2*3B at home for the kids
7*3B+ at work for serious business (gitlab-runner, broadcasting conference, openSTF server...)
Hoping to get a few hats in the following weeks

stealthmaster
Posts: 2
Joined: Tue Apr 05, 2016 4:16 pm

Re: v4l2rtspserver and raspidisp

Sat Dec 15, 2018 5:01 pm

Did you ever succeed to make rtsp stream of the raspidisp?

gounthar
Posts: 29
Joined: Mon Jul 29, 2013 1:39 pm

Re: v4l2rtspserver and raspidisp

Sat Dec 15, 2018 5:08 pm

Unfortunately no, but I will retry one of these days...
2*3B at home for the kids
7*3B+ at work for serious business (gitlab-runner, broadcasting conference, openSTF server...)
Hoping to get a few hats in the following weeks

Return to “Graphics, sound and multimedia”