kylegilman / video-embed-thumbnail-generator

A WordPress plugin that generates thumbnails, HTML5-compliant videos, and embed codes for locally hosted videos. Requires FFMPEG or LIBAV for encoding.
http://wordpress.org/plugins/video-embed-thumbnail-generator/
GNU General Public License v2.0
48 stars 25 forks source link

Thumbnail cant be generated when a video file name contains colons. #409

Closed edmondoddy closed 5 years ago

edmondoddy commented 6 years ago

Hi, Thumbnail/images cant be generated if the source video got " : " in the file name. I didnt tried file with other symbols, but possible there are many...

kylegilman commented 6 years ago

A colon is a particularly special character and in most cases WordPress doesn't allow them in filenames. How are you getting files with colons in their name? Are you using FFMPEG to make the thumbnails?

edmondoddy commented 6 years ago

Hi, yes I am using the latest version of FFMPEG, this is a rare case when I found colon in my videos file names, so you right that is unnormal to find a video file with colons...

Wordpress uploads video without problem, but when it tries to generate thumbnail an error message shows up that the video cant be found so it cant generate the image, but the file exists, looks like the WordPress or more possible hosting cant show this file correctly cause of colon, btw I am using Siteground hosting, which is the best one as I know...

kylegilman commented 6 years ago

When it first encounters a colon in an input string, FFMPEG thinks that it's the protocol part of a URL, so it doesn't properly parse the filename. When files are uploaded through the normal WordPress "Add Media" process, the filename is sanitized to avoid these sorts of problems and characters like colons are replaced with dashes. I'm surprised that's not happening in your case. The only way I know of that you could get a colon to remain in your filename after uploading is if you're using the Add From Server plugin. Are you using Add From Server?

edmondoddy commented 6 years ago

I use Autogenerating, the manual upload from Media library and manually adding thumbnail works ok, its just Automate function looks like that can't convert...

kylegilman commented 6 years ago

Yes, that's the only process that uses FFMPEG and the problem is an FFMPEG issue. The manual thumbnails use the browser to decode your video and don't care what the filename is.

But I'm completely baffled that you're able to get a colon past the built-in WordPress sanitizing system. I can't fix the bug myself because I can't import a file to WordPress without the colon being removed from the filename automatically.

edmondoddy commented 6 years ago

Ah I see what's happening now, even my windows doesn't let me use the colon on file names, so I didn't made the file myself, I did download it from here - https://www.youtube.com/watch?v=R3GfuzLMPkA as I was needed to test my site on 4K video, if you check the title of youtube video it has colon, and the service that downloads the youtube video has made the video name from title and made the filename with colon...

So, to have colon on files is not a normal thing, and I think no one will get this problem.

Sorry if I wasted your time...

edmondoddy commented 6 years ago

BTW, I did try to upload a video with colon included on the file name to WordPress and also the same file without a colon, please check the screenshot, the video file still got colon in the URL.

http://nimb.ws/bGtqyi