-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue in running ffmpeg using CmdExecuteService #943
Comments
I dunno if this is the case, I'm really just speculating here, but this ticket sounds like a pipe race condition to me. If FFMPEG fills the We might want to make sure we are emptying STDERR as we drain STDOUT to make sure a race like this doesn't happen. I've seen a similar bug before in the imagemagick module (Patch here). We might be able to replace this code with some nifty PHP7 library code to do this for us, since working with pipes in a non-blocking way is always an error filled thing, offload the work to someone else, but I don't have any libraries to suggest. |
@jonathangreen FFMPEG does fill STDERR with error messages, so that is very likely the issue. We probably also want to do something with it in the event of an error. I found this useful when digging around for some answers: https://trac.ffmpeg.org/wiki/PHP We also use |
It is actually hanging here: https://github.com/Islandora-CLAW/Crayfish-Commons/blob/master/src/CmdExecuteService.php#L65, not on L83 as I originally noted. Jonathan's fix does not seem to help. |
Well, according to http://php.net/manual/en/function.feof.php there are a
few reasons why it might hang there, all dependent on how that passed $data
variable is set up. Although, I haven't looked at how execute gets called
to see if they apply.
…On Thu, Sep 27, 2018 at 2:36 PM Natkeeran ***@***.***> wrote:
@dannylamb <https://github.com/dannylamb> @jonathangreen
<https://github.com/jonathangreen>
It is actually hanging here:
https://github.com/Islandora-CLAW/Crayfish-Commons/blob/master/src/CmdExecuteService.php#L65,
not on L83 as I originally noted.
Jonathan's fix does not seem to help.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#943 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcfHpF93BoohWDCRjaee454biN0Nild1ks5ufUTIgaJpZM4W4_kP>
.
|
@Natkeeran Any updates on this? We keep missing each other on IRC. Is there anything I can help you with? |
@Natkeeran https://github.com/PHP-FFMpeg/PHP-FFMpeg/#using-with-silex-microframework Looks like there's some OO wrappers that might be worth checking out. They've even got a service provider for silex. |
@Natkeeran Yeah... so... looks like you'd have to be very explicit with PHP-FFMpeg. And I've played around with streams for a few hours now and have had absolutely no luck. I cannot seem to specify the format of the input stream for the life of me. Let's just save the request body to a temp file and pass that to ffmpeg. That's what PHP does anyway when uploading files 🤷♂️ It ruins my ideal world of just passing streams around all the time, but pragmatically... let's just write the temp file. |
This issue is related to how ffmpeg handles input stream. We are working around this issue by directly providing the http url of the resource. |
I recently installed CLAW using the claw-playbook. I noticed that when I added videos to a repository item, the derivatives were not generated. I saw on homarus.log that the command was being executed, but it remained at that stage. I tried running the command on my command line to see what was going on, and noticed that at some point I was asked for input. After some research, I added the flag |
This is a ticket to follow up on issue related to running ffmpeg commands using Crayfish-Commons CmdExecuteService. In trying to create a micro service to return ffmpeg result as stream (Example: https://github.com/Natkeeran/Homarus/blob/master/src/Controller/HomarusController.php#L54), we are running into a hang situation. It seems to be hanging here: https://github.com/Islandora-CLAW/Crayfish-Commons/blob/master/src/CmdExecuteService.php#L83.
Additional Notes from the Chat:
This issue is related to #929
The text was updated successfully, but these errors were encountered: