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?