Index: trunk/ppMerge/src/ppMergeOptions.c
===================================================================
--- trunk/ppMerge/src/ppMergeOptions.c	(revision 7067)
+++ trunk/ppMerge/src/ppMergeOptions.c	(revision 7073)
@@ -14,4 +14,5 @@
     )
 {
+    psFree(options->format);
     psFree(options->combine);
 }
@@ -23,4 +24,5 @@
     psMemSetDeallocator(options, (psFreeFunc)mergeOptionsFree);
 
+    options->format = NULL;
     options->rows = 0;
     options->minElectrons = NAN;
@@ -91,4 +93,32 @@
     ppMergeOptions *options = ppMergeOptionsAlloc(); // The merge options
 
+    // We need to work out the camera before we can get the recipe.  Take the first input and inspect it.
+    if (!config->camera) {
+        psArray *filenames = psMetadataLookupPtr(NULL, config->arguments, "INPUT"); // The input file names
+        psFits *inFile = psFitsOpen(filenames->data[0], "r"); // The FITS file to read
+        if (!inFile) {
+            psError(PS_ERR_IO, false, "Unable to open input file %s to determine camera.\n",
+                    filenames->data[0]);
+            exit(EXIT_FAILURE);
+        }
+        psMetadata *header = psFitsReadHeader(NULL, inFile); // The FITS (primary) header
+        psFitsClose(inFile);
+
+        options->format = pmConfigCameraFormatFromHeader(config, header);
+        psFree(header);
+        if (!options->format) {
+            psLogMsg(__func__, PS_LOG_WARN, "Unable to identify camera format for input file %s\n",
+                     filenames->data[0]);
+            exit(EXIT_FAILURE);
+        }
+    }
+
+    // Get the recipes
+    if (!config->recipes && !pmConfigReadRecipes(config)) {
+        psError(PS_ERR_IO, false, "Unable to read recipes.\n");
+        exit(EXIT_FAILURE);
+    }
+
+    // Now we can read the recipe
     bool mdok = true;                   // Status of MD lookup
     psMetadata *recipe = psMetadataLookupMD(&mdok, config->recipes, RECIPENAME); // Recipe information
