I posted this over at Openpackage.biz, as a support request, but after I was able to tshoot some, it turns out it's a bug on windows systems and I saw somewhere you prefer bugs be listed here at drupal.org. So here it is:
Windows doesn't like the command being sent to it:
time nice -n 19 ffmpeg -i "D:\WIKI\public_html\files\videos\original\sample.avi" 2>&1
1. "time nice -n 19" causes the system to sit there waiting for input ("The system cannot accept the time entered. Enter the new time:"). even "time" leaves the system waiting there to set the time.
2. If i remove that, ffmpeg doesn't like ffmpeg -i "D:\WIKI\public_html\files\videos\original\sample.avi" 2>&1, it says "Must supply at least one output file".
I believe the "2" is supposed to be grabbing the output file from the function call, but it's coming in NULL on my system.
I know this is a result of my being on a windows box, I'm just not sure how to fix it. I can certainly hack _op_video_exec to produce a command line of the form "ffmpeg -i sample.avi sample.flv, but will that break the module? How do you grab the output file for embedding?What's the point of the "time" and "2>&1"? I know its probably capturing the time and trying to redirect the output somehow, but I don't know enough about linux to figure out how to translate that functionality for windows.
Any insights/suggestions would be greatly appreciated.
Comments
Comment #1
WorldFallz commentedOK after some more research a little more info. the "time nice -n 19" is strictly a linux thing, I can change time to use the php time() function, i'll have to remove the "nice -n 19" thing (not exactly sure what it's purpose is and if i can be duplicated for windows), but I still can't figure out why the input file name is coming up null.
Comment #2
jbrown commentedboth the 'time' and 'nice' commands are unnecessary.
'time' just provides timing info in the output.
'nice' lowers the scheduling priority of the transcoding. I have now removed this from the latest dev as admins can just put 'nice' into their cron setup.
The reason you get the error "Must supply at least one output file" is because op_video initially just runs ffmpeg with no transcoding options to interrogate the file so that the optimal transcoding parameters can be determined. It is by design.
The reason for the '2>&1' is so that op_video can get at the output from ffmpeg. ffmpeg can pipe video through stdout, so all messages go through stderr. exec() records the information from stdout. '2>&1' redirects stderr => stdout.
DOS cannot do this, so op_video ffmpeg transcoding will not work. I recommend you try cygwin. op_video will need to be amended. I can do this for you.
Comment #3
WorldFallz commentedThanks for the reply and wealth of explanatory information. I've played around with cygwin before for other reasons on other servers and I'm trying to avoid it if possible. As a reluctant WAMP user I'm used to these little windows gotchas and till now, I can usually find a way around them.
I appreciate the info and offer, but the last thing I want to do is complicate matters by using and maintaining a custom module. I'll probably just keep doing what I'm doing now (manually encoding the files, attaching to nodes, & embedding the video) until drupal settles on a media handling methodology. Media Mover is looking promising.
Kudos on your module though... of all the ones currently baked, and I tried them all, IMHO yours has the best approach/technical implementation.
Thanks again for taking the time to explain the problem for me.
Comment #4
jbrown commentedComment #5
jbrown commentedComment #6
Paul Lomax commentedI have managed to get it working, simply by removing 'time' from the start of the command the transcode runs fine. (This is on line 429 of op_video.module)
What happens though is all the output gets posted to the browser when cron is run, presumably because it doesnt know where to pipe it to, but by using wget as a scheduled task to run the cron job every 1 min then it gets output to nowhere anyway and nobody is any the wiser.
If you use poormanscron then this will cause problems when a page refresh triggers cron, the user who did it will get a page full of ffmpeg output.
I'm unsure as to what is lost in this output however, but it all seems okay.
Comment #7
jbrown commented