ffmpeg-cli-wrapper icon indicating copy to clipboard operation
ffmpeg-cli-wrapper copied to clipboard

How to set or get ffmpeg path ?

Open mohamedmorsi95 opened this issue 7 years ago • 1 comments
trafficstars

Actually I don't know the structure of this project I only want to convert songs to mp3 and reduce the bitrate.

When I used this lib I just set

FFmpeg ffmpeg = new FFmpeg(); FFprobe ffprobe = new FFprobe();

To set the default path which I don't know how to get or what is it ,I got error nullpointerException on

FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);

Which I think that mean I have a error with initializing ffmpeg and ffprobe

So how to set or get the ffmpeg and ffprobe paths?

mohamedmorsi95 avatar Jul 28 '18 18:07 mohamedmorsi95

For an OS independent version:

RunProcessFunction func = new RunProcessFunction();
func.setWorkingDirectory("/path/to/working/dir");
FFmpeg ffmpeg = new FFmpeg("/path/to/ffmpeg", func);

[from random example 5]

Or, if you have the path to the executable set in the Path environment variable "FFMPEG", you can get by with the empty constructor call.

You can also specify absolute paths directly in constructor, but that's OS dependent.

Omar-Riaz avatar Aug 05 '18 02:08 Omar-Riaz