# Cannot write files in ProRes

**URL:** <https://forum.opencv.org/t/cannot-write-files-in-prores/7939>\
**Category:** Python\
**Tags:** videowriter, ffmpeg, videoio, prores\
**Created:** [March 14, 2022, 8:02pm UTC](https://forum.opencv.org/t/cannot-write-files-in-prores/7939 "2022-03-14T20:02:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zurycutler](https://avatars.discourse-cdn.com/v4/letter/z/b3f665/32.png) [@zurycutler](https://forum.opencv.org/u/zurycutler)\
**Post date:** [March 14, 2022, 8:02pm UTC](https://forum.opencv.org/t/cannot-write-files-in-prores/7939/1 "2022-03-14T20:02:17Z")

</div>

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 is working.

The error message I’m getting is:  
[prores @ 0x7fed5e024400] Specified pixel format yuv420p is invalid or not supported  
[ERROR:0] global /Users/zury.cutler/Documents/OpenCV/opencv/modules/videoio/src/cap\_ffmpeg\_impl.hpp (2794) open Could not open codec prores, error: Unspecified error  
[ERROR:0] global /Users/zury.cutler/Documents/OpenCV/opencv/modules/videoio/src/cap\_ffmpeg\_impl.hpp (2811) open VIDEOIO/FFMPEG: Failed to initialize VideoWriter  
[ERROR:0] global /Users/zury.cutler/Documents/OpenCV/opencv/modules/videoio/src/cap.cpp (597) open VIDEOIO(CV\_IMAGES): raised OpenCV exception:

Does anyone know why I can’t seem to export in ProRes?

System information:  
ffmpeg 4.4.1:  
libavutil 56. 70.100 / 56. 70.100  
libavcodec 58.134.100 / 58.134.100  
libavformat 58. 76.100 / 58. 76.100  
libavdevice 58. 13.100 / 58. 13.100  
libavfilter 7.110.100 / 7.110.100  
libavresample 4. 0. 0 / 4. 0. 0  
libswscale 5. 9.100 / 5. 9.100  
libswresample 3. 9.100 / 3. 9.100  
libpostproc 55. 9.100 / 55. 9.100

opencv: version 4.5.4

python 3.9.7

MacOS 11.5.2 on Intel (not apple silicon)

---

<div class="post-metadata">

**Author:** ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)\
**Post date:** [March 15, 2022, 9:22am UTC](https://forum.opencv.org/t/cannot-write-files-in-prores/7939/2 "2022-03-15T09:22:47Z")

</div>

> [@zurycutler](#):
>
> `[prores @ 0x7fed5e024400] Specified pixel format yuv420p is invalid or not supported`

that error tells me that prores doesn’t like 4:2:0, but something is trying to give it 4:2:0.

something seems to explicitly convert your input (which would be considered 4:4:4) to 4:2:0.

maybe (!) the backend code that interfaces with ffmpeg does that for some reason, or no reason.

you might wanna investigate the source of opencv’s videoio module, specifically the ffmpeg parts, and whether you see any mention of `420` there.

I would hope nobody has hardcoded that. there are plenty of use cases for _non_-chroma-subsampled video.
