Good evening,

Adding the ability to upload .avi and .mpg videos I think this would be something necessary to add as well as the ability to upload your own videos directly from your computer to the server.

Thanks,

Charles
GameBGS.com

CommentFileSizeAuthor
#19 mpg.patch759 bytesanarcat
#9 video.drupal.node.68917.zip15.79 KBconsen
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

fax8’s picture

yeah... this is a reasonable feature.

The problem is: what player use for avi and mpeg ?

Usually Quicktime, Windows Media Player and RealPlayer are able of playing
such formats.

jeforma’s picture

I think Windows Media would be a good program, as thaty is what I am currently using to view all my .avi and .mpg videos.

I would just like to see this feature, and would allow me to upload many more videos on my site :)

fax8’s picture

yes.. but what about mac or linux users?

psicomante’s picture

it's very easy to create a little patch for you, Chief. Look at the code ;)

jeforma’s picture

I am a complete newbie for coding, and patching, i don't even know how to patch lmao :)

khoogheem’s picture

One thought would be to allow the admin to pick the windows or the quicktime player.

The best option (IMHO) would be to try and grab the OS from the brower being used then we could also support the formats for linux users. But here is at least a method to give control to the admin:

FIXES---

add new code:

define('VIDEO_PLAYER_MPEG',        'video_player_mpeg');
define('VIDEO_PLAYER_AVI',          'video_player_avi');

define('QUICKTIME',                     'Apple Quicktime');
define('REALMEDIA',                     'Real Media');
define('FLASH',                            'Macromedia Flash Video');
define('SWF',                               'Macromedia Flash Video');
define('DCR',                               'Director Movie');
define('WINDOWS_MEDIA',             'Windows Media Format');
define('YOUTUBE',                         'YouTube Video');
define('GOOGLEVIDEO',                  'Google Video');

in function video_settings: - add to the end


  $form['players'] = array('#type' => 'fieldset', '#title' => t('Media Players'), '#description' => t('You can choose which player will be used for specific types of media'));
  $form['players'][VIDEO_PLAYER_MPEG] = array(
    '#type' => 'select',
    '#title' => t('Player to use for MPEG/MPG media files'),
    '#default_value' => variable_get(VIDEO_PLAYER_MPEG, WINDOWS_MEDIA),
    '#options' => drupal_map_assoc(array(QUICKTIME, WINDOWS_MEDIA)),
  );
  $form['players'][VIDEO_PLAYER_AVI] = array(
    '#type' => 'select',
    '#title' => t('Player to use for AVI media files'),
    '#default_value' => variable_get(VIDEO_PLAYER_AVI, WINDOWS_MEDIA),
    '#options' => drupal_map_assoc(array(QUICKTIME, WINDOWS_MEDIA)),
  );

in function video_play(): -- add the code:

      case 'mpeg':
      case 'mpg':
        if(variable_get(VIDEO_PLAYER_MPEG, WINDOWS_MEDIA) == WINDOWS_MEDIA){
          return theme('video_play_windowsmedia', $node);
        }
        else{
          return theme('video_play_quicktime', $node);
        }
      case 'avi':
        if(variable_get(VIDEO_PLAYER_AVI, WINDOWS_MEDIA) == WINDOWS_MEDIA){
          return theme('video_play_windowsmedia', $node);
        }
        else{
          return theme('video_play_quicktime', $node);
        }
jeforma’s picture

I hope this will be added to the module :)

fax8’s picture

@khoogheem

could you please send your modifications as a patch file?

Thanks

Fabio

consen’s picture

FileSize
15.79 KB

Our camara takes MPG videos.
http://www.consen.info/vIST6_PM_BXL
We have solved the .mpg format with the patch (please find attached) of this node 68917
We think that this requires also other patch revision for format .MPG
We are trying to test, try and document all the options of the video.module
All interested in Vlogging and professional promotion can contact us to cooperate in the next EC event
IST-2006 21-23 Nov in Helsinki (7000 professionals)
http://IST-2006.CONSEN.info
Ferran

patchak’s picture

Is this committed in the cvs ??

Thanks

smitty’s picture

Version: master » 5.x-1.x-dev

Do I see it right, that the support for .avi and .mpg videos is solved?

But I wonder why it is not integrated in the release 5.x-1.x-dev.

How can I get the feature? I think, it might not be wise to apply the patch dated mid last year to the newest release.

jeforma’s picture

Unfortunaetly, I don't think that has been added to the latest version of the video module.

Can't wait though. :)

Regards,

Charles

smitty’s picture

Is there anybody, who could add this feature to a new version?
I can't do it by myself, because I`m not a programmer.

Many thanks in advance!

Ryanbach’s picture

Subscribing.

etherworks’s picture

I just edited the 5.1-dev video-moudle to add mpg support - it was simple.

Just edited this section:
switch (_video_get_filetype($node->vidfile)) {
case 'divx':
return theme('video_play_divx', $node);
case 'mov':
(etc)

and added this line:
case 'mpg':

Then added this line at the end of the module:
function _video_get_mime_type($node) {
switch (_video_get_filetype($node->vidfile)) {
case 'mov':
return 'video/quicktime';
(etc)

and added this line:

case 'mpg':
return 'video/mpeg';

Simple!

smitty’s picture

Could you please add this to the CVS, so that it is included in further releases?

Ryanbach’s picture

Yes, please do!

doc2@drupalfr.org’s picture

Status: Needs review » Active

#151449: Mac OS X ffmpeg support for Video > > > updated ! with installation guide..!

anarcat’s picture

Status: Active » Needs review
FileSize
759 bytes

Here is a proper, simple patch.

doc2@drupalfr.org’s picture

The patch is wrong. It calls the Ogg Theora plug-in to play MPGs. Around line 954, you should add the "add commented lines" (you can keep the comments to have a better retrieval of those changes):

  switch (_video_get_filetype($node->vidfile)) {
    case 'divx':
      return theme('video_play_divx', $node);
    case 'mov':
    case 'mp4':
    case '3gp':
    case '3g2':
    case 'avi':    // Added
    case 'mpg':    // Added
    case 'mpeg':   // Added
      return theme('video_play_quicktime', $node);
    case 'rm':

...and around line 1660 to 1670, under the section:

/**
 * Returns the correct mime-type for the video. Returns false if the
 * mime-type cannot be detected.
 */
function _video_get_mime_type($node) {

...add the "Added commented lines" as follow:

    case 'mov':
      return 'video/quicktime';
    case 'avi' :    // Added
    case 'mpg' :    // Added
    case 'mpeg' :   // Added
      return 'video/mpeg';   // Added
    case 'divx':

This should work now. Hope this helps.

Arsène

edriejk’s picture

Is there a patch available for the 5.1 version that is correct, and includes .wmv formats? That would be fantastic!

Anonymous’s picture

I just read through the entire thread regarding patches for both mpg and avi video formats.
Sorry, but I'm still confused. Most of the comments, except the last were dated about mid-year. It's now November and I recently downloaded the video module but it isn't supporting these formats - unless I screwed up somewhere.

Can someone please straighten me out? Have these mod's been implemented? If not, is there a schedule to do so? It would appear that there's definitely an interest in incorporating them.

Thanks for your help! The video module has been a great help to me and I look forward to continued upgrades.

Roy

falk_g’s picture

the video.module seems to be somewhere on a dead end it seems as the main developer moved to the canary islands and is probably rather going swimming then coding (hey I would ;). There is already an open letter to him somewhere to finish up the coderewrite he started sometime mid year or at least put it in the dev here - or make a final statement or whatever.

I can not stress how important this module is because it is the only working one that allows you to add video to your site without stupid annoying slow buggy f*dfing flash. I looked at the code of the current module and find it quite rough as a working base for a new one.

but back to your question. afaik mpg and avi should work with the video.module at the current version - I seem to have read it somewhere but since I am only doing mp4 and mov I can´t test at the moment....
you can also just implement the above mods yourself I guess.

Anonymous’s picture

I downloaded the patch that was mentioned and replaced an existing file with it,but the mod didn't work.
As I'm not a programmer of such, the fault was probably mine. It would be nice, as previously mentioned, if someone could take this minor glitch, run with it, and get this working. I'm sure there's a lot of folks that would be appreciative.

From my current point of view the changes mentioned don't work. Anyone got other ideas?

jmlavarenne’s picture

I modified the .module file as described, and after applying the modifications doc2@drupalfr.org, I found out that on top of the suggested additions, you might need to provide capitalised versions of the mime types (i.e. MPG, MPEG).

doc2@drupalfr.org’s picture

Thank you for your feedbacks.

We should go on like this to help any potential maintainer who could show up. Unforntunately, I can't do it myself.

jmlavarenne’s picture

Agreed! In the meantime I must say that so far I was only able to output audio for uploaded mpegs with this module, in other words when clicking play in a video node containing a mpeg video, quicktime only provided audio.

doc2@drupalfr.org’s picture

Blackguard said:

so far I was only able to output audio for uploaded mpegs with this module, in other words when clicking play in a video node containing a mpeg video, quicktime only provided audio.

I doubt that your problem has something to do with the module. Have you found a issue related to your problem reported elsewhere in the video.module issues, or as a forum topic? If not, create it. I haven't found such a issue personaly, but that's a while that I haven't browse the video.module's issues. Your go!

I think that may come from quicktime. But more info on your platform, system and drupal configs may help...

doc2@drupalfr.org’s picture

Maybe we should follow this version tracking topic: #193351: Official 5.x release?, or the video.module releases page.

jmlavarenne’s picture

I am deciding to use another solution.

I'm going to go with embeded media field module - http://drupal.org/project/emfield

and flashvideo - http://drupal.org/project/flashvideo

fax8’s picture

Status: Active » Fixed

we currently have something similar to #20 by doc2 for mpg player.

While for mime types I committed something similar to #20 by doc2 but using a different value for .avi mime types.
(See http://www.w3schools.com/media/media_mimeref.asp for a reference)

     case 'avi' :    // Added
       return 'video/x-msvideo';
     case 'mpg' :    // Added
     case 'mpeg' :   // Added
       return 'video/mpeg';   // Added
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.