2

I'm looking to use Janus Gateway to stream very low latency to a thousand viewers from a single source.

I'm aiming for VP8 video streaming since H.264 support hasn't dropped in Chrome yet.

My config is

[gst-rpwc]
type = rtp
id = 1
description = Test Stream
audio = no
video = yes
videoport = 8004
videopt = 100
videortpmap = VP8/90000

I'm testing initially on OSX with the built in webcam. This is the pipeline

ffmpeg -f avfoundation  -video_size 640x480 -framerate 30 -i "0" -b:v 800k -c:v libvpx rtp://x.x.x.x:8004

But my CPU on a Retina Macbook Pro is at 100% the entire time and I'm only getting a few frames every few seconds on the client end. I believe the conversion from the built in iSight camera to VP8 is too intensive. Is there a way to make this conversion more effecient?

Titan
  • 5,567
  • 9
  • 55
  • 90

1 Answers1

2

I'm no expert on Janus, but for a WebRTC VP8 stream, the videofmtp you have doesn't make sense as that string is for h.264 and to a lesser extent, the videopt isn't what I've seen for VP8, that value should be 100. The biggest issue here is that ffmpeg can't do DTLS, so even with the mods I've specified, this will probably not work.

Paul Gregoire
  • 9,715
  • 11
  • 67
  • 131
  • 1
    I've made some edits to my original question to reflect changes made recently. You are right about the videofmtp and videopt. – Titan Jun 02 '16 at 13:05
  • Can't remember the option, but try setting the pix format to YUV420 – Paul Gregoire Jun 02 '16 at 13:32
  • 1
    I've got it "working" with `ffmpeg -f avfoundation -video_size 640x480 -framerate 30 -i "0" -c:v libvpx -f rtp rtp://x.x.x.x:8004` however the video on the browser only shows 1 or 2 frames every 10 seconds or longer. I think the stream itself from the publisher (my laptop) is struggling as illustrated by this gif, notice how it struggles to advance the frames... http://f.cl.ly/items/1l0L0w3M182O363F2Z1w/Screen%20Recording%202016-06-02%20at%2002.47%20pm.gif – Titan Jun 02 '16 at 13:46
  • You'll probably want to ensure your bandwidth is set properly to accommodate 30 fps at those dimensions – Paul Gregoire Jun 03 '16 at 02:18
  • When I run ffmpeg with the above my Retina Macbook Pro CPU is at 100% the entire time so I think it's an issue with it being too resource hungry converting to VP8. I've updated the question to reflect the latest issue. – Titan Jun 03 '16 at 07:48
  • I'd try swapping things around a bit and adding crf like so `ffmpeg -f avfoundation -video_size 640x480 -framerate 30 -i "0" -c:v libvpx -crf 10 -b:v 800k rtp://x.x.x.x:8004` – Paul Gregoire Jun 03 '16 at 12:47
  • 2
    I had good results with `ffmpeg -f avfoundation -pix_fmt uyvy422 -video_size 640x480 -framerate 30 -i "0" -an -c:v libvpx -deadline realtime -f rtp rtp://x.x.x.x:8004` "-deadline realtime" – Titan Jun 03 '16 at 18:54