Fixed Title change when uploading video, and video doesn't render.

tonmo

Well-known member
Strange issue. ffmpeg seems to be installed properly. I'll upload a file named, for example, "dr.octavius.avi"... but the title of the file will be "dr.octmp4us.avi"

Also, "shedding.avi" was titled "shedd4ing.avi"

And the videos would not play... the timer for the video ticks off and it seems to be proper length, but there is no video rendered.

Any thoughts? I noticed that "mp4" was the string of replaced letters in the first file. Odd.
 
Ugh... That's dumb. I think I can see what's happening here without looking.

Workaround for now is to change the name of the file before upload; change it to dr.octav1us.avi or something. We change the file type from avi to mp4, the process that does this is being too overzealous and replacing part of the file name too. Obviously not ideal. That workaround should help for now, though.
 
huh, ok. note, the name of the file IS dr.octavius.avi before I upload. The mp4 is replacing the avi after upload in the title of the file.

Why would shedding.avi change to shedd4ng.avi? I had other examples too... I's becoming E's, etc.

In the meantime I could change the files to numeric titles only (maybe that would help) or something real generic (aaa.avi). I'll play around.
 
Actually, now I've looked at the code, I can't actually see where this would be going wrong. We don't do what I thought we did to switch the extension, so something else is going wrong.

I'll do some testing, too.
 
I just tried another file, it seems I can recreate this pretty easily.

The original file name is Molly1.MOV. But the title of the uploaded file is Mplly1.

The video upload itself did work this time, though.
 
Well this makes less and less sense with each post :)

Are you able to upload the video here? Does it exhibit the same behaviour?
 
Also recreated the dr. octavius.avi issue, and the video does not render - so same experience as on my own site, although I noticed a thumbnail was produced.

 
OK. I've found the bug now, so this is fixed for the next version.

This bug, however, should not (and doesn't, in my testing) affect the videos being uploaded, being playable or affect thumbnails in any way. These things are likely to be different.

That said, the fix is pretty simple if you'd like to make it yourself.

Open the file library/XenGallery/Model/File.php and find:
PHP:
$filename = strtr($filename, strtolower(substr(strrchr($filename, '.'), 1)), 'mp4');

Replace with:
PHP:
$filename = preg_replace('/\\.[^.\\s]{3,4}$/', '.mp4', $filename);
 
thanks. The dr.octavius.avi video plays fine locally. Any thoughts why it doesn't render when uploaded? A couple/few others aren't rendering either.
 
I mean, if you look at the video for Dr. Octavius that I uploaded to your media gallery, you'll see it's only producing sound, but no video.

I could send you the original file if it would help to inspect it - the video plays fine from my local hard drive and video player.

It's not with all videos, just some.
 
FWIW, both of the videos you uploaded and linked here play video and sound for me in Chrome. In FF, the second video doesn't play, though that may point to the original file itself not being totally valid (and FF's implementation being less forgiving).
 
Ah ok - I was testing on FF (about 10% of my audience).

You're right, it does work on Chrome (45%).

But it does not seem to work on Safari, either (31%).
 

Similar threads

Top Bottom