Add support for .avi and .mpg videos

jeforma - June 14, 2006 - 02:10
Project:Video
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

#1

fax8 - June 18, 2006 - 09:12

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.

#2

jeforma - June 18, 2006 - 22:04

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 :)

#3

fax8 - June 18, 2006 - 23:16

yes.. but what about mac or linux users?

#4

Psicomante - June 19, 2006 - 08:28

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

#5

jeforma - June 19, 2006 - 14:12

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

#6

khoogheem - June 26, 2006 - 02:01

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);
        }

#7

jeforma - June 26, 2006 - 16:43

I hope this will be added to the module :)

#8

fax8 - July 16, 2006 - 10:16

@khoogheem

could you please send your modifications as a patch file?

Thanks

Fabio

#9

consen - July 23, 2006 - 12:24

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

AttachmentSize
video.drupal.node.68917.zip 15.79 KB

#10

patchak - July 25, 2006 - 12:59

Is this committed in the cvs ??

Thanks

#11

smitty - March 12, 2007 - 12:47
Version:HEAD» 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.

#12

jeforma - March 21, 2007 - 20:49

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

Can't wait though. :)

Regards,

Charles

#13

smitty - March 22, 2007 - 14:11

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!

#14

Ryanbach - March 25, 2007 - 06:42

Subscribing.

#15

etherworks - April 1, 2007 - 16:01

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!

#16

smitty - April 19, 2007 - 11:21

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

#17

Ryanbach - May 6, 2007 - 04:20

Yes, please do!

#18

doc2@drupalfr.org - February 13, 2008 - 16:34

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

#19

anarcat - June 27, 2007 - 17:20
Status:active» needs review

Here is a proper, simple patch.

AttachmentSize
mpg.patch 759 bytes

#20

doc2@drupalfr.org - July 9, 2007 - 11:07

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

#21

edriejk - October 7, 2007 - 21:52

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

#22

techgy - November 12, 2007 - 18:22

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

#23

falk_g - November 12, 2007 - 18:39

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.

#24

techgy - November 12, 2007 - 19:24

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?

#25

Blackguard - January 23, 2008 - 19:29

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).

#26

doc2@drupalfr.org - January 24, 2008 - 10:08

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.

#27

Blackguard - January 24, 2008 - 15:18

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.

#28

doc2@drupalfr.org - January 30, 2008 - 16:22

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...

#29

doc2@drupalfr.org - February 12, 2008 - 18:09

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

#30

Blackguard - February 12, 2008 - 22:22

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

#31

fax8 - March 5, 2008 - 15:18
Status:needs review» 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

#32

Anonymous (not verified) - March 19, 2008 - 15:22
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.