Index: src/new_slideshow.c
===================================================================
--- src/new_slideshow.c	(Revision 591)
+++ src/new_slideshow.c	(Arbeitskopie)
@@ -122,9 +122,11 @@
 		gtk_list_store_set( store, &iter, 0, "FLV (Flash Video)", -1 );
 		gtk_list_store_append( store, &iter );
 		gtk_list_store_set( store, &iter, 0, "3GP (Mobile Phones)", -1 );
-/* Disable MP4 export or 3.0 release
+/* Disable MP4 export or 3.0 release */
 		gtk_list_store_append( store, &iter );
-		gtk_list_store_set( store, &iter, 0, "MP4 (MPEG-4)", -1 ); */
+		gtk_list_store_set( store, &iter, 0, "MP4 (MPEG-4)", -1 );
+		gtk_list_store_append( store, &iter );
+		gtk_list_store_set( store, &iter, 0, "Custom", -1 );
 	}
 
 	label_frame1 = gtk_label_new (_("<b>Video Format</b>"));
@@ -347,6 +350,23 @@
 			gtk_list_store_append( store, &iter );
 			gtk_list_store_set( store, &iter, 0, "1920 x 1080", -1 );
 		break;
+
+		case 5:
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "640 x 480 4:3", -1 );
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "768 x 576", -1 );
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "800 x 600", -1 );
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "1024 x 768", -1 );
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "1280 x 720 16:9", -1 );
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "1920 x 1080", -1 );
+			gtk_list_store_append( store, &iter );
+			gtk_list_store_set( store, &iter, 0, "1680 x 1050 16:10", -1 );
+		break;
 	}
 	gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo),0);
 }
@@ -493,6 +513,47 @@
 				break;
 			}
 		break;
+
+		case 5: /* Custom */
+			img->video_format = 'C';
+			switch (gtk_combo_box_get_active(GTK_COMBO_BOX(img->video_size_combo)) )
+			{
+				case 0:
+				img->video_size[0] = 640;
+				img->video_size[1] = 480;
+				break;
+
+				case 1:
+				img->video_size[0] = 768;
+				img->video_size[1] = 576;
+				break;
+
+				case 2:
+				img->video_size[0] = 800;
+				img->video_size[1] = 600;
+				break;
+
+				case 3:
+				img->video_size[0] = 1024;
+				img->video_size[1] = 768;
+				break;
+
+				case 4:
+				img->video_size[0] = 1280;
+				img->video_size[1] = 720;
+				break;
+
+				case 5:
+				img->video_size[0] = 1920;
+				img->video_size[1] = 1080;
+				break;
+
+				case 6:
+				img->video_size[0] = 1680;
+				img->video_size[1] = 1050;
+				break;
+			}
+		break;
 	}
 }
 
@@ -655,6 +716,40 @@
 				break;
 			}
 		break;
+
+		case 'C':
+			gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_format_combo), 5);
+			switch (img->video_size[1])
+			{
+				case 480:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 0);
+				break;
+
+				case 576:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 1);
+				break;
+
+				case 600:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 2);
+				break;
+
+				case 768:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 3);
+				break;
+
+				case 720:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 4);
+				break;
+
+				case 1080:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 5);
+				break;
+
+				case 1050:
+				gtk_combo_box_set_active(GTK_COMBO_BOX(img->video_size_combo), 6);
+				break;
+			}
+		break;
 	}
 }
 
Index: src/export.c
===================================================================
--- src/export.c	(Revision 591)
+++ src/export.c	(Arbeitskopie)
@@ -65,6 +65,8 @@
 img_exporter_flv( img_window_struct *img );
 static void
 img_exporter_3gp( img_window_struct *img );
+static void
+img_exporter_custom( img_window_struct *img );
 
 /*
  * img_create_export_dialog:
@@ -1780,6 +1782,99 @@
 
 	gtk_widget_destroy( dialog );
 }
+
+void img_exporter_custom( img_window_struct *img )
+{
+	gchar          *cmd_line;
+	const gchar    *filename;
+	GtkWidget      *dialog;
+	GtkEntry       *entry;
+	GtkWidget      *vbox;
+
+	/* Additional options - Custom only */
+	GtkWidget *frame;
+	GtkWidget *label;
+	GtkWidget *hbox;
+	GtkWidget *radio1, *radio2;
+	const gchar *options;
+	GtkWidget *options_entry;
+    
+	/* This function call should be the first thing exporter does, since this
+	 * function will take some preventive measures and also switches mode into
+	 * preview if needed. */
+	dialog = img_create_export_dialog( img, _("Custom"),
+									   GTK_WINDOW( img->imagination_window ),
+									   &entry, &vbox );
+
+	/* If dialog is NULL, abort. */
+	if( dialog == NULL )
+		return;
+
+	/* Add any export format specific GUI elements here */
+	frame = gtk_frame_new( NULL );
+	gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, FALSE, 0 );
+
+	label = gtk_label_new( _("<b>Frame Rate</b>") );
+	gtk_label_set_use_markup( GTK_LABEL( label ), TRUE );
+	gtk_frame_set_label_widget( GTK_FRAME( frame ), label );
+
+	hbox = gtk_hbox_new( TRUE, 5 );
+	gtk_container_add( GTK_CONTAINER( frame ), hbox );
+
+	radio1 = gtk_radio_button_new_with_mnemonic( NULL, _("25fps") );
+	gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( radio1 ), TRUE );
+	gtk_box_pack_start( GTK_BOX( hbox ), radio1, FALSE, FALSE, 0 );
+
+	radio2 = gtk_radio_button_new_with_mnemonic_from_widget(
+				GTK_RADIO_BUTTON( radio1 ), _("30fps") );
+	gtk_box_pack_start( GTK_BOX( hbox ), radio2, FALSE, FALSE, 0 );
+
+	/* FFmpeg options */
+	frame = gtk_frame_new( NULL );
+	gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, FALSE, 0 );
+
+	label = gtk_label_new( _("<b>FFmpeg options:</b>") );
+	gtk_label_set_use_markup( GTK_LABEL( label ), TRUE );
+	gtk_frame_set_label_widget( GTK_FRAME( frame ), label );
+
+	hbox = gtk_hbox_new( TRUE, 5 );
+	gtk_container_add( GTK_CONTAINER( frame ), hbox );
+
+	options_entry = gtk_entry_new();
+	gtk_entry_set_text( GTK_ENTRY( options_entry ), "-f mp4 -s 1650x1050 -vcodec libx264 -vpre hq -threads 0 -crf 15 -an" );
+	gtk_box_pack_start( GTK_BOX( hbox ), options_entry, TRUE, TRUE, 0 );
+
+	gtk_widget_show_all( dialog );
+
+	/* Run dialog and abort if needed */
+	if( gtk_dialog_run( GTK_DIALOG( dialog ) ) != GTK_RESPONSE_ACCEPT )
+	{
+		gtk_widget_destroy( dialog );
+		return;
+	}
+
+	/* User is serious, so we better prepare ffmepg command line;) */
+	img->export_is_running = 1;
+	filename = gtk_entry_get_text( entry );
+	if( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radio1 ) ) )
+		img->export_fps = 25;
+	else
+		img->export_fps = 30;
+
+	options = gtk_entry_get_text( GTK_ENTRY( options_entry ) );
+
+	cmd_line = g_strdup_printf( "ffmpeg -f image2pipe -vcodec ppm -r %.0f "
+								"-i pipe: <#AUDIO#> -y "
+								"%s \"%s\"",
+								img->export_fps,
+								options, filename );
+	img->export_cmd_line = cmd_line;
+
+	/* Initiate stage 2 of export - audio processing */
+	g_idle_add( (GSourceFunc)img_prepare_audio, img );
+
+	gtk_widget_destroy( dialog );
+}
 /* ****************************************************************************
  * End exporters
  * ************************************************************************* */
@@ -1807,6 +1902,9 @@
 
 		case 'M':
 		//img_exporter_vob(img);
+
+		case 'C':
+		img_exporter_custom(img);
 		break;
 	}
 }
