I'm trying to live stream the Raspberry Pi camera feed using rtp to a Janus gateway running on the same Raspberry Pi. The Janus and the demo pages are working so far, e.g. the streaming page streams both sample audios to a browser on a different computer.
What I need is a working ffmpeg one-liner to take the camera at /dev/video0 as input and output an rtp stream to Janus, maybe also with a corresponding /opt/janus/etc/janus/janus.plugin.streaming.jcfg
What I've found so far is a working one-liner using raspivid piped into gstreamer but that laggs hard:
raspivid --verbose --nopreview -hf -vf --width 640 --height 480 --framerate 30 --bitrate 1000000 --profile baseline --timeout 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=126 ! udpsink host=127.0.0.1 port=8004
I'm looking for something similar to this (which apparently is not working/playing on the demo page):
ffmpeg -f v4l2 -framerate 30 -video_size 640x480 -codec:v h264 -i /dev/video0 -codec:v libx264 -profile:v baseline -preset ultrafast -tune zerolatency -s 640x480 -b:v 1000k -f rtp rtp://localhost:8004
My /opt/janus/etc/janus/janus.plugin.streaming.jcfg
looks like this (tried with and without commenting out the single line):
h264-sample: {
type = "rtp"
id = 10
description = "H.264 live stream"
audio = false
video = true
videoport = 8004
videopt = 96
videortpmap = "H264/90000"
#videofmtp = "profile-level-id=42e01f;packetization-mode=1"
videofmtp = "packetization-mode=1"
}
Any help is greatly appreciated!