I have 109 videos in two folders. One contains 1-78, the other contains 79-109. They are all 24fps videos with names a1-a109. I want to convert them to 120fps videos b1-b109.
I want to use the following command on all of them:
ffmpeg -i a.mov -r 120 -vf "setpts=(1/5)*PTS" -an b.mov
Is there an alternative command which effectively gives this command to multiple inputs, or will I have to type the "normal" command 109 times?
Multiple files with one ffmpeg command?
-
- Posts: 33
- Joined: 03 Dec 2016, 16:03
- Location: Houston, TX
Re: Multiple files with one ffmpeg command?
You can script it. For example with this command:
This will run ffmpeg 78 times, for each aN.mov file, and produce a bN.mov output, where N goes from 1 to 78.
(This assumes you're on Linux or Mac OS. This won't work on Windows.)
Code: Select all
for i in {1..78}; do ffmpeg -i a$i.mov -r 120 -vf "setpts=(1/5)*PTS" -an b$i.mov; done
(This assumes you're on Linux or Mac OS. This won't work on Windows.)
Steam • GitHub • Stack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
-
- Posts: 33
- Joined: 03 Dec 2016, 16:03
- Location: Houston, TX
Re: Multiple files with one ffmpeg command?
I'm on Windows, so unfortunately this won't work.
Thanks for trying to help though.
Thanks for trying to help though.
Re: Multiple files with one ffmpeg command?
Didn't test it, but on Windows you should be able to do:
Code: Select all
for /l %x in (1, 1, 78) do ffmpeg -i a%x.mov -r 120 -vf "setpts=(1/5)*PTS" -an b%x.mov
Steam • GitHub • Stack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
-
- Posts: 33
- Joined: 03 Dec 2016, 16:03
- Location: Houston, TX
Re: Multiple files with one ffmpeg command?
I tried this and got the following error message:
At line:1 char:4
+ for /l %x in (1, 1, 78) do ffmpeg -i a%x.mov -r 120 -vf "setpts=(1/5) ...
+ ~
Missing opening '(' after keyword 'for'.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorID : MissingOpenParenthesisAfterKeyword
At line:1 char:4
+ for /l %x in (1, 1, 78) do ffmpeg -i a%x.mov -r 120 -vf "setpts=(1/5) ...
+ ~
Missing opening '(' after keyword 'for'.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorID : MissingOpenParenthesisAfterKeyword
Re: Multiple files with one ffmpeg command?
Well, I don't know what's wrong. I just tested on Windows 10 and it works fine.
Steam • GitHub • Stack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
- Chief Blur Buster
- Site Admin
- Posts: 11647
- Joined: 05 Dec 2013, 15:44
- Location: Toronto / Hamilton, Ontario, Canada
- Contact:
Re: Multiple files with one ffmpeg command?
What's your ffmpeg version?
Some older versions have missing options.
Also, sometimes batch files handles things differently from command lines (such as different parsing of % or paranthesis characters), you may wish to doublecheck. RealNC, are you pasting into a command line, or pasting into a batch file?
Some older versions have missing options.
Also, sometimes batch files handles things differently from command lines (such as different parsing of % or paranthesis characters), you may wish to doublecheck. RealNC, are you pasting into a command line, or pasting into a batch file?
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter
Forum Rules wrote: 1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
2. Please report rule violations If you see a post that violates forum rules, then report the post.
3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!
-
- Posts: 33
- Joined: 03 Dec 2016, 16:03
- Location: Houston, TX
Re: Multiple files with one ffmpeg command?
When typing:
ffmpeg -version
it says:
ffmpeg version N-82966-g6993bb4 Copyright (c) 2000-2016 the FFmpeg developers
ffmpeg -version
it says:
ffmpeg version N-82966-g6993bb4 Copyright (c) 2000-2016 the FFmpeg developers
Re: Multiple files with one ffmpeg command?
I just typed it in directly in the command line. No need to make batch files for one-off uses.
Steam • GitHub • Stack Overflow
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
The views and opinions expressed in my posts are my own and do not necessarily reflect the official policy or position of Blur Busters.
- Chief Blur Buster
- Site Admin
- Posts: 11647
- Joined: 05 Dec 2013, 15:44
- Location: Toronto / Hamilton, Ontario, Canada
- Contact:
Re: Multiple files with one ffmpeg command?
True. But what someone is doing with a command line, someone else might be pasting into a batch file unbeknownst to you..
Usually it works, but weird character parsing has caught that off guard sometimes...
Let's see what OP says.
Usually it works, but weird character parsing has caught that off guard sometimes...
Let's see what OP says.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter
Forum Rules wrote: 1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
2. Please report rule violations If you see a post that violates forum rules, then report the post.
3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!