1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Media Gallery Resolved Bugs' started by tonmo, Nov 20, 2015.

  1. tonmo

    tonmo Active 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.
  2. Chris D

    Chris D XenForo Developer Staff Member

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

    tonmo Active Member

    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.
  4. Chris D

    Chris D XenForo Developer Staff Member

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

    tonmo Active Member

    Thanks. Will likely not make progress until the weekend just fyi.
  6. tonmo

    tonmo Active Member

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

    Chris D XenForo Developer Staff Member

    Well this makes less and less sense with each post :)

    Are you able to upload the video here? Does it exhibit the same behaviour?
  8. tonmo

    tonmo Active Member

  9. tonmo

    tonmo Active Member

  10. Chris D

    Chris D XenForo Developer Staff Member

    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:
    $filename strtr($filenamestrtolower(substr(strrchr($filename'.'), 1)), 'mp4');
    Replace with:
    $filename preg_replace('/\\.[^.\\s]{3,4}$/''.mp4'$filename);
    tonmo likes this.
  11. tonmo

    tonmo Active Member

    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.
  12. Chris D

    Chris D XenForo Developer Staff Member

    I'm actually not sure.

    What exactly do you mean by not rendering? Is it all videos, or just some?
  13. tonmo

    tonmo Active Member

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

    Mike XenForo Developer Staff Member

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

    tonmo Active Member

    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%).
  16. tonmo

    tonmo Active Member

    ok, actually it does work on Safari os10.x, but not on iphone

Share This Page