diff --git a/src/cam/stream_options.cpp b/src/cam/stream_options.cpp
index bd12c8f..b163177 100644
--- a/src/cam/stream_options.cpp
+++ b/src/cam/stream_options.cpp
@@ -7,6 +7,7 @@
 #include "stream_options.h"
 
 #include <iostream>
+#include <iterator>
 
 using namespace libcamera;
 
@@ -19,7 +20,7 @@ StreamKeyValueParser::StreamKeyValueParser()
 		  ArgumentRequired);
 	addOption("height", OptionInteger, "Height in pixels",
 		  ArgumentRequired);
-	addOption("pixelformat", OptionInteger, "Pixel format",
+	addOption("pixelformat", OptionString, "Pixel format name",
 		  ArgumentRequired);
 }
 
@@ -96,8 +97,16 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,
 		}
 
 		/* \todo Translate 4CC string to pixelformat with modifier. */
-		if (opts.isSet("pixelformat"))
-			cfg.pixelFormat = PixelFormat(opts["pixelformat"]);
+		if (opts.isSet("pixelformat")) {
+			const StreamFormats &formats = cfg.formats();
+			std::vector<PixelFormat> pixelFormats = formats.pixelformats();
+			std::vector<PixelFormat>::iterator ptr;
+			for (ptr = pixelFormats.begin(); ptr < pixelFormats.end(); ptr++) {
+				if (opts["pixelformat"].toString() == ptr->toString()) {
+					cfg.pixelFormat = PixelFormat(*ptr);
+				}
+			}
+		}
 	}
 
 	return 0;
