How do I specify ffmpeg video directory?

I'm sure this is a very basic question so I apologise but I couldn't find it being asked on here before.

I've just downloaded and installed ffmpeg for Mac OSX and the main thing I want to use it for is converting files like AVIs or MP4s into MOVs or reducing the frame rate or resolution.

I have a video in a folder in my movies folder called test.mp4 but when I try to use ffmpeg to convert it by typing 'ffmpeg -i test.mp4 test.avi' it keeps telling me 'No such file or directory' it does the same thing when I try it with other videos. The videos are definitely there though.

So is there a specific folder I need to put the videos into, like an input directory or is there a way in the command line that I can specify the folder the video is in?

Thanks in advance!

2 Answers

You can tell ffmpeg where to look for files

If you are launching `ffmpeg from the terminal, you will need to either change directory to the location of the video you would like to work on, or specify the full path.

Getting the file location

I have a video in a folder in my movies folder called test.mp4 but when I try to use ffmpeg to convert it by typing 'ffmpeg -i test.mp4 test.avi' it keeps telling me 'No such file or directory' it does the same thing when I try it with other videos. The videos are definitely there though.

If Finder, you can hit Cmd+C on the directory you have your movies in, as if you were going to copy it. You can then hit Cmd+V in the terminal to paste that directory's path (where it is found on your Mac).

Then use the cd command to change to that directory:

cd /Users/Arron/Movies/

and redo your ffmpeg command:

ffmpeg -i test.mp4 test.avi

Alternatively, you could specify the full path to both the input and output files:

ffmpeg -i /Users/Arron/Movies/test.mp4 /Users/Arron/Movies/test.avi

It would be worth reading up on the ffmpeg documentation to learn about what the command you are doing does, as it may not be what you expect.

4

When you open a terminal and you're referring to a file name, the shell looks for the file relative to your working directory.

To see your working directory, enter:

pwd

To change to another working directory, enter cd. So if your file is in the folder ~/Downloads/videos, run:

cd ~/Downloads/videos/

You can also drag the file from your Finder to the terminal, that is, if you type:

ffmpeg -i __ ^---- your cursor is here

Then you can drag and drop the file to where your cursor is, and it will automatically add the full path to the file.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like