Spin off from #983924-8: Improve usability of configuring media types / extensions and allowing uploads for those extensions.

hadsie reports that no video files can be uploaded because $media->uri is set to a tmp file with no extension information. I have not yet reproduced this error.

Comments

effulgentsia’s picture

@hadsie: The media_dev profile comes with a file "profiles/media_dev/files/MediaGallery.mp4". If you don't have the profile locally, you can download just the file from http://drupalcode.org/viewvc/drupal/contributions/profiles/media_dev/fil.... Does this work for you? If so, but you have a file that doesn't and that you have permission to post here, please post it. Thanks.

hadsie’s picture

Title: Video file uploads from Chrome fail » Video file uploads fail even though it has correct extension
Status: Postponed (maintainer needs more info) » Active

Ok, so I've got a bit further on this. I don't believe it's an issue specific to chrome since I've just tested with FF and got the same thing :). However, I tried a .mov file and it uploaded fine (your mp4 also uploaded fine).

This seems directly related to the m4v video I'm trying to upload. The filemime is "application/octet-stream" which doesn't match the allowed mime types
setting but I have Match Type set to Any so that shouldn't matter. I believe the fact that it's an octet-stream is the reason the uri doesn't not contain a file extension.

I don't know a lot about video and video formats, but I created this m4v by exporting a much larger AVI from iMovie. If you still want me to post the video here I can. It's about 6MB... but I could just shorten it to make it much smaller with the same effect.

zandros’s picture

I am trying to upload a video file with an .avi extension and although it seems that it is uploading it in the explorer's progress bar, at the end it cancels the upload and not even an error is showing up. Does this behavior match with your own problem? (tested it with beta3)

justin.hopkins’s picture

StatusFileSize
new16.7 KB

I am also experiencing this with .m4v files despite having match type set to 'any'. I'm not sure if this is related, but I'm not getting thumbnails of videos that I upload with other formats, and they do not embed properly either. For a sample video asf_to_mpeg-1.mpeg I get the following markup:

<span id="styles-1-0" class="styles file-styles large"> 
<img typeof="foaf:Image" src="http://training.mobiusconsortium.org/sites/training.mobiusconsortium.org/files/styles/large/public/asf_to_mpeg-1.mpeg">
</span>

The mimetype is detected properly as video/mpeg. This is exactly the same when the MediaGallery.mp4 file is used. It's odd that the src for the thumbnail image points to the video file itself...

JacobSingh’s picture

Can someone upload the file you're trying to add somewhere so I can test?

bryancasler’s picture

Same problem

JacobSingh’s picture

Can someone please provide an example file to test with?

JacobSingh’s picture

Status: Active » Postponed (maintainer needs more info)
flosuter’s picture

Status: Postponed (maintainer needs more info) » Active

Hi

You can find an example .m4v from iMovie here:
http://exorbitant.ch/download/1min.m4v

Anonymous’s picture

Has there been further development on this issue?

johncionci’s picture

I was having the same issue, I was uploading a video and it was completing but never showing up, no errors either. I had to go into my .htaccess file to increase the max upload size and post size and it worked!! Now if I can only get a video player to show up...

arthurf’s picture

Assigned: Unassigned » arthurf
Status: Active » Needs review
StatusFileSize
new1003 bytes

This seems to be an issue with the core mime type listing. I filed a patch here: http://drupal.org/node/1290486 however here is a patch that fixes it in the mean time. Note that you will still have to have m4v in your list of allowed file extensions.

arthurf’s picture

StatusFileSize
new1.46 KB

Here's a slightly more robust version of the patch thanks to Alex.

dave reid’s picture

Status: Needs review » Needs work

We should move this to file_entity so that more people have this fixed for them (and also make sure to have applied to file_entity separate project).

arthurf’s picture

Status: Needs work » Needs review
StatusFileSize
new1.35 KB

Moved this code to the file_entity module. This will need to get moved to the real file_entity module in the 2.x branch.

Status: Needs review » Needs work

The last submitted patch, file_entity_m4v_fix.patch, failed testing.

tsvenson’s picture

Project: D7 Media » File Entity (fieldable files)

Moving to File Entity so patch is tested correctly.

tsvenson’s picture

Status: Needs work » Needs review

#15: file_entity_m4v_fix.patch queued for re-testing.

tsvenson’s picture

Hm, when look at the details for the re-test request I triggered, for the patch in #15, it says postponed. Is special permissions needed for this or did something else go wrong?

arthurf’s picture

StatusFileSize
new1.49 KB

Rerolled and fixed issue with duplicate function

arthurf’s picture

Status: Needs review » Active
arthurf’s picture

Status: Active » Needs review
dave reid’s picture

Title: Video file uploads fail even though it has correct extension » Add support for m4v as 'video/x-m4v' in file_entity_file_mimetype_mapping_alter()
StatusFileSize
new1.45 KB

It was a little hard for me to follow the array_flip(), reset() and key() logic. Revised patch that checks if the mimetype exists, and if not, adds it; then fetches the key of the mimetype, and assigns the extension.

dave reid’s picture

Status: Needs review » Fixed

Arthur gave a verbal RTBC in our hotel room, so committed #23 to both file_entity 7.x-1.x and media 7.x-1.x:
http://drupalcode.org/project/file_entity.git/commit/ada8488
http://drupalcode.org/project/media.git/commit/66d3e7e

Status: Fixed » Closed (fixed)

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

gajanannehul’s picture

Hi
I am new to drupal and I am trying to download .m4v vedio file but its giving error to me.
I am working on drupal 6.