[Python] convert YT video to audio file - "ERROR: Postprocessing: audio conversion failed:...

Discussão em 'Python' iniciado por Stack, Fevereiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am using yt_dlp with Python to load a video from Youtube as an audio-only mp3 file. Until recently this worked fine, but now I get the following error message:

    ERROR: Postprocessing: audio conversion failed: Error opening output files: Encoder not found


    Both yt_dlp (Version 2025.02.19) and ffmpeg (Version 7.1) are up to date. I am working on a Windows 11 system with Python 3.12.

    This is the function I have written and until recently the result was an mp3 file in the output folder.

    def ydl_download_video(entry, out_path= "O:\\MP3\\00 CHARTS\\NEU\\"):
    url = entry.get('ylink').strip('\n')
    artist = entry.get('artist')
    title = entry.get('title')

    ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
    'key': 'FFmpegExtractAudio',
    'preferredcodec': 'mp3',
    'preferredquality': '192',
    }],
    'cookiefile': 'all_cookies.txt',
    'outtmpl': f'{out_path}{artist} - {title}.%(ext)s'
    }
    with yt_dlp.YoutubeDL(ydl_opts) as ydl:
    ydl.download() This is the output on the scree...-audio-conversion-failed"]Continue reading...

Compartilhe esta Página