Good companions. It turns out that my Raspberry does not give more than itself when it comes to joining video with audio at good quality and sending it by rtsp. But I think I could send the video in rtsp format and then the audio in mp3, but I would need to join it again on another computer (nas Debian) on my home lan where I have the Shinobi program (security camera manager) installed.
I would need something that can somehow grab the rtsp stream and another mp3 audio and merge them into a new rtsp stream. Is this possible? or is it a crazy idea.
On the one hand I send this, which is the transmission of the camera by rtsp through v4l2rtspserver:
v4l2rtspserver -H 1080 -W 1920 -F 25 -P 8555 /dev/video0
And separately I send an audio in mp3 with sound from a usb microphone through ffmpeg:
ffmpeg -ac 1 -f alsa -i hw:1,0 -acodec libmp3lame -ab 32k -ac 1 -f rtp rtp://192.168.1.77:12348
My idea is to put both things together on a nas server in a new rtsp stream (or another idea).
But I don't know if with ffmpeg I can capture the video from an rtsp video stream and then be able to join it with the mp3 audio and form another new rtsp stream.
Merge these two streams into one and reassemble an rtsp:
rtsp://192.168.1.57:8555/unicast
rtp://192.168.1.77:12348
I have tried this way but it gives me an error:
ffmpeg \
-i rtsp://192.168.1.57:8555/unicast \
-i rtp://192.168.1.37:12348 \
-acodec copy -vcodec libx264 \
-f rtp_mpegts "rtp://192.168.1.77:5000?ttl=2"
Error:
[h264 @ 0x55ac6acaf4c0] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ac6acaf4c0] decode_slice_header error
[h264 @ 0x55ac6acaf4c0] no frame!
[h264 @ 0x55ac6acaf4c0] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x55ac6acaf4c0] decode_slice_header error
[h264 @ 0x55ac6acaf4c0] no frame!
[h264 @ 0x55ac6acaf4c0] non-existing PPS 0 referenced
Last message repeated 1 times
What am I doing wrong?