Forums | Mahara Community

Support /
New mimetype for FLV


anonymous profile picture
Account deleted
Posts: 4

01 May 2009, 11:31

Hello. I'm testing out Mahara 1.1.3 in a virtual machine running Ubuntu Server 9.04 (Jaunty). I am particularly interested in using Mahara in conjunction with some performing arts classes at the independent school where I teach. We want to host the videos locally (as opposed to embedding YouTube/Vimeo videos), and have found that FLVs offer a good trade-off between quality and compatibility. However, FLVs do not show up in the "Browse" section of an Embedded Media block. MP3s and MP4 videos show up fine.

After some poking around, I think it may have to do with the fact that the file command on this version of Ubuntu does not give the expected output for an FLV that I've uploaded. Instead of "application/x-flash-video", it returns "video/x-flv".

I tried adding a row manually to artefact_file_mime_types for x-flv, but that didn't seem to help. I removed the row, then tried forcing an upgrade by editing artefact/file/filetypes.xml and artefact/file/version.php, but I have a feeling I messed something up somewhere.

Any insight into how this can be fixed? Thanks in advance!

anonymous profile picture
Account deleted
Posts: 1643

01 May 2009, 19:02

Hi - thanks for this. Mahara 1.1 doesn't actually use /usr/bin/file to detect file types - it just trusts what the browser sends. But maybe the browser is also sending that mimetype.

I think this might be related to some other issues people were having with this blocktype. There's already a bug open about it (bug 3242) - I'll link this post to it. Do you have a video available that is detected as video/x-flv that we could use for testing? Also, what is your version of file (and libmagic if you can get that)? You can find out by running dpkg -l | grep [packagename]

anonymous profile picture
Account deleted
Posts: 4

02 May 2009, 9:55

Here are the versions from dpkg -l:

ii  file                                       4.26-2ubuntu3
ii  libmagic1                                  4.26-2ubuntu3

I've uploaded a sample file to a public-facing site:
http://jamesmallen.net/wp-content/uploads/random/Counting%20Leader.flv

The FLV was created in Adobe Premiere Pro, using the Adobe Media Encoder, and uploaded to Mahara from Firefox 3.0.10 on Windows XP SP3, if any of that matters. As I mentioned before, Mahara is running on a fairly plain Ubuntu 9.04 Server edition inside a VM. Thanks for your help!

anonymous profile picture
Account deleted
Posts: 1643

03 May 2009, 17:10

Thanks, I attached that file to the bug report. When we get to fix that bug we'll be able to use it as a test case.
anonymous profile picture
Account deleted
Posts: 808

04 May 2009, 0:53

Hi James,

If you have a look in the artefact_file_files table for one of those files, you will be able to see the mime type presented by the browser when the file was uploaded.

If you add this mime type into artefact_file_mime_types with the description 'flv' (either directly in the database or by editing and reloading filetypes.xml) then they should appear for inclusion in the embedded media block.  You should also check the internal media block configuration in the admin area under 'administer extensions' to make sure flv is not disabled there.

The problem might be if it's uploaded with something wishy-washy and generic like application/octet-stream.  If it's common for browsers to do that then I guess we'll have to just show pretty well everything in the embedded media block and leave it to the user to choose something sensible.

anonymous profile picture
Account deleted
Posts: 4

04 May 2009, 7:24

Richard,

Thanks for your response! Here's what's in the artefact_file_mime_types table:

> SELECT * FROM artefact_file_files WHERE artefact=14;
 artefact |  size  | oldextension | fileid | filetype 
----------+--------+--------------+--------+-----------
       14 | 302059 | flv          |     14 | video/flv

I adding video/flv to artefact_file_mime_types using the following statement:

INSERT INTO artefact_file_mime_types (mimetype, description) VALUES ('video/flv', 'flv'); 

And it shows up! I could have sworn that I tried that before, but I must have mistyped something somewhere. Thanks again!

anonymous profile picture
Account deleted
Posts: 4

12 May 2009, 7:45

Oy - another new mime type for FLV. Same version of everything, but for some reason, some artefacts are coming in with the mimetype "video/flv," and others are "video/x-flv."

mahara=> SELECT * FROM artefact_file_files;
 artefact |   size   | oldextension | fileid |  filetype
----------+----------+--------------+--------+-------------
       14 |   302059 | flv          |     14 | video/flv
       27 | 13833263 | flv          |     27 | video/x-flv
Did the following to get the x-flv's to show up:
INSERT INTO artefact_file_mime_types (mimetype, description) VALUES ('video/x-flv', 'flv');
anonymous profile picture
Account deleted
Posts: 808

12 May 2009, 17:09

Thanks, I added that one too.
8 results