Page 1 of 1

Post Processing Script hangs

Posted: March 5th, 2014, 3:41 am
by johimself
Hi, I am trying to run a post processing script which uses FFMpeg to remux .mkv files into .mp4 files. All it does is copy both the audio and video codecs and put the content in a new container then delete the .mkv version.

The script hangs, the SAB interface shows "Running script", ffmpeg is shown as still running but using no system resources and SAB will no longer process any more scripts on subsequent files. If I click on the Script Log button in the SAB interface it shows as blank.

I was wondering if anyone could show me the error that my script is causing or tell me where the log files for scripts are kept (or if there is a way of seeing script progress while the script is running). The script is as follows:

Code: Select all

set ffmpeg="C:\Program Files\FFMPEG\bin\ffmpeg.exe" 

set name=%3
set name=%name:"=%
set dirname=%1
set dirname=%dirname:"=%

for /R "%dirname%" %%f in (*.mkv) do (
%ffmpeg% -i "%%f" -vcodec copy -acodec copy "%dirname%\%name%.mp4" 
del "%%f")

exit

Re: Post Processing Script hangs

Posted: March 5th, 2014, 8:42 am
by sander
Does the script work when you just run it from the command line (so NOT from SAB)?

I would put an echo before, in and after the for-loop. AFAIK SAB shows the script output.

Re: Post Processing Script hangs

Posted: March 5th, 2014, 1:26 pm
by johimself
Hi, thanks for your reply.

Interestingly running the script with variables thrown at it makes it hang on a y/n prompt.

The script runs through the file specified by the script with no problem, then when it tries to start remuxing another mkv file in the directory then it tries to give it the same filename as the first. This is when it asks if I want to overwrite y/n (which obviously isn't an option for SAB)

Looks like I'll have to look at truncating filenames etc to make another variable of the .mkv filename without the .mkv extention which I can then use as the filename of the .mp4

If anyone has any insight into how to do this that would be great.

Thanks for your help.