kewlbear / YoutubeDL

An iOS app using youtube-dl Python module with PythonKit Swift package
MIT License
210 stars 36 forks source link

ERROR: Postprocessing: ffprobe and ffmpeg not found. Please install or provide the path using --ffmpeg-location #12

Closed litt1e-p closed 1 year ago

litt1e-p commented 1 year ago

I want to use it to extract mp3 only like below code:

let argv = ["-x", "--audio-format", "mp3", "--embed-thumbnail", "--add-metadata"]
try await yt_dlp(argv: argv)

but an error occured: ERROR: Postprocessing: ffprobe and ffmpeg not found. Please install or provide the path using --ffmpeg-location. I don't know the right way using FFmpeg-iOS and make it works. thanks for some help.

kewlbear commented 1 year ago

ffmpeg is embedded into you app but ffprobe is not. Currently ffprobe is not built with FFmpeg-iOS package. You can try building ffprobe yourself, or wait for me or anyone else to build it if ever.

2023년 3월 30일 (목) 오전 12:06, litt1e-p @.***>님이 작성:

I want to use it to extract mp3 only like below code:

let argv = ["-x", "--audio-format", "mp3", "--embed-thumbnail", "--add-metadata"]try await yt_dlp(argv: argv)

but an error occured: ERROR: Postprocessing: ffprobe and ffmpeg not found. Please install or provide the path using --ffmpeg-location. I don't know the right way using FFmpeg-iOS and make it works.

— Reply to this email directly, view it on GitHub https://github.com/kewlbear/YoutubeDL/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI5LYRQRYZ2QV5PVJZ5UF3W6RFWXANCNFSM6AAAAAAWMB325I . You are receiving this because you are subscribed to this thread.Message ID: @.***>

litt1e-p commented 1 year ago

but how can ffmpeg/ffprobe location path pass to python lib function after them embeded?

kewlbear commented 1 year ago

Oh, I see. I've implemented intercepting Popen method calls and calling embedded ffmpeg. But I forgot to push it to GitHub. Will push it soon.

litt1e-p commented 1 year ago

that's great! thanks.

kewlbear commented 1 year ago

Pushed it! Here I call ffmpeg embedded as a function:

https://github.com/kewlbear/YoutubeDL-iOS/blob/c9f755e5a164f1c33b8b2573b789fdb070ec5b3d/Sources/YoutubeDL/YoutubeDL.swift#L433

litt1e-p commented 1 year ago

great, but how to use it, may i ask for an example code?

kewlbear commented 1 year ago

Your original code should work. But as I said ffprobe is not there. So if the operation requires ffprobe it will probably fail.

litt1e-p commented 1 year ago

you're right, it does show ffprobe error only now:

yt_dlp.utils.PostProcessingError: WARNING: unable to obtain file audio codec with ffprobe
startDownload(url:) Error Domain=App Code=1 "ERROR: Postprocessing: WARNING: unable to obtain file audio codec with ffprobe" UserInfo={NSLocalizedDescription=ERROR: Postprocessing: WARNING: unable to obtain file audio codec with ffprobe}
kewlbear commented 1 year ago

I've added support for ffprobe and mp3lame. You should be able to do it by upgrading YoutubeDL-iOS package dependency.

litt1e-p commented 1 year ago

that is great!I will try it later. Thanks again!

litt1e-p commented 1 year ago

@kewlbear it works ! thanks a lot, you are the best