Open cynecx opened 4 years ago
I get the same bug with the same config incl. kernel version, etc.
Feb 12 2020 12:39:27
Copyright (c) 2012 Broadcom
version 53a54c770c493957d99bf49762dfabc4eee00e45 (clean) (release) (start_x)
Uname -a
Linux client1 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux
Just for a note - it's not a bug: set
gpu_mem=256
in /boot/config.txt
and it's fine.
gpu_mem=256
sounds a touch excessive, but I haven't checked it out.
You can use sudo vcdbg reloc
to show how much gpu_mem is in use whilst you are streaming, and then amend the value accordingly.
@6by9 Thanks, but because I don't have any other tasks rather then copy and upload h264, it's fine for me to use 256.
Still facing the same problem with RPI 4 Model B now in 2022.
Tweak gpu_mem=256
only helped to go up to 1280x720@60 but any resolution higher than that still resulted in ioctl(VIDIOC_STREAMON): Operation not permitted
.
After coming across a similar problem and a recommendation to tweak over_voltage=1
and force_turbo
options, I ignored the tweaks and simply tried different 3A power adapters.
With a different 3A power supply I finally got it working at 1920x1080@30.
helped to go up to 1280x720@60 but any resolution higher than that still resulted in ioctl(VIDIOC_STREAMON): Operation not permitted.
Be aware of H264 levels - https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels
The hardware spec is for level 4.1, or 245,760 16x16 macroblocks/sec, and that is the default for the driver. That translates to 1080p30.1, or 720p68.3. The encoder validates the configuration of level, framerate, and resolution and will refuse to start if invalid. Increasing the resolution above 720p at 60fps is likely to be invalid.
The V4L2 drivers do have an H264 level control and will allow selection of level 4.2, but it is not 100% guaranteed to achieve the frame rate.
Describe the bug I am getting
bcm2835-v4l2: Failed to enable capture port - error -1. Disabling camera port again
when trying to capture camera data with ffmpeg.To reproduce Run
ffmpeg -f video4linux2 -input_format h264 -video_size 1920x1080 -framerate 30 -i /dev/video0 -vcodec copy -an test3.h264
. It should fail with:dmesg:
Expected behaviour The ffmpeg command should succeed and start capturing the raw h264 stream.
This however,
ffmpeg -f video4linux2 -input_format h264 -video_size 1280x720 -framerate 30 -i /dev/video0 -vcodec copy -an test3.h264
(notice the difference resolution) works just fine.Also raspivid also works correctly with 1080p resolution.
Actual behaviour See above.
System Copy and paste the results of the raspinfo command in to this section. Alternatively, copy and paste a pastebin link, or add answers to the following questions:
vcgencmd version
)?uname -a
)?Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu Jan 30 13:15:58 GMT 2020 armv7l GNU/Linux