         if let options = self.options {
             return options
         } else {
-            var config: [String: Any] = [AVVideoCodecKey: self.codec.rawValue]
+            var config: [String: Any] = [AVVideoCodecKey: self.codec]
             if self.generateThumbnail {
                 let settings = AVCapturePhotoSettings()
                 // iOS 11 GM fix

                config[AVVideoHeightKey] = NSNumber(integerLiteral: Int(height))
            }

            config[AVVideoCodecKey] = self.codec.rawValue
            
            if let scalingMode = self.scalingMode {
                config[AVVideoScalingModeKey] = scalingMode

    // MARK: - object lifecycle
    
    override init() {
        self.codec = AVVideoCodecJPEG
        self.generateThumbnail = false
        self.flashMode = .off
        super.init()
