diff --git a/src/media/media_encoder.cpp b/src/media/media_encoder.cpp
index 4849facc7ae34825a115380aed813e0a0466e9d8..62598a6cabae9625338344553564f59e91c68f1b 100644
--- a/src/media/media_encoder.cpp
+++ b/src/media/media_encoder.cpp
@@ -564,8 +564,11 @@ MediaEncoder::prepareEncoderContext(AVCodec* outputCodec, bool is_video)
         encoderCtx->max_b_frames = 0;
         encoderCtx->pix_fmt = AV_PIX_FMT_YUV420P;
 #ifdef RING_ACCEL
+// Keep YUV format for macOS
+#if !(defined(__APPLE__) && !TARGET_OS_IOS)
         if (accel_)
             encoderCtx->pix_fmt = accel_->getFormat();
+#endif
 #endif
 
         // Fri Jul 22 11:37:59 EDT 2011:tmatth:XXX: DON'T set this, we want our
diff --git a/src/media/video/accel.cpp b/src/media/video/accel.cpp
index 46a05bc70520c923b06f18d00534c2137c9b82ed..b76163629b8f11b119df3ac8e197d9b3e819272a 100644
--- a/src/media/video/accel.cpp
+++ b/src/media/video/accel.cpp
@@ -335,7 +335,7 @@ HardwareAccel::initAPI(bool linkable, AVBufferRef* framesCtx)
         if (linkable && framesCtx)
             link = linkHardware(framesCtx);
         // we don't need frame context for videotoolbox
-        if (format_ == AV_PIX_FMT_VIDEOTOOLBOX || link || initFrame()) {
+        if (hwType_ == AV_HWDEVICE_TYPE_VIDEOTOOLBOX || link || initFrame()) {
             return 0;
         }
     }