Page 1 of 1

Output size different when run from batch file using php

Posted: 02 Mar 2019, 14:56
by eigengrau
I know this is a bit of an edge case, but I was hoping someone would be able to help me out, or at least point me in the right direction.
I'm using a batch file to process videos with a vtm file. When this batch file is run from the command line directly, the resulting image is the correct size and uses my configured environment settings.

Code: Select all

@echo off
set sname=%1
set mtitle=%2
set ppath=D:\...\%mtitle%
set mpath=D:\...\%sname%\
if not exist "%mpath%" mkdir "%mpath%"
"C:\...\VideoThumbnailsMaker.exe" "%ppath%.mp4" /nc
if exist "%ppath%.mp4.jpg" move "%ppath%.mp4.jpg" "%mpath%%mtitle%.jpg"
if exist "%ppath%.jpg" move "%ppath%.jpg" "%mpath%%mtitle%.jpg"
if exist "%ppath%.mp4.vtx" del "%ppath%.mp4.vtx"
move "%ppath%.mp4" "%mpath%%mtitle%.mp4"
However, when I try and run the batch file with php using system(), shell_exec(), or exec() the resulting image is the incorrect size (smaller). The matrix is the correct one from my vtm preset, but it looks like some of the Environment settings arent being used (remove video extension and do not generate a vtx file). This same behaviour occurs when I try to run it directly from php, bypassing the batch file.

Code: Select all

system('"C:\...\Video Thumbnails Maker\VideoThumbnailsMaker.exe" "C:\...\Video Thumbnails Maker\Options\preset.vtm" "' . $unprocessed . $titlefixed . '.mp4" /nc');
Maybe the program thinks I'm using a smaller resolution when it is run this way? I have no idea. I've been searching for a solution for hours now and I'm at a loss.
I'd appreciate any help. Please let me know if you require more detailed information about anything.

Re: Output size different when run from batch file using php

Posted: 16 Mar 2019, 06:54
by admin
Some key points:
1) If no Options file specified, VTM uses Options stored in Windows registry.
2) Please check quotes in paths and the executable, because VTM uses default Options in case of failure to load Options file.