Hi, and first thanks for the effort you've put into this great module.
One annoyance I've stumbled in with FlashVideo is that the textfield for the FFMPEG-parameters is too limited.
It happens to be a textfield, and allows a maximum of 256 characters. Sometimes the FFMPEG-parameters get really complex and long, and the parameters simply
don't fit in that textfield.
I'm talking about www.mysite.com/admin/settings/flashvideo/edit/global (you can replace global with nodetype) --> "FFMPEG Settings" --> "ffmpeg Command".
I found this out after some headbanging+debugging. After various failed ffmpeg conversions I found out the reason was that my copy-pasted ffmped command line was simply being cut of at some point in the textfield. There was no validation error to point this out since the browser cuts the text client side. We don't really need any validation either.
As I see it, a textarea (with a useable textlimits) would work better than a limited textfield. Here is the code that I used to change the form properties (vie a custom module's form_alter hook):
function mymodule_form_alter(&$form, $form_state, $form_id){
$node_type = arg(4);
if(isset($form['ffmpeg']) && $node_type){
$form['ffmpeg']['flashvideo_'. $node_type .'_cmd']['#maxlength'] = 1500;
$form['ffmpeg']['flashvideo_'. $node_type .'_cmd']['#type'] = 'textarea';
$form['ffmpeg']['flashvideo_'. $node_type .'_cmd']['#rows'] = 6;
}
Also, I had to enable the "Module Weights"-module and set my custom module's weight to 12 so it runs after Flashvideo (at weight 11), or it wouldn't be able to alter that form.
This fix works for me, and it's easy to implement in other custom modules.
Of course, this is easy to implement and has no downsides, so maybe this could simply find it's way into the flashvideo-module? :)
The lines to change are in flashvideo.admin.inc around L453:
$form['ffmpeg']['flashvideo_'. $node_type .'_cmd'] = array(
'#title' => t('ffmpeg Command'),
'#type' => 'textfield',
'#default_value' => flashvideo_variable_get($node_type, 'cmd', '-i @input -f flv -acodec mp3 -ar 22050 -ab 64k -ac 1 @output'),
'#maxlength' => 256,
'#description' => t('This is the command to give to the ffmpeg executable. Refer to the <a href="http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html">FFMPEG Online Documentation</a> for more information.<br/>The following parameters can be used:
<ul>
<li><b>@input</b> - <em>The input file will replace this tag.</em></li>
<li><b>@output</b> - <em>The output file will replace this tag.</em></li>
</ul>'),
'#required' => TRUE
);
Comments
Comment #1
attheshow commentedThanks for the suggestion, unfortunately I don't think this is a good idea to change this into a text area since this is a linear command and not a situation in which using a textarea is warranted. I also don't know of anyone else who has gone over the 256 character limit on the command, so this is likely not a common scenario. Also, as you mentioned, developers can always do a HOOK_form_alter to modify the form for their situations.