I am attempting to write a video file using opencv in the ProRes 4444 codec. I have tried other codecs, such as XVID, and the code works perfectly, however no ProRes codec of any kind, nor DNxHD seem to be working.
Relavent code:
#Above code specifies clipName, which increments for each clip created in the loop below
subClip = cv2.VideoWriter(clipName, cv2.VideoWriter_fourcc(*‘apch’), 24, size)
#Adds frames to subClip
f = 0
#clipRange contains new frames every time this code is run
while f < len(clipRange):
subClip.write(clipRange[f])
f += 1
print(“Clip Created”)
subClip.release()
I get the following error message:
[prores @ 0x7fb8e4986600] Specified pixel format yuv420p is invalid or not supported [ERROR:0] global /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-req-build-xxsyexfp/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2774) open Could not open codec prores, error: Unspecified error [ERROR:0] global /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-req-build-xxsyexfp/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp (2791) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter
I believe that opencv is looking for ffmpeg’s files in a location where they are not currently located. The directory it writes here “/private/var/folders/24” does not exist, nor can I find cap_ffmpeg_impl.hpp anywhere on my machine.
When I run cv.getBuildInformation(), I can see that FFMPEG is working:
Video I/O:
FFMPEG: YES
- avcodec: YES (58.134.100)
- avformat: YES (58.76.100)
- avutil: YES (56.70.100)
- swscale: YES (5.9.100)
- avresample: YES (4.0.0)
Settings:
- OpenCV 4.5.3
- MacOS 11.5.2 on Intel (not apple silicon)
- Python 3.8.8
- ffmpeg 4.2.2
built with clang version 4.0.1 (tags/RELEASE_401/final)
configuration: --prefix=/Users/zury.cutler/opt/anaconda3 --cc=x86_64-apple-darwin13.4.0-clang --disable-doc --enable-avresample --enable-gmp --enable-hardcoded-tables --enable-libfreetype --enable-libvpx --enable-pthreads --enable-libopus --enable-postproc --enable-pic --enable-pthreads --enable-shared --enable-static --enable-version3 --enable-zlib --enable-libmp3lame --disable-nonfree --enable-gpl --enable-gnutls --disable-openssl --enable-libopenh264 --enable-libx264
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100