soyersoyer / fmp4streamer

Fmp4streamer streams your V4L2 camera directly to any browser and media player as MP4 (H264).
Apache License 2.0
80 stars 7 forks source link

getting error whenever trying to stream through raspberry pi #4

Closed yogii786 closed 2 years ago

yogii786 commented 2 years ago

ERROR:root:V4L2Camera: can't read SPS and PPS from the first frame

soyersoyer commented 2 years ago

Does your camera support h264 format? You can check with: $ v4l2-ctl --list-formats

yogii786 commented 2 years ago

here I attached screenshot of listed formats could you please check and let me know sugggested camera which support H264 format? Screenshot from 2022-01-05 10-31-48

yogii786 commented 2 years ago

using usb camera IMX291

soyersoyer commented 2 years ago

It works with the pi camera boards (with the old camera stack) or any usb uvc camera which supports the h264 format. You can find some here: https://en.everybodywiki.com/List_of_cameras_with_onboard_video_compression

I have already started working on encoding the YUYV format with the V4L2 m2m encoder on the pi. Stay tuned!

fcoury commented 2 years ago

Not sure if related, but I am getting this:

Traceback (most recent call last): File "/home/pi/fmp4streamer/fmp4streamer.py", line 271, in camera = V4L2Camera(device, dict(config.items(device))) File "/home/pi/fmp4streamer/v4l2camera.py", line 35, in init self.init_fps(int(params.get('fps'))) File "/home/pi/fmp4streamer/v4l2camera.py", line 66, in init_fps ioctl(self.fd, v4l2.VIDIOC_S_PARM, parm) OSError: [Errno 25] Inappropriate ioctl for device

I can stream fine using gst-launch-1.0.

fcoury commented 2 years ago

After removing a couple of ioctl calls I am left with the same error:

ERROR:root:V4L2Camera: can't read SPS and PPS from the first frame

I would also be interested on the YUYV format.

yogii786 commented 2 years ago

Hi @fcoury could you please share your Gstreamer pipeline so that I can use that

yogii786 commented 2 years ago

Imx291 usb camera supports H264 format hence I checked by printing sps and pps there values are 2 and 2 respectively

soyersoyer commented 2 years ago

Try the 3.1.0 version and read the Readme for the configuration.

soyersoyer commented 2 years ago

@yogii786 Please try the v3.2.0 with the capture_format = MJPGH264 configuration option.

soyersoyer commented 2 years ago

Feel free to open, if you have any other questions.