ffmpeg-progressbar-cli icon indicating copy to clipboard operation
ffmpeg-progressbar-cli copied to clipboard

No output while in a dos batch file

Open zoomphoto opened this issue 5 years ago • 2 comments

This is perhaps because the batch file is stopping the output, but ffmpeg-bar works perfect from the command line, but when running in a batch file, there is no output. It is working perfectly (as in the files are created), but no output is shown during operation.

Sample one (this just concatenates video camera files)

` @echo off SETLOCAL ENABLEDELAYEDEXPANSION

mkdir n:__ftp_upload_watch_folder%1

for /D %%D in ("n:%1*") do (

for %%a in ("%%D.") do set currentfolder=%%~na

if exist "%%D*.mp4" ( echo Processing MP4 %%D ... (for %%I in ("%%D*.mp4") do echo file '%%~nxI') > %%D\mylist.txt

)
if exist "%%D\*.mts" (
    echo Processing MTS %%D ...
    (for %%I in ("%%D\*.mts") do @echo file '%%~nxI') > %%D\mylist.txt
)

cd %%D ffmpeg-bar -f concat -i "%%D\mylist.txt" -n -c copy "n:%1%1_!currentfolder:~0,2!_1.mp4" echo !currentfolder! > "n:_ftp_upload_watch_folder%1%1!currentfolder:~0,2!_1_compress.title"

) `

This is my second file which then compresses the newly minted concatenations. Same thing, it works, but no progress-bar:

@echo off SETLOCAL ENABLEDELAYEDEXPANSION mkdir n:\__ftp_upload_watch_folder\%1 cd %1 (for %%i IN (*.mp4) DO ffmpeg-bar -hide_banner -n -i %%i -vf scale=1280:-2 -c:v libx264 -r 29.97 -crf 23 n:\__ftp_upload_watch_folder\%1\%%~ni_compress%%~xi ) Thanks!

zoomphoto avatar Aug 02 '19 18:08 zoomphoto

Same issue when ffmpeg-bar is run from a python3 script via os.system().

This alternative works for py3:

subprocess.run(ffmpeg_command, shell=True)

sebastienvercammen avatar Aug 08 '20 12:08 sebastienvercammen

You should fix your code markup above if you really want help, but that aside I find in linux bash scripts: Any time the ffmpeg command is inside nested loops I need to redirect ffmpegs output or it can break the loop... obviously you need appropriate syntax for windows.

Try slapping the windows-syntax equivalent of this at the very end of your command:

</dev/null

eg

ffmpeg .....-f mp4 -y "${exportName}" </dev/null

BETLOG avatar Aug 11 '20 05:08 BETLOG