diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index b778181..ea8ee50 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -336,9 +336,15 @@ bool V4L2BufferCache::Entry::operator==(const FrameBuffer &buffer) const
  */
 std::string V4L2PixelFormat::toString() const
 {
-	char str[11];
-	snprintf(str, 11, "0x%08x", fourcc_);
-	return str;
+	std::stringstream ss;
+	ss << static_cast<char>(fourcc_ & 0x7f)
+	   << static_cast<char>((fourcc_ >> 8) & 0x7f)
+	   << static_cast<char>((fourcc_ >> 16) & 0x7f)
+	   << static_cast<char>((fourcc_ >> 24) & 0x7f);
+
+	if (fourcc_ & (1 << 31))
+		ss << "-BE";
+	return ss.str();
 }
 
 /**
