Media Converter Problem

sindomaker3403

New Member
YetiShare User
Dec 29, 2013
39
0
0
Hi all,

i have a little problem with media converter plugin, for now i just use media converter to capture screenshot video especially for video with mp4 format. when i enable media converter plugin, After a few minutes my server became down (error 502) and i need to reboot my server and disable media converter plugin. in php slow log i get this

"[pool xxxxxxxx] pid 27142
script_filename = /home/xxxxxxxx/xxxxxxxx.com/plugins/mediaconverter/site/resize_image.php
[0x00007fcdac1046a0] curl_exec() /home/xxxxxxxx/xxxxxxxx.com/core/includes/coreFunctions.class.php:153
[0x00007fcdac102e58] getRemoteUrlContent() /home/xxxxxxxx/xxxxxxxx.com/plugins/mediaconverter/site/resize_image.php:90"

My yetishare version : 4.3
Media converter plugin : 4.3
i use cloudflare for all my server.

if anyone can help me, i can donate $10 via paypal. thank you
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
Assuming you have installed ffmpeg ?

Maybe try running
ffmpeg -ss 00:00:30:01 -y -i input.mp4 -vframes 1 output.jpg
and see if it generates a screenshot to make sure ffmpeg is working on your server..
 

sindomaker3403

New Member
YetiShare User
Dec 29, 2013
39
0
0
Thank you sukhman21, but that's is not problem, the problem appear when i use SSL Cloudflare before i use SSL, media converter can generate the screenshot of video, from my investigation there is something wrong with Curl when we use SSL Cloudflare,
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
Did you update curl to latest version using city repo ?
Also, make sure you have IP address and not the domain name in fileservers settings.
 

sindomaker3403

New Member
YetiShare User
Dec 29, 2013
39
0
0
Finally i found the solution, in core/includes/coreFunctions.class.php

i tried changes this lines :

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, false);

to this:

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "COMODOECCCertificationAuthority.crt");
curl_setopt($ch, CURLOPT_CAINFO, "/etc/ssl/certs/");
curl_setopt($ch, CURLOPT_HEADER, false);

remember i use free ssl certificate from cloudflare.

source:
http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/