Click here to Skip to main content
15,891,529 members

Comments by malcomm (Top 11 by date)

malcomm 23-Dec-13 15:38pm View    
Thanks for that. Perfect!
malcomm 1-Jul-13 16:58pm View    
Thanks Mike
Not sure if you got the bit about my app working perfectly UNTIL it is run under Win7 Scheduler?
Not really much difference in our code when it all boils down except that I am referencing a font via 'drawtext' which you do not. Good idea about capturing the entire error stream, didn't think of that - I was only capturing the frame rate for progress indication. When I capture the entire stream, it shows a failure loading the font -
[drawtext @ 01A39000] Could not load fontface from file 'TWCAB___.TTF': cannot open resource
Error initializing filter 'drawtext' with args 'fontfile=TWCAB___.TTF:text=Linley Point, NSW:x=790:y=96:fontsize=20:fontcolor=white:shadowcolor=0x000000EE:shadowx=1.5:shadowy=1.5'
Error opening filters!

The font is in the bin folder where it should be and therefore supposedly doesn't need a path specified. Remember it works fine in standalone and this problem only occurs under the Scheduler.
Well you can't just give it a normal path as the colon and forward slash are reserved ffmpeg drawtext commands so you have to change things thus - C:\AppPath\fontname.ttf becomes 'C\:\\AppPath\\fontname.ttf'. Note the single quotes around it in case there are spaces in the path name.

And that is working now in Scheduler.
Hooray!!!


BTW my paths are correct.
malcomm 19-Sep-12 20:40pm View    
Hi Pete

Your code has given me some vaulable knowledge but unfortunately has failed to give me a solution to the Win7 Schduler crap.
I've gotten it to point where Win7 scheduler will fire up ffmpeg from within my app but ffmpeg is now failing with its internal processes...

I'm going to replace the Win7 scheduler and see how that goes.

Many thanks for all help. Your ideas have already been incorporated into another project of mine so are greatly appreciated.

regards
Malcom
malcomm 17-Sep-12 1:33am View    
Pete
If you want to send yourself nuts with this, heres the XML that Scheduler exports for this app- WebCam_Archerfield_NNE.exe is the app name.
If you run Win7 then you could import that into scheduler and ruin your day a bit...


<task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<registrationinfo>
<date>2012-09-13T14:44:35.2076061
<author>Malcom-PC\Malcom

<Triggers>
<calendartrigger>
<startboundary>2012-09-13T14:43:46.4258159
<enabled>false
<schedulebyday>
<daysinterval>1


</Triggers>
<Principals>
<Principal id="Author">
<userid>Malcom-PC\Malcom
<logontype>InteractiveToken
<runlevel>HighestAvailable
</Principal>
</Principals>
<settings>
<multipleinstancespolicy>IgnoreNew
<disallowstartifonbatteries>true
<stopifgoingonbatteries>true
<allowhardterminate>true
<startwhenavailable>false
<runonlyifnetworkavailable>false
<idlesettings>
<stoponidleend>true
<restartonidle>false

<allowstartondemand>true
<enabled>true
<hidden>false
<runonlyifidle>false
<disallowstartonremoteappsession>false
<useunifiedschedulingengine>false
<waketorun>false
<executiontimelimit>P3D
<Priority>7</Priority>

<actions context="Author">
<exec>
<command>"C:\Users\Malcom\Documents\Visual Studio 2008\Projects\WebCams\TAWN WebCams QLD\WebCam_Archerfield_NNE\bin\Debug\WebCam_Archerfield_NNE.exe"
<arguments>True


malcomm 17-Sep-12 1:24am View    
I ran it again with a command of 'ProcessAsUser.Launch("C:\Windows\notepad.exe")'.
Same results with the LaunchProcessAsUser function-
result = CreateProcessAsUser etc is returning false

I'll try the library as well as I have some 70 scheduled items that need to be manually entered if I ever get the roitten thing working. That'll save me a ton of time as I've had no luck creating schedule tasks in code so far.
Thanks
Malcom