some help to run a batch in the command executor

Questions and answers on how to get the most out of FFAStrans
Ghtais
Posts: 157
Joined: Thu Jan 19, 2017 11:06 am

Re: some help to run a batch in the command executor

Post by Ghtais »

Hi Emcodem

I have tested on C:\ drive and it doesn't work. Same story as if it was on D:\ drive :(
emcodem
Posts: 1643
Joined: Wed Sep 19, 2018 8:11 am

Re: some help to run a batch in the command executor

Post by emcodem »

Hey Ghatis,

Unfortunately at this point, it is not clear to me if your batch is not called by ffastrans or the content of the batch is the problem.
Can you tell if your batch is called? If not it should be easy for you to get it out by just adding a logging message as first line in your batch like that:

echo %time% >> c:\temp\batchlog.txt

In case your batch is called but it does not work as expected, you might want to post the exact, uncut contents of your batchfile in order to let me detect where permission issues could appear.

cheers,
emcodem
emcodem, wrapping since 2009 you got the rhyme?
Ghtais
Posts: 157
Joined: Thu Jan 19, 2017 11:06 am

Re: some help to run a batch in the command executor

Post by Ghtais »

Hi emcodem

absolutely, FFAStran call the batch. I thing there is an issue with the batch but I don't understand why it is OK on a CMD windows and why it is not with FFAStrans
Here is the batch. The goal is to obtain from a command text file the path, the in and out point and to cut the file with ffmpeg.
I test if the file is .mpg or .mxf and I copy the result in two different locations.

Code: Select all

SETLOCAL EnableDelayedExpansion
set /A compteur=1
FOR /F "eol=C tokens=1,2,3,4,5,6,7,8,9,10* delims=\|." %%G IN ('type D:\INGEST\PANIER\%1') DO (
set chemin=\\%%G.%%H.%%I.%%J\%%K\%%L\%%M\%%N.%%O
set /A debut=%%P/1000
set /A fin=%%Q/1000
IF /I %%O==MXF (
C:\FFAStrans0.7.6_Win32\Processors\FFMpeg\ffmpeg.exe -i !chemin! -ss !debut! -to !fin! -c:v copy -c:a copy D:\INGEST\VENTEH264\%1_EXTRAIT_compteur_%%I.MXF) ELSE (
C:\FFAStrans0.7.6_Win32\Processors\FFMpeg\ffmpeg.exe -i !chemin! -ss !debut! -to !fin! -c:v copy -c:a copy D:\INGEST\VENTEH264\%1_EXTRAIT_compteur_%%I.mpg)
set /A compteur=compteur+1
)
emcodem
Posts: 1643
Joined: Wed Sep 19, 2018 8:11 am

Re: some help to run a batch in the command executor

Post by emcodem »

Hey Ghatis,

as you run ffastrans as a service but execute the batch as logged-on-user, your problem is most likely a permission issue.
What credentials is your ffastrans service running as? - try to set the service credentials to the same as you type when logging on to windows.

As far as i see in your batch, you set "chemin" to a UNC path. Chances are very high that your problem is that your ffastrans service does not have access to this UNC path (chemin).

Also it is a good idea to do some logging when working with batches (or any other self-developed program). You can for example read your ffmpeg's output when adding this at the end of each ffmpeg command:

Code: Select all

2>> c:\temp\ffmpeg_log.txt
From the current perspective, i suspect that you will read an error message from ffmpeg in ffmpeg_log.tx like "no such file or directory" - as it does not have permissions to read from the specified UNC share.

For learning purposes, open "services.msc" and make sure ffastrans is running as the same user as you are logged in in windows:
service.png
service.png (52.96 KiB) Viewed 5463 times
After you made it work with the same user that you log on in windows, you need to find another account that can access the UNC share but that's password don't change ever and let the windows service run under this credentials.
emcodem, wrapping since 2009 you got the rhyme?
Ghtais
Posts: 157
Joined: Thu Jan 19, 2017 11:06 am

Re: some help to run a batch in the command executor

Post by Ghtais »

Hi emcodem

yeahhhhh it works !!!
Thank you so much for your patience and your time it help a lot !!

thx !
Post Reply