[Solved] How can ffmpeg extract frames to a target dir (%T)?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
sorcar
Member
Member
Posts: 100
Joined: 2005-04-12, 17:45 UTC
Location: U.S.

[Solved] How can ffmpeg extract frames to a target dir (%T)?

Post by *sorcar »

Is there a way put the target directory variable (%T) in the button bar "Start Path"? Putting a directory path in the "start path" seems to be the only way to get FFmpeg to send its output to a specific directory.
Last edited by sorcar on 2015-08-09, 15:59 UTC, edited 3 times in total.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

What exactly are you trying to do with ffmpeg?

This works fine for example:
Command:

Code: Select all

%comspec% /k c:\Tools\ffmpeg.exe
Parameters:

Code: Select all

-i "%P%O.%E" "%T%O.avi"
sorcar
Member
Member
Posts: 100
Joined: 2005-04-12, 17:45 UTC
Location: U.S.

Post by *sorcar »

What exactly are you trying to do with ffmpeg?
I am trying to extract JPEG frames from an .avi file. I am using,
Command:

Code: Select all

%comspec% /k c:\Tools\ffmpeg.exe -vf fps=1/60 -qscale:v 2 image_%04d.jpg
Parameters:

Code: Select all

-i "%P%N"
The frames get extracted in the same directory as the input file (ie, at %P). But if I add a fixed path in "Start path:" (such as c:\test\frames\), the frames are extracted there. "Start Path:" does not seem to take %T, and I haven't found a way to extract to the target pane.
sorcar
Member
Member
Posts: 100
Joined: 2005-04-12, 17:45 UTC
Location: U.S.

Post by *sorcar »

Got a way out! The desired effect can be had with:
Command:

Code: Select all

%comspec% /k c:\Tools\ffmpeg.exe -vf fps=1/60 -qscale:v 2
Parameter:

Code: Select all

"%T\image_%%04d.jpg" -i "%P%O.%E"
The problem was because of ffmpeg having no switch for output folder.

Thanks, ZoSTeR, for your useful suggestion which gave me the idea.
Last edited by sorcar on 2015-08-09, 15:54 UTC, edited 2 times in total.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1052
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

Glad it worked. You can put everthing in the parameter:

Code: Select all

-i "%P%O.%E" -vf fps=1/60 -qscale:v 2 "%Timage_%%04d.jpg"
sorcar
Member
Member
Posts: 100
Joined: 2005-04-12, 17:45 UTC
Location: U.S.

Post by *sorcar »

Works like a charm. Thanks a lot, ZoSTer. It further simplifies the matter.
Post Reply