diff -urp flashvideo/flashvideo.admin.inc flashvideo_altered/flashvideo.admin.inc
--- flashvideo/flashvideo.admin.inc	2009-07-26 06:17:04.000000000 +0200
+++ flashvideo_altered/flashvideo.admin.inc	2009-10-28 15:27:27.000000000 +0100
@@ -354,6 +354,7 @@ function flashvideo_settings_form() {
       <ul>
         <li><b>@video</b> - <em>String</em> - Placeholder for the path of the video to play.</li>
         <li><b>@thumbnail</b> - <em>String</em> - Placeholder for the path of the thumbnail of the video.</li>
+        <li><b>@filename</b> - <em>String</em> - The name of the video file without the path.</li>
       </ul>Example: <strong>file=@video&amp;image=@thumbnail</strong> will play the video using its thumbnail as the intro image.'),
     '#required' => FALSE
   );
@@ -462,6 +463,14 @@ function flashvideo_settings_form() {
     '#required' => TRUE
   );
 
+  $form['ffmpeg']['flashvideo_'.$node_type .'_file_extension'] = array(
+    '#title' => t('File extension for the output file'),
+    '#type' => 'select',
+    '#options' => array('flv' => 'flv', 'mp4' => 'mp4'),
+    '#default_value' => flashvideo_variable_get($node_type, 'file_extension', 'flv'),
+    '#description' => t('Select the extension which you would like to use.'),
+  );
+
   $form['ffmpeg']['flashvideo_'. $node_type .'_thumbcmd'] = array(
     '#title' => t('ffmpeg Thumbnail Command'),
     '#type' => 'textfield',
@@ -678,4 +687,4 @@ function _system_settings_form($form) {
   $form['#submit'][] = 'system_settings_form_submit';
   $form['#theme'] = 'system_settings_form';
   return $form;
-}
\ No newline at end of file
+}
diff -urp flashvideo/flashvideo.module flashvideo_altered/flashvideo.module
--- flashvideo/flashvideo.module	2009-08-17 00:08:30.000000000 +0200
+++ flashvideo_altered/flashvideo.module	2009-10-28 15:20:25.000000000 +0100
@@ -455,8 +455,9 @@ function flashvideo_get_flashvars($video
   }
 
   // Set up the markup and actual data arrays.
-  $markup = array('@video', '@thumbnail');
-  $actual = array($video['file'], check_url(preg_replace("/\.flv|\.mp4/", ".jpg", $video['file'])));
+  $markup = array('@video', '@thumbnail', '@filename');
+  $video['file'] = str_replace('@filename', basename($video['file']), $video['file']);
+  $actual = array($video['file'], check_url(preg_replace("/\.flv|\.mp4/", ".jpg", $video['file'])), basename($video['file']));
   return str_replace($markup, $actual, $flashvars);
 }
 
@@ -899,7 +900,7 @@ function flashvideo_get_convert_params($
   $params['thumbext'] = 'jpg';
 
   // Set the video extension as an FLV (flash) file.
-  $params['videoext'] = 'flv';
+  $params['videoext'] = flashvideo_variable_get($node_type, 'file_extension', 'flv');
 
   // Set the video mimetype as the Flash mimetype.
   $params['videomime'] = 'flv-application/octet-stream';
@@ -2620,4 +2621,4 @@ function _flashvideo_load($node) {
     $files[$file->fid] = $file;
   }
   return $files;
-}
\ No newline at end of file
+}
