Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with ffmpeg location #59

Closed
davemaster opened this issue Sep 3, 2024 · 6 comments
Closed

Problems with ffmpeg location #59

davemaster opened this issue Sep 3, 2024 · 6 comments

Comments

@davemaster
Copy link

using your transcribe_youtube_videos, I have an error about ffmpeg location:

import yt_dlp

URLS = ['https://www.youtube.com/watch?v=wtolixa9XTg']

my_ffmpeg = "C:\\Program Files (x86)\\WinFF"

ydl_opts = {
    'format': 'm4a/bestaudio/best',  # The best audio version in m4a format
    'outtmpl': '%(id)s.%(ext)s',  # The output name should be the id followed by the extension
    'ffmpeg-location': my_ffmpeg,
    'postprocessors': [{  # Extract audio using ffmpeg
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'm4a',
        #'ffmpeg-location': my_ffmpeg,
    }]
}

the output:
[youtube] Extracting URL: https://www.youtube.com/watch?v=wtolixa9XTg
[youtube] wtolixa9XTg: Downloading webpage
[youtube] wtolixa9XTg: Downloading ios player API JSON
[youtube] wtolixa9XTg: Downloading web creator player API JSON
[youtube] wtolixa9XTg: Downloading m3u8 information
[info] wtolixa9XTg: Downloading 1 format(s): 140
[download] wtolixa9XTg.m4a has already been downloaded
[download] 100% of 7.14MiB
ERROR: Postprocessing: ffprobe and ffmpeg not found. Please install or provide the path using --ffmpeg-location

Error at the end:

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

@a-dinoto
Copy link
Contributor

@davemaster Hello! Thanks for reaching out. I find that using "ffmpeg-location" can cause issues and that it is better to download it with either Homebrew (for Mac) or Chocolatey (for Windows) as these both automatically add ffmpeg to PATH. If using Homebrew to install ffmpeg run the code brew install ffmpeg . If you are using Chocolatey to install ffmpeg then use the code choco install ffmpeg-full . Once ffmpeg is installed then your code should look like this when you run it:

import yt_dlp

URLS = ['https://www.youtube.com/watch?v=wtolixa9XTg']

ydl_opts = {
    'format': 'm4a/bestaudio/best',  # The best audio version in m4a format
    'outtmpl': '%(id)s.%(ext)s',  # The output name should be the id followed by the extension
    'postprocessors': [{  # Extract audio using ffmpeg
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'm4a',
    }]
}

with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    error_code = ydl.download(URLS)

Please let me know if that helps!

@davemaster
Copy link
Author

davemaster commented Sep 12, 2024 via email

@davemaster
Copy link
Author

davemaster commented Sep 12, 2024 via email

@davemaster
Copy link
Author

@davemaster Hello! Thanks for reaching out. I find that using "ffmpeg-location" can cause issues and that it is better to download it with either Homebrew (for Mac) or Chocolatey (for Windows) as these both automatically add ffmpeg to PATH. If using Homebrew to install ffmpeg run the code brew install ffmpeg . If you are using Chocolatey to install ffmpeg then use the code choco install ffmpeg-full . Once ffmpeg is installed then your code should look like this when you run it:

import yt_dlp

URLS = ['https://www.youtube.com/watch?v=wtolixa9XTg']

ydl_opts = {
    'format': 'm4a/bestaudio/best',  # The best audio version in m4a format
    'outtmpl': '%(id)s.%(ext)s',  # The output name should be the id followed by the extension
    'postprocessors': [{  # Extract audio using ffmpeg
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'm4a',
    }]
}

with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    error_code = ydl.download(URLS)

Please let me know if that helps!

Doesn't. Seems Youtube is serving audio separate from video

imagen

The file downloaded by script, has no audio

@dan-ince-aai
Copy link
Contributor

@davemaster Hello David!

Everything looks to be set up as intended, when running the script on my end it results in a successful m4a download. Could you double check by first deleting the current wtolixa9XTg.m4a file you have stored and re-running the script?

@davemaster
Copy link
Author

davemaster commented Sep 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants