Related Topics


[Video CMS v4]Getting multiple files when uploading only one  (Read 764 times) Print

1 B


anokana  October 10, 2014, 11:54:43 AM

Hello, Mario!
I get videos uploaded and converted properly by ffmpeg, but when I am uploading only one file, I have  more then 5000 duplicate files in the list in Video Manager of Admin Panel (and the same in ..._Videos table of the database)!
What is the problem?
Thanks

Logged


@Mario  October 10, 2014, 03:43:51 PM

Hi! I assume is an shell_exec issue with triggering videocron.php, try this:

You could try this solution I've shared on 23 February.


lib/upload-ffmpeg.php
Code
//Needs converting
$db->query("INSERT INTO ".DB_PREFIX."videos (`date`,`pub`,`token`, `user_id`, `tmp_source`, `thumb`) VALUES (now(), '0','".$token."', '".user_id()."', '".$file."','uploads/processing.png')");
$binpath = get_option('binpath','/usr/bin/php5');
$command = $binpath." -f ".ABSPATH."/videocron.php";
exec( "$command > /dev/null &", $arrOutput );

changed to

Code
//Needs converting
$db->query("INSERT INTO ".DB_PREFIX."videos (`date`,`pub`,`token`, `user_id`, `tmp_source`, `thumb`) VALUES (now(), '0','".$token."', '".user_id()."', '".$file."','uploads/processing.png')");

and videocron.php added as a cpanel cron (else, no conversion).
http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/CronJobs
http://www.siteground.com/tutorials/cpanel/cron_jobs.htm

This has happen before, but it's 2-3 people out of thousands, can't say it's an error to fix.
Mostly an shel_exec conflict on server.


Let me know the outcome.

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!


anokana  October 11, 2014, 09:54:59 PM

Hey, Mario,
I solved the problem by replacing the line

Code
$command = $binpath." -f ".ABSPATH."/videocron.php";
with
Code
$command = $binpath."-cli -f ".ABSPATH."/videocron.php";

This runs the script only one time

Logged


@Mario  October 13, 2014, 03:29:10 PM

Thanks for reporting, I will check how safe is that -cli.

Logged
Hello!
If you wish to learn how to start coding on the PHPVibe Video CMS head to the blog.

Please use the search before opening a new topic!