0

If the file name (%F) starts with a "-" character, the file is not found by ffprobe.exe (the file name from the next character after "-" is passed to ffprobe).

How to save this correctly?

for /f %%i in ('ffprobe -v error -select_streams v:0 -show_entries stream^=height -of csv^=s^=x:p^=0 "%%F"') do set hgt=%%i

I expected the full file name to be passed to ffprobe.exe, e.g. "- 7.06.2022.mpg"

asked Aug 8, 2024 at 20:09
0

1 Answer 1

1

Use the -- flag at the end of the command before the filename to indicate to ffprobe that there are no more flags expected and that any additional leading dashes are part of the filename.

for /f %%i in ('ffprobe -v error -select_streams v:0 -show_entries stream^=height -of csv^=s^=x:p^=0 -- "%%F"') do set hgt=%%i
answered Aug 8, 2024 at 20:20
Sign up to request clarification or add additional context in comments.

5 Comments

Thanks! I had a similar problem with ffmpeg -- this worked as well.
It's a common flag for most (if not all) applications that have a Linux version.
Also, if this solved your problem, please click the checkmark next to my answer to mark it as the solution.
Done. I'm wondering -- why isn't the file name in quotes sufficient in this case?
You'd have to check the source code. Presumably the part of the code that processes arguments allows for the entire argument to be in quotes as well.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.