U
U
Universal322021-07-01 11:36:35
bash
Universal32, 2021-07-01 11:36:35

How to rewrite bash for windows?

I can't figure out how to rewrite bash for windows.
Task: run ffmpeg on the id.mp4 file in the id/id folder.
As an example, I have a Linux command that runs a script with the same meaning of going to folders.

#!/bin/bash
for i in {29232..35000}; do sh -c "./spritevideo -i stream/${i}/${i}.mp4 -o stream/${i}/ -p stream/${i}/${i}_thumbnails.jpg || true"; done

My ffmpeg code:
ffmpeg -loglevel warning -stats -i "%%a\%%a.mp4" -pix_fmt yuv420p -vf "scale=w=trunc(ih*dar/2)*2:h=trunc(ih/2)*2, setsar=1/1, scale=w=1280:h=720:force_original_aspect_ratio=1, pad=w=1280:h=720:x=(ow-iw)/2:y=(oh-ih)/2:color=#000000" -c:v libx264 -preset:v slow -strict experimental -ac 2 -preset:a slow -c:a aac -sn -map_metadata -1 -map_chapters -1 -threads 0 "%%a\%%a2.mp4"

It turns out something like this, but I'm dumb and it doesn't work:
for %%a in {29232..35000} do ffmpeg -loglevel warning -stats -i "%%a\%%a.mp4" -pix_fmt yuv420p -vf "scale=w=trunc(ih*dar/2)*2:h=trunc(ih/2)*2, setsar=1/1, scale=w=1280:h=720:force_original_aspect_ratio=1, pad=w=1280:h=720:x=(ow-iw)/2:y=(oh-ih)/2:color=#000000" -c:v libx264 -preset:v slow -strict experimental -ac 2 -preset:a slow -c:a aac -sn -map_metadata -1 -map_chapters -1 -threads 0 "%%a\%%a2.mp4"

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2021-07-01
@Universal32

Install the git for windows that bash comes with and don't rewrite anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question