2

I have set up Janus to streaming H.264 video over WebRTC from a Raspberry Pi. It works when I use Pi Camera. But when I use a USB webcam (Logitech C270), the video doesn't show up in browser.

The configurations and command line parameters are almost identical between Pi Camera streaming and USB webcam streaming. The only difference is with Pi Camera, I am using raspivid to generate H.264 encoded video, which is then piped to ffmpeg to serve as RTP stream. Whereas with USB webcam, I am directly using ffmpeg to take the input from V4L2 device and encode it in H.264.

To be more specific, with Pi Camera, my command is:

raspivid -t 0 -n -fps 20 -pf baseline -b 700000 -o - | ./ffmpeg -re -i - -c:v copy -bsf dump_extra -an -r 20 -f rtp rtp://0.0.0.0:8004?pkt_size=1300

Whereas with USB camera (Legitech C270), my command is:

./ffmpeg -f v4l2 -i /dev/video0 -bsf dump_extra -an -r 20 -codec:v h264_omx -profile:v baseline -f rtp rtp://0.0.0.0:8004?pkt_size=1300

Janus configurations are exactly the same.

There are no errors printed on the Javascript console or Janus console, when the video doesn't show up. chrome://media-internals/ doesn't show any error either.

How can I further debug this problem?

Kenneth Jiang
  • 589
  • 7
  • 13

1 Answers1

0

Are you sure that /dev/video0 is actually your logitech camera? As long as the raspberry pi camera module is connected /dev/video0 would be the pi camera module. Try to find out if you have the correct device.

You might also want to try to create an mp4 file instead of the rtp stream. That way you can at least trace the problem to either ffmpeg or janus. If you get a good mp4 file from ffmpeg the problem is going to be somewhere else.

Do you not have any errors from ffmpeg either?

XPModder
  • 303
  • 4
  • 16