0

I'm pretty much a noob at this, so any help is appreciated.

I'm trying to run the video transcoding executable REDline on all .R3D files in a given folder. REDline only accepts single files, which is the issue. I finally got it to search recursively for the files I need, but my problem is the search function passes the next result to REDline before the first one is finished transcoding. I have the search results that need to run in a variable inside REDline.

Here's the code:

for /r D:\folder\ %%a in (*) do (
   "C:/Program Files/REDCINE-X PRO 64-bit/REDLine.exe" --exportPreset "Prores_Intermediate" --i "%%~dpnxa" --useRSX 2 --masterRMDFolder "" -s 0 -e 95

)

After about .7 seconds, REDline reports 'received stop message from client'.

I don't think this is a REDline error, as I have been able to transcode single files successfully.

Thanks.

2 Answers2

0

Try start /wait when running the executable.

If that does not help, the executable might start another executable which does the actual job. In that case identify the other executable using Process Monitor or Process Explorer. Check their command line parameter to see if you can run that executable directly.

If you can't run the other process yourself, you can wait until that process has exited. See Wait for executable to finish here on StackOverflow.

Community
  • 1
  • 1
Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
  • start /wait does not help. It appears that REDline is starting redexport.exe . Since I'm pretty new, I'm not sure exactly how I can wait for the process to finish before continuing the loop. Seems like if it checks for redexport.exe in the loop process I should be good to go. – user3697573 Jun 01 '14 at 21:48
  • Try `redexport.exe /?` to see if you can call it directly. Or, as you said, wait for redexport to finish in a loop similar to the link I posted. – Thomas Weller Jun 02 '14 at 06:09
0

Im not familiar with that particular executable, but here are some suggestions you may try: - Check the allowed parameters for REDLine.exe (documentation or possibly /?) to find out if there is any that might address your problem - There are tools that allow you to check for the existance of a process (Microsoft Sysinternals, check the ones starting with PS*.exe) http://technet.microsoft.com/de-de/sysinternals/bb545021.aspx Use this to improve your loop so that you check if the process is running first before continuing with the next loop - or loop without doing anything until the process has exited, you can do with repeatedly calling a ping to localhost inside your loop for a fixed time interval for example - Check the errorcodes returned by programs to see if that helps you - Put the code that starts your encoding inside its own batch file, and the check if the process is currently running as well - Use the creation of a dummy file before starting and delete it once finished to discern if an instance of your batch is running - Check the difference between calling a command directly from a batch file, and using the start command to run it at the same time

sibi
  • 39
  • 6