[ACCEPTED v4.4] Media Converter plugin minor change

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
Hello Adam,
I had asked this before but i guess not a whole lot of people use mediaconverter.
I think the ability to setup number of conversions per server in the fileserver (same place we put in SSH credentials) would be helpful because right now, i have multiple servers running conversions and i sort of have to trigger them manually.

Reason: i have set the conversions set to 20 and if i run via cron, i dont want 1 server to pickup and process all 20 conversions. If we can setup say 3 per computer or specific number of conversions on every server, that would help a lot and distribute conversions on servers rather than putting all the CPU load on 1 server.
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
Re: Media Converter plugin minor change

Can we look at this please. This is a big issue if there are multiple videos pending for conversion. The first fileserver to run cron job will start all the pending conversions and the other servers wont run anything because the first one would run the max allowed conversions.

We need this option to set video conversion load balance between fileservers.
Can we have a setting (maybe where we specify SSH settings in fileserver admin panel) to set max conversions per server instead of max conversions for the whole site.
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
Re: Media Converter plugin minor change

I don't have the code here since I don't have this plugin, but I'm pretty sure that you can tweak one query or two to make the script get only 3 jobs per cron execution.
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
Re: Media Converter plugin minor change

Thanks for your reply @enricodias4654, i do know the code that pulls the conversions and all but just not sure how would i program it to pull only 2 conversions. Right now it pulls all pending conversions.

Can you look at this code below real quick and see what change i can make here please?

// check for pending conversions
$stmt = $db->query("SELECT id, file_id, capture_video FROM plugin_mediaconverter_queue WHERE status='pending' ORDER BY date_added ASC LIMIT 1");
$pendingRow = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$pendingRow)
{
output("[".SERVER_NAME_FOR_LOGS."]: No pending conversions found.\n");
exit;
}

Thanks
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
Re: Media Converter plugin minor change

sukhman21 said:
Thanks for your reply @enricodias4654, i do know the code that pulls the conversions and all but just not sure how would i program it to pull only 2 conversions. Right now it pulls all pending conversions.

Can you look at this code below real quick and see what change i can make here please?

// check for pending conversions
$stmt = $db->query("SELECT id, file_id, capture_video FROM plugin_mediaconverter_queue WHERE status='pending' ORDER BY date_added ASC LIMIT 1");
$pendingRow = $stmt->fetch(PDO::FETCH_ASSOC);
if (!$pendingRow)
{
output("[".SERVER_NAME_FOR_LOGS."]: No pending conversions found.\n");
exit;
}

Thanks
Answered via PM. For anyone else reading this topic, the code itself apparently starts 1 conversion at a time and running it in other servers should work. Notice that since the code doesn't use transactions, if 2 servers execute the script at the same time they can start converting the same file.
 

adam

Administrator
Staff member
Dec 5, 2009
2,043
108
63
Re: Media Converter plugin minor change

@sukhman21 - Just to let you know I've done some work in the plugin to allow for this. The concurrent option still exists however it's now based on the server running it. It's part of the beta plugins and will be out when we go into final release (aiming for Sunday 5th).
 

sukhman21

Member
YetiShare User
YetiShare Supporter
Jan 26, 2015
508
3
18
Thank you Adam. This is a big help for those who run mediaconverter and mediaplayer plugin on their site.