Je reçois cette erreur lorsque vous exécutez le script comme indiqué
test.py p>
C:\Python\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning) C:\Python\lib\site-packages\pydub\utils.py:198: RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning) Traceback (most recent call last): File "C:/Users/karti/Documents/Python Programs/ChatApplication/deezer.py", line 13, in <module> wav_audio = AudioSegment.from_file("Broken Summer.m4a", format="m4a") File "C:\Python\lib\site-packages\pydub\audio_segment.py", line 685, in from_file info = mediainfo_json(orig_file, read_ahead_limit=read_ahead_limit) File "C:\Python\lib\site-packages\pydub\utils.py", line 274, in mediainfo_json res = Popen(command, stdin=stdin_parameter, stdout=PIPE, stderr=PIPE) File "C:\Python\lib\subprocess.py", line 854, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Python\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] The system cannot find the file specified
3 Réponses :
PIP Installez FFMPEG avant l'opération.
pip install ffmpeg-python
J'ai ajouté la solution
Même après avoir ajouté la dépendance de FFMPEG, le fichier ne sera probablement pas lu. En raison du fait que pydub ne lit pas les fichiers .m4a. principalement parce que 'FFMPEG' ne prend pas en charge ce type de fichiers via la bibliothèque "LibaV". P>
J'ai aussi des problèmes avec cela. P>
J'ai ajouté la solution parfaite
J'ai eu la solution. Si vous avez installé FFMPEG ou FFMPEG-PYTHON. Désinstallez-le. Comme cela ne fonctionnera pas Exécutez cette commande
import subprocess CurrentFileName = 'TEST.m4a' FinalFileName = 'TEST.mp3' try: subprocess.call(['ffmpeg', '-i', f'{CurrentFileName}', f'{FinalFileName}']) except Exception as e: print(e) print('Error While Converting Audio') ch = input('Press Enter to Close')
Avez-vous également essayé avec le chemin complet comme c: \ users \ \ \ \ \ \ cassé été.m4a b>?
Voir la deuxième ligne de la traçabilité, vous devez installer l'un des fichiers binaires donnés.