Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

If we rename an .avi file or .mov file to mp4 file...will jwplayer still play it?


We have a requirement to rename all upload video files to .mp4 and we are using jwplayer pro, If we rename an .avi file or .mov file to mp4 file...will jwplayer still play it? Does jwplayer look at the file extension or the video file embedded header to know how to decode and play the video?

8 Community Answers

MisterNeutron

Best Answer 

Seriously? Can you take mydog.txt, rename it mydog.jpg, and have it magically turn into a picture?

JW Player can play MP4 files. It can't play AVI files. Internally, they aren't even remotely similar. They're encoded differently. An MOV file might have H.264 encoding internally, but you can't assume that.

JW Player doesn't "decode" anything. It's just a steering script - it passes the video to the browser if the browser can handle HTML5 video playback, and to Flash if it can't. The player doesn't alter the file in any way, shape, or form. In fact, it doesn't "play" the file itself - the browser or Flash plugin is doing that.

If you want all uploaded files to become MP4's, you're going to have to convert them, probably with something like ffmpeg.

I'm thinking that you're in waaaaay over your head....

View in conversation

MisterNeutron

Best Answer  User  
-2 rated :

Seriously? Can you take mydog.txt, rename it mydog.jpg, and have it magically turn into a picture?

JW Player can play MP4 files. It can't play AVI files. Internally, they aren't even remotely similar. They're encoded differently. An MOV file might have H.264 encoding internally, but you can't assume that.

JW Player doesn't "decode" anything. It's just a steering script - it passes the video to the browser if the browser can handle HTML5 video playback, and to Flash if it can't. The player doesn't alter the file in any way, shape, or form. In fact, it doesn't "play" the file itself - the browser or Flash plugin is doing that.

If you want all uploaded files to become MP4's, you're going to have to convert them, probably with something like ffmpeg.

I'm thinking that you're in waaaaay over your head....

shadi

User  
0 rated :

I do not think you understood my question my friend. thanks for being funny!

But you brought a very good point about the file formats that Jwplayer supports, what are the formarts supported by jwplayer? what is the safe bet to tell my users to upload? only mp4?

MisterNeutron

User  
-1 rated :

Oh, I think I undestood it pretty clearly. You were actually under the impression that you could change a file format simply by renaming the file. Or that JW Player was somehow "decoding" the files.

If you don't want to do any server-side format conversion, tell your users to upload only MP4's. Make sure they're properly encoded as H.264, and that the moov atom is at the beginning of the file, not the end. Simply having a file that ends with ".mp4" isn't good enough.

Supported formats:

http://support.jwplayer.com/customer/portal/articles/1403635-media-format-reference

That indicates that JW Player can play WEBM. That's fine, but it will work only in some browsers (NOT IE, Safari, or iOS), so forget that. And FLV is dead. It's Flash only, and won't play on any mobile. Only MP4 is universally playable.

shadi

User  
0 rated :

Ok MP4 is the way to go? What about .MOV? Iphones upload .mov only.


Ok let me tell you what you found so far....If I get an MP4 file and I rename it to .avi or .wmv, jwplayer will not play it. although the header is H.264.

MisterNeutron

User  
-1 rated :

When you rename the file, your server is probably putting the wrong MIME type on it. On top of that, JW Player does look for an MP4 extension. If you're giving it a file that's really an MP4, but doesn't look like one, you can just add a type: 'mp4' attribute to the setup block. But that won't cure an incorrect MIME type.

But the fact that you're even trying this is a vivid illustration of the fact that you don't know WTF you're doing. Sorry, but it's pretty evident.

If people are going to be uploading things that aren't properly-encoded MP4's, you're going to need to do some format conversion server-side. There's no magic bullet to take care of this. Even if the iPhone movies are actually H.264 internally, you will also probably run into orientation problems that you can address only by running the videos through ffmpeg with the right flags. iPhones, when held in portrait mode, produce movies that have internally inconsistent orientation flags, and they yield havoc.

shadi

User  
0 rated :

You still do not get it and I do not need to explain why I am doing and asking all those questions...


Yes, I know about the iphone orientations.


I appreciate your help but I do not appreciate your judgement.

MisterNeutron

User  
0 rated :

Anyone who is changing file extensions in an effort to change file formats, or to change the behavior of a player script, is obviously very, very confused.

shadi

User  
0 rated :

I was able to rename the iphone .mov files to .mp4 extension and jwplayer was able to play them on html5 browser.

That tells me iphone encoded the mov files in H264 format but jwplayer still wants it in .mp4 extension.

Would you agree?

This question has received the maximum number of answers.