File format
See original GitHub issueIm trying to download the audio as an mp3
, but I keep getting the error:
com.sapher.youtubedl.YoutubeDLException: ERROR: ffprobe or avprobe not found. Please install one.
at com.sapher.youtubedl.YoutubeDL.execute(YoutubeDL.java:90)
at TestingFunctions.main(TestingFunctions.java:37)
I do have ffmpeg installed, so I don’t know whats the issue
Heres what I have in terms of code:
File a = new File("a.mp3");
File b = new File("a.webm");
if (a.exists()) {
a.delete();
}
if (b.exists()) {
b.delete();
}
String videoUrl = "https://www.youtube.com/watch?v=BrCKvKXvN2c";
String directory = System.getProperty("user.dir");
try {
YoutubeDLRequest request = new YoutubeDLRequest(videoUrl, directory);
YoutubeDL.setExecutablePath("/usr/local/Cellar/youtube-dl/2017.09.15/bin/youtube-dl");
request.setOption("no-mark-watched");
request.setOption("no-playlist");
request.setOption("extract-audio");
request.setOption("audio-format mp3");
request.setOption("output a.%(ext)s");
System.out.println("Downloading...");
YoutubeDLResponse response = YoutubeDL.execute(request);
String stdOut = response.getOut();
System.out.println(stdOut);
} catch (Exception YoutubeDLException) {
YoutubeDLException.printStackTrace();
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
List of file formats - Wikipedia
List of file formats · HTML – Hypertext Markup Language · Avro – Data format appropriate for ingestion of record based attributes. ·...
Read more >What is a File Format? - Computer Hope
The file format is the structure of a file that tells a program how to display its contents. For example, a Microsoft Word...
Read more >What is file extension (file format) ? | Definition from TechTarget
In a computer, a file extension, also called a file format, is the layout of a file -- in terms of how the...
Read more >File Format Docs
A file format describes the structure of data in a file that applications follow to read or create such files. File types can...
Read more >21 Different Types of Files and How to Use Them | Indeed.com
5 types of document files · 1. Portable document format (PDF) · 2. Word document (DOC and DOCX) · 3. Hypertext markup language...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If ffmpeg is installed you should be able to invoke it through the terminal by doing
ffmpeg
like soYou can add
request.setOption("prefer-ffmpeg");
orrequest.setOption("prefer-avconv");
to force the use of one or another.Also you can use
request.setOption("ffmpeg-location /my_path/PATH");
to manually set the path of ffmpeg executable. I don’t think you have to do that. If you haveyoutube-dl
,ffmpeg
oravconv
in your PATH it should work with no issue.As this library seemed to be use by some people, I’m going to rethink the API.
Ok, that seemed to work. Thanks!