B
B
Brendan Castaneda2020-11-05 17:31:16
cmd/bat
Brendan Castaneda, 2020-11-05 17:31:16

How can I write 2 expressions to a bat file?

Maybe I didn't express myself correctly in the question (don't throw stones).
I want something to execute first one part of the code, then the other one below.
But I only have 1 piece of code running. The second is ignored.
Can you tell me how can I record it?
PS The line in the code ping -n 1 -w 3000 192.168.254.254 >nulis not needed, it is for me to see when the 2nd part of the code starts to work. Which doesn't work at all..

color a
@echo off
set a="Your_files\*.mp4"
set b="Result\file-%%03d.jpg"
set c=ffmpeg
set f=-vf fps=10
for %%a in (%a%) do (%c% -y -i "%%a" %f% %b%)
ping -n 1 -w 3000 192.168.254.254 >nul
set a1="Result\file-%%03d.jpg"
set b1="Result\video.mp4"
set c=ffmpeg
set f1=-f image2 -r 3
for %%aa in (%a1%) do (%c% -y -i "%%aa" %f1% %b1%)


Part 1, I make a set of JPG files from the video.
Part 2 is supposed to assemble them back into mp4
PS I will remake this file later as soon as I can use 2 codes in one bat file. No need to ask questions why I parse mp4 and assemble it into a defective mp4 without sound ..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Brendan Castaneda, 2020-11-05
@ae_ph

I want to replace another mistake. Now everything works.
I stuck the %f1% variable in the wrong place, here is a ready-made solution.

color a
@echo off
set a="Your_files\*.mp4"
set b="Result\file-%%03d.jpg"
set c=ffmpeg
set f=-vf fps=10
for %%a in (%a%) do (%c% -y -i "%%a" %f% %b%)
set a="Result\file-%%03d.jpg"
set b="Result\video.mp4"
set c=ffmpeg
set f=-f image2 -r 3
for %%a in (%a%) do (%c% -y %f% -i "%%a" %b%)

Thanks wisgest for the help.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question