Media transcoding halts if process fails

mattrogowski

Well-known member
Affected version
2.2.3
We've had an issue on a site where large videos (say 100MB+) don't seem to get transcoded. I'm not entirely sure what actually goes wrong, but the queue_state of the queue items remains at processing several days after being queued, so it appears that the ffmpeg process itself starts but never finishes and $transcoder->finalizeTranscode($outputFile); never runs. The primary issue is that due to whatever is actually going on to cause the transcoding to not finish, the queue items stay in the queue, with a status of processing, forever. There is no cleanup or fallback for this eventuality. The queue item is deleted as the first action inside finalizeTranscode, which is how I can tell this is never being run. The problem is that as soon as this happens to 5 items (or whatever your queue limit is), future media will be queued, but will never be processed, because the allocation of 5 has been taken up by processes that have long since died and are now orphaned.

What I've done to resolve this is extended the process to only queue the media if it is below 100MB, and also to add a column of when the processing started (not just when it was added to the queue), and then after say 20 minutes if it still hasn't finished, just create the media without transcoding it and delete the queue item.

Obviously the fact the transcoding process times out isn't anything XF can do anything about, however I think the queue needs to be more resilient to that happening. You don't even know it's happened until you start getting reports of media never showing up after a while, by which time you then find 100+ queued items due to 5 being stuck on processing despite being added several days ago.
 
I have a similar issue.
Even if I manually delete the xf_job entry, new uploads are not being transcoded.
 
Top Bottom