I am trying to stream live on Youtube using a Raspberry Pi Zero W and a raspicam. I have installed ffmpeg using the instructions in this link. I am trying to start the streaming on Youtube using the following command:
ffmpeg -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f v4l2 -codec:v h264 -framerate 30 -video_size 1920x1080 -i /dev/video0 -codec:v copy -f flv rtmp://a.rtmp.youtube.com/live2/stream_key
However, whenever I am running the program I always get the following error:
[video4linux2,v4l2 @ 0x2496530] ioctl(VIDIOC_STREAMON): Operation not permitted /dev/video0: Operation not permitted
I have tried the following steps to sort this issue-
- Adding to the video group with
usermod -aG video my_username
then logging out and logging in again.
- Adding the following /etc/modules-load.d/modules.conf file:
- gpu_mem=128 is already set in the /boot/config.txt file
Nothing seems to set the issue and I still get the same error. The camera starts initially for a few seconds and then closes and shows the error message. I have attached the screenshot of the error message. Please suggest what else can I try to sort this issue. Thanks a lot for your time in advance.