exander
Posts: 13
Joined: Fri Feb 06, 2015 12:25 pm

WebRTC V8/WebM

Sun Feb 08, 2015 10:21 pm

Hi, what is the support of WebRTC in Firefox or Chromium?

When I do:

Code: Select all

uv4l --driver raspicam --auto-video_nr --encoding h264 --width 640 --height 480
Camera is correctly recognized in Firefox (getUserMedia), but not in Chromium, but then I get an error.

exander
Posts: 13
Joined: Fri Feb 06, 2015 12:25 pm

Re: WebRTC V8/WebM

Tue Feb 10, 2015 6:59 pm

Anyone has any knowledge about this?

ghans
Posts: 7874
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: WebRTC V8/WebM

Tue Feb 10, 2015 7:08 pm

Tried the official driver instead ?

Code: Select all

sudo modprobe bcm2835-v4l2
ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: WebRTC V8/WebM

Wed Feb 11, 2015 2:52 am

Chromi does not (yet) support H.264 in WebRTC.

exander
Posts: 13
Joined: Fri Feb 06, 2015 12:25 pm

Re: WebRTC V8/WebM

Thu Feb 12, 2015 3:18 pm

towolf wrote:Chromi does not (yet) support H.264 in WebRTC.
Yes, I figured that out, so I am mainly testing in Firefox.

exander
Posts: 13
Joined: Fri Feb 06, 2015 12:25 pm

Re: WebRTC V8/WebM

Thu Feb 12, 2015 3:20 pm

ghans wrote:Tried the official driver instead ?

Code: Select all

sudo modprobe bcm2835-v4l2
ghans
Tried that, it worked once. But it is not working now.

Also, when I turn on camera, my display goes black. Could it be low amps powersource? I have 2A.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: WebRTC V8/WebM

Thu Feb 12, 2015 6:26 pm

I’ve tried to look into WebRTC and got a simple demo working fine.

Found a short introduction into simple Janus WebRTC server and decided to try it out.
  • Compiled the "janus" server (on Arch, so no instructions I can give for Raspbian, but it is in the README)

    ./configure line I used was

    Code: Select all

    ./configure --prefix=/opt/janus --disable-websockets --disable-data-channels --disable-rabbitmq --disable-docs
  • Changed in renamed /opt/janus/etc/janus/janus.cfg

    Code: Select all

    [general]
    configs_folder = /opt/janus/etc/janus		; Configuration files folder
    plugins_folder = /opt/janus/lib/janus/plugins		; Plugins folder
    
  • Changed in renamed /opt/janus/etc/janus/janus.plugin.streaming.cfg

    Code: Select all

    [gst-raspicam]
    type = rtp
    id = 1
    description = H.264 live streaming from Raspicam
    audio = no
    video = yes
    videoport = 8004
    videopt = 96
    videortpmap = H264/90000
    videofmtp = profile-level-id=42e028\;packetization-mode=1
    
    Every other default stream commented out
  • Copy janus/html subdirectory to web root /www/janus of my nginx web server. Internal web server of janus is for webrtc signaling, not for "demo" files and menus. I used separate nginx web server for those files in janus/html. nginx serves on port 80, and janus internal web server serves on port 8088. This agrees with included demo setup.
  • Then ran stream with GStreamer 1.0 gst-launch in one SSH shell

    Code: Select all

    raspivid --verbose --nopreview --width 640 --height 480 --framerate 15 --bitrate 1000000 --profile baseline --timeout 0 -o - | gst-launch-1.0 -v fdsrc !  h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=8004
    Would prefer v4l2 driver, but that isn’t working anymore right now. Uv4l driver not suitable.
  • Finally start janus server in another SSH shell

    Code: Select all

    /opt/janus/bin/janus -F /opt/janus/etc/janus/
Finally go to Firefox (I have Firefox 36.0) and go to <http://raspberrypi.lan/janus> (substitute hostname for what your Rpi is named). Naviate to "Demos" then "Streaming". Select Stream and Start it. It will show this:
Image

It is quite low latency. Not as low as « gst-launch udpsink | gst-launch udpsrc ». I made simple test with on-screen clock:

Image
Image
Image
Image

Seems to be 300-600 ms delay. I get 150-200ms delay with pure GStreamer RTP pipelines.

RpiName
Posts: 712
Joined: Sat Jul 06, 2013 3:14 am

Re: WebRTC V8/WebM

Sun Feb 22, 2015 9:27 pm

exander wrote:what is the support of WebRTC in Firefox or Chromium?

When I do:

Code: Select all

uv4l --driver raspicam --auto-video_nr --encoding h264 --width 640 --height 480
Camera is correctly recognized in Firefox (getUserMedia), but not in Chromium, but then I get an error.
According to a previous announcement at the UV4L homepage, UV4L will soon (also) be native webrtc client itself. So hopefully it will be possible to access the camera in real-time from anywhere with any browser.

RpiName
Posts: 712
Joined: Sat Jul 06, 2013 3:14 am

Re: WebRTC V8/WebM

Sun Mar 22, 2015 6:12 pm

You may want to follow this post for WebRTC with UV4L:

http://www.raspberrypi.org/forums/viewt ... 3&t=105019

deivid
Posts: 46
Joined: Thu Oct 23, 2014 7:08 am

Re: WebRTC V8/WebM

Sat May 23, 2015 5:45 am

At the moment I'm using a pi 1 (seems like my new pi2 broke) streaming h264+aac over rtmp.
I'd like to use janus to "convert" a file (later it'll be the rtmp feed) to "webrtc"

I've disabled the audio on ffmpeg because I don't know how to deal with it on gstreamer. Could you help me? (I know ffmpeg, never used gstreamer)

Code: Select all

ffmpeg -re -i clase.mp4 -c:v libx264 -g 8 -vprofile baseline -an -f h264 pipe:1 | gst-launch-1.0 -v fdsrc !  h264parse ! rtph264pay config-interval=1 pt=96 ! udpsink host=127.0.0.1 port=8004

Return to “General discussion”