Hello there.
Brilliant module and thanks for the updated today (27/05/2010). Fixed the hacks I was putting in place to make it work on Windows.
I am currently using the video module alone to convert files to .mp4 using h.264 encoding. I am currently using these conversion options within Transcoder > Video conversion > Advanced settings:
-i !videofile -crf 35.0 -vcodec libx264 -acodec libfaac -ar 48000 -ab 128kb -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -threads 0 !convertfile
These settings literally produce files half the size of a .flv with no loss in quality and can play through flowplayer etc. no problem.
The question I have is this? The !convertfile param gets hard coded to .flv in conversion.inc line 93:
$converted = $converted .'/'. pathinfo($video->filepath, PATHINFO_FILENAME) .'.flv';
To experiment I changed this to:
$converted = $converted .'/'. pathinfo($video->filepath, PATHINFO_FILENAME) .'.mp4';
and got the results I was after. Would it be possible to have this file extension as a param on the video settings page?
I tried to use ffmpeg wrapper, but could not get it to work at all due to the well documented ffmpeg version issues. It also seemed to kill the brilliant size auto detect and thumbnail generation features of the video module.
Or is there another way of achieving this that I have missed?
Many thanks
Ryan
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | video_module.gif | 82.49 KB | roneill |
Comments
Comment #1
iLLin commentedYup, Ill add in the next dev cycle.
Comment #2
roneill commentedBrilliant. thanks iLLin.
Ryan
Comment #3
iLLin commentedhttp://drupal.org/cvs?commit=374948
Comment #4
roneill commentedGreat! thanks iLLin. I will take a look tomorrow.
Comment #5
roneill commentedThat works great iLLin. Thank you. So you can now effectively add custom ffmpeg settings without the need for ffmpeg wrapper!
Am I missing something or is it possible to encode in one resolution and have a different resolution for the player. For example I want to encode HD video at 1280x720, but I want the player to be e.g. 530x325. This gives the user the ability to play full screen if they wish but it does not take over the screen initially (ie with a player 1280x720).
I know I could add separate CCK fields to store the preffered player size and then use the Flowplayer API and something like phptemplate_preprocess_node to achieve this, but I do not have access to the converted filepath only the original filepath. Any advice would be appreciated.
Ryan
Comment #6
iLLin commentedYour gonna love this :). It seems you are making everything pretty much "standard". Each player has its own template file. For instance, your using the flowplayer API, so that template is video-play-flv.tpl.php and found in the theme directory under the video module. Right now it spits out the themed_output using swftools or the flowplayer api... etc to build the output. In this template you have access to the $video object that contains everything you need, even the original file uploaded if you need that as well. You could basically build out your player with that object and standardize your player width and height.
BUT
This is a solid request and maybe we should include a player wxh setting? Just a simple textfield and put some validation on it to make sure the value is WxH. If left blank it would just use the transcoded WxH. We could then add to more attributes to the video object. $video->player_width and $video->player_height.
Im going to change this status back to active and work on weaving that in when I got time. But for now you can get away with a custom theme template :).
Comment #7
iLLin commentedComment #8
roneill commentedBrilliant. I have just dumped the $video object and can see I have everything. Thank you.
If you could implement the WxH as suggested above then this would be a great addition. What would be good is to have a default player size setup within the video settings area and then allow this to be over ridden on a per video basis. This means that if the user did not enter a player size or forgot/did not understand, then the player size would fall back to the default. This would be prefferable to falling back to the resolution which could be too big. 1280x720 can really mess up a page :-)
Comment #9
iLLin commentedAdded http://drupal.org/cvs?commit=376082
Comment #10
roneill commentedThat is excellent thanks iLLin. Very speedy aswell :-) It really makes the module very flexible and powerful.
Do you think in the future it would be possible to set default dimensions? Currently it fails for an 'authenticated user' who does not have the 'override player dimensions' permission, giving the errors below:
warning: Division by zero in C:\htdocs\drupal_sandbox\sites\all\modules\video\includes\conversion.inc on line 178.
warning: Division by zero in C:\htdocs\drupal_sandbox\sites\all\modules\video\includes\conversion.inc on line 183.
Are the $video->dimensions not calculated if the user does not have this permission?
Line 178: $output_ratio = number_format($output_width / $output_height, 4);
I am thinking along the lines of a user who adds media to a node e.g. a PDF, a Word doc and a video. The video is always in the same format and just needs converting. I want to make it as easy for them as possible.
I want to control the resolution and player size and I do not want them to have access to it. Or if they have to I would like to be able to set a default player size.
In short your module is already doing most of the clever work for the user (ie calculating resolution dimensions. Although I know from your comments that this is not full proof yet) it would just be nice not to have to give them the option to alter either the resolution dimensions or the player dimensions i.e. not let them mess it up.
But I understand that the list is endless iLLin ;-)
Comment #11
iLLin commentedThat error you speak of should be fixed in the latest dev. I added a fallback for default dimensions if user isn't authorized. Is it not working?
Comment #12
roneill commentedHi iLLin. I just downloaded and tested dev 17:05 GMT. It is as above. If 'override player dimensions' permission is granted it works. If not it errors as above.
Comment #13
iLLin commentedGive this a try: http://drupal.org/cvs?commit=376562
Comment #14
roneill commentedHi iLLin. I have attached a screenshot of what I get after a 'convert on save' for a user who does NOT have the 'override player dimensions' permission . In the screenshot I have done a print_r of the $video object so you can see what the dimensions are. It has not detected 1280x720 but has defaulted to 352x288 for the dimensions and the player_dimensions appear to be empty. Thanks iLLin.
Comment #15
iLLin commentedWell I think this would be an issue that wouldn't normally happen.
I "think" if you go in and edit the cck field (manage fields) and resave it, it will have a default player dimensions. I think right now its in between having player dimensions set. Can you try that and let me know if that works? When a new video cck field is setup that option will be there where I think since you already setup the field, it didn't have that player dropdown default set.
Make sense?
Comment #16
iLLin commentedComment #17
roneill commentedFantastic! Glad it was me. I did not realize that these settings were in the CCK field. I was looking for them in the module settings and assuming you were falling back to the resolution WxH for the player dimensions. Many thanks again!
Comment #18
iLLin commentedAwesome I will create an alpha release now :)