New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] rpicam-vid stopped working after bookworm update - libcamera-vid: ERROR: *** libav: unable to open video codec: -22 *** #643
Comments
I got the same error with my stream-recorder. It seems that you have to use the ' --libav-video-codec' option now. When I specify ' --libav-video-codec libx264', it works, but it then reencodes the stream from the sensor with cpu. I still did not find the option to simply copy the raw h264 from the sensor itself, without reencoding it using all my CPU power. The option ' --libav-video-codec copy' does not exist. Does anyone have a codec or a workaround for this? My encoder line: worked until last week. Since the upgrade of the rpicam packages, it gives me the above error message if I do not specify another video codec. Still, I want to use the raw h264 stream directly from the sensor without reencoding it with libav/libx264. |
It seems that the setting "--libav-video-codec h264_v4l2m2m" should work, since it gives me the same error. It does at least not say that it cannot find the codec. So it seems that it should work, but doesn't: root@pi:/home/axel# ./streamfull Even when I try to set the pixel format to yuv420p with the --libav-video-codec-opts "pix_fmt=yuv420p" option, which is not available for the h264_v4l2m2m codec. |
I've tried going back in history and this is still broken on Pi4 (where we use the |
If it helps in finding the bug: I use my own compiled Ffmpeg 6.1.1? /home/axel# ffmpeg But unfortunately this also does not work. |
Unfortunately that's not going to work as the |
I see. Would it help if I compile this ffmpeg fork then? root@pi:/home/axel# less codecs.txt | grep h264 |
It ought to help, we can then see if there have been any changes introduced that caused the breakages. However, I don't know what branch in that repo we use for our releases. @jc-kynesim might be able to help us when he is able to. |
Now removed my ffmpeg, installed the apt one (5.1): And the rpicam line: gives the following error again: [75:35:09.302512040] [1304047] INFO Camera camera_manager.cpp:284 libcamera v0.2.0+46-075b54d5 Seems that we have to wait for @jc-kynesim :) |
@jc-kynesim, the following basic command seems to fail on a Pi 4:
and the relevant libav buffer setup can be found at rpicam-apps/encoder/libav_encoder.cpp Line 399 in 4ffc10e
|
Yup from what I saw everything that use the call - -codec libav will faill since the update. |
Yeah - my fault - I fixed an mmaped dmabuf decode path in ffmpeg in the last released version but broke dmabuf import to encode. Fix will be in the next ffmpeg (which should be fairly soon). |
"Fix will be in the next ffmpeg (which should be fairly soon)" I am seeing the same problem, on a Pi4 with a newly downloaded, installed, and upgraded 64bit Bookworm, and a just today delivered Raspberry Pi Camera Module 3. |
You can click follow, custom and select release on the repo, I think this is the right one @jc-kynesim is that it ? https://github.com/jc-kynesim/rpi-ffmpeg |
There was just an update for ffmpeg and libav, still I have the same error. Probably have to wait for the rpicam-vid update? |
There is no rpicam-vid update needed for this fix. Can you post the output of |
Here my 'ffmpeg -version' output: ffmpeg -version |
That seems to match my ffmpeg version which does work, although I don't know if there was a version bump with this fix. Do you get exactly the same error message with |
Additional: rpicam-vid: error while loading shared libraries: libavcodec.so.60: cannot open shared object file: No such file or directory Although I cannot find a libavcodec60 package. |
Are you manually building |
I built it manually a few weeks ago. But was just doing an "apt reinstall rpicam-apps". So it should actually be fine. l purged libcamera-apps and rpicam-apps-dbgsym. Reinstalled all of them and I get the error: |
This feels like it's trying using your custom build of libav. What does |
Here my outputs: rpicam-vid: ldd $(which rpicam-vid): |
This suggests you might be linking with your local install of
And this also shows it's trying to link to your local install of libav, which is now missing. Try running |
/usr/bin/rpicam-vid also gives me the same error. I cannot simply install a fresh OS, there is many other services up and running here. Will remove everything I find and try again :) Thanks for your help so far! I will post when I found it and/or it works :) |
Another option would be to first purge your local copy of libav libraries, then re-configure and install rpicam-apps. This should hopefully pick up the apt packages versions for libav. |
I downloaded a new install of 64-bit Bookworm yesterday and was expecting a rpicam-vid update |
The update only got pushed this morning, so you need to do an update via apt to get the latest packages. |
Ok, purged everything, reinstalled and reconfigured and it works like a charm again at around 8-9 percent of CPU. THanks for fixing this one! |
Good to hear it's back to working! Resolving this now... |
I confirm it's fixed here too. Thanks guy's! |
Fixed here too on apt-get upgrade. Thanks to all involved! |
Describe the bug
I have a cronjob running for weeks, same command. Worked like a champ untill I updated my raspianos today.
Bug report
encoder-prob.txt
Additional context
It was working for weeks and stopped working after the update. I simply did a "sudo apt update; sudo apt upgrade" on bookwork. I saw no packages being removed, only update as far as I can tell.
I trying running a simple recording and it worked as expected, so it looks related to libav codec/packages:
libcamera-vid -t 3590000 -o "/nfs/Priv/.hidden/priv-pres-$(date +\%Y-\%m-\%d-\%H.\%M).h264" -n --width 1536 --height 864 --tuning-file /usr/share/libcamera/ipa/rpi/vc4/imx708_wide_noir.json --hdr
Here's the list of packages that has been updated. We can see a bunch of libav packages Ex. libavdevice59, libavformat59 has been updated and might sound like a good suspect!
Here's the complete list:
The text was updated successfully, but these errors were encountered: