
Recherche avancée
Autres articles (53)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (7356)
-
Cannot seem to work with mp3 files in pydub
14 janvier 2023, par NegativePotatoI have been trying to open mp3 files on pydub, I have ffmpeg in path and whatnot, but I get errors whenever I attempt to use pydub with mp3 files. Wav files work fine of course.
This is my code for testing purposes (copied directly from online) :


from os import path
from pydub import AudioSegment

# files 
src = "Meet.mp3"
dst = "test.wav"

# convert wav to mp3 
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")



And this is my output for that code :


C:\Users\aiden\OneDrive\Desktop\VietnameseAudioConnector>py test.py
Traceback (most recent call last):
 File "C:\Users\aiden\OneDrive\Desktop\VietnameseAudioConnector\test.py", line 9, in <module>
 sound = AudioSegment.from_mp3(src)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\aiden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydub\audio_segment.py", line 796, in from_mp3
 return cls.from_file(file, 'mp3', parameters=parameters)
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "C:\Users\aiden\AppData\Local\Programs\Python\Python311\Lib\site-packages\pydub\audio_segment.py", line 773, in from_file
 raise CouldntDecodeError(
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1

Output from ffmpeg/avlib:

ffmpeg version 2023-01-12-git-fc263f073e-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12.2.0 (Rev7, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 57. 43.100 / 57. 43.100
 libavcodec 59. 56.100 / 59. 56.100
 libavformat 59. 35.100 / 59. 35.100
 libavdevice 59. 8.101 / 59. 8.101
 libavfilter 8. 53.100 / 8. 53.100
 libswscale 6. 8.112 / 6. 8.112
 libswresample 4. 9.100 / 4. 9.100
 libpostproc 56. 7.100 / 56. 7.100
[mp3 @ 000002d24d29e500] Failed to read frame size: Could not seek to 44209.
Meet.mp3: Invalid argument
</module>


Sorry if this ends up being obvious, I am new to using python. Thank you for the help !


-
ffmpeg with Quick Sync Video (qsv) gets stuck
28 avril 2023, par Juliano B. NequiritoI've compiled
ffmpeg
in an Arch Linux distribution with support to Intel Quick Sync Video. Butffmpeg
gets stuck when I try to run it :

$ ffmpeg -debug -hwaccel qsv -qsv_device /dev/dri/renderD128 -c:v h264_qsv -i test_video.mp4 -c:v hevc_qsv output.mp4

ffmpeg version N-109562-g0431f9805e Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 12.2.0 (GCC)
 configuration: --prefix=/usr --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64 --enable-lto --disable-rpath --enable-gpl --enable-version3 --enable-nonfree --enable-shared --disable-static --disable-stripping --enable-gray --enable-alsa --enable-avisynth --enable-bzlib --enable-chromaprint --enable-frei0r --enable-gcrypt --enable-gmp --enable-gnutls --enable-iconv --enable-ladspa --enable-lcms2 --enable-libaom --enable-libaribb24 --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcelt --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libdavs2 --enable-libdc1394 --enable-libfdk-aac --enable-libflite --enable-fontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libiec61883 --enable-libilbc --enable-libjack --enable-libjxl --enable-libklvanc --enable-libkvazaar --enable-liblensfun --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-libopencv --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --disable-libopenvino --enable-libopus --enable-libplacebo --enable-libpulse --enable-librabbitmq --enable-librav1e --enable-librist --enable-librsvg --enable-librubberband --enable-librtmp --enable-libshine --enable-libsmbclient --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libsvthevc --enable-libsvtvp9 --disable-libtensorflow --enable-libtesseract --enable-libtheora --disable-libtls --enable-libtwolame --enable-libuavs3d --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxavs2 --enable-libxcb --enable-libxcb-shm --enable-libxcb-xfixes --enable-libxcb-shape --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-lzma --enable-decklink --disable-mbedtls --enable-libmysofa --enable-openal --enable-opencl --enable-opengl --disable-openssl --enable-pocketsphinx --enable-sndio --enable-sdl2 --enable-vapoursynth --enable-vulkan --enable-xlib --enable-zlib --enable-amf --enable-cuda-nvcc --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-libdrm --enable-libvpl --enable-libnpp --enable-nvdec --enable-nvenc --enable-omx --enable-rkmpp --enable-v4l2-m2m --enable-vaapi --enable-vdpau
 libavutil 57. 43.100 / 57. 43.100
 libavcodec 59. 56.100 / 59. 56.100
 libavformat 59. 34.102 / 59. 34.102
 libavdevice 59. 8.101 / 59. 8.101
 libavfilter 8. 53.100 / 8. 53.100
 libswscale 6. 8.112 / 6. 8.112
 libswresample 4. 9.100 / 4. 9.100
 libpostproc 56. 7.100 / 56. 7.100
 matched as AVOption 'debug' with argument '-hwaccel'.
Reading option 'qsv' ... matched as output url.
Reading option '-qsv_device' ... matched as option 'qsv_device' (set QSV hardware device (DirectX adapter index, DRM path or X11 display name)) with argument '/dev/dri/renderD128'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'h264_qsv'.
Reading option '-i' ... matched as input url with argument 'test_video.mp4'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'hevc_qsv'.
Reading option 'output.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option qsv_device (set QSV hardware device (DirectX adapter index, DRM path or X11 display name)) with argument /dev/dri/renderD128.
[AVHWDeviceContext @ 0x5590d517ee40] libva: VA-API version 1.17.0
[AVHWDeviceContext @ 0x5590d517ee40] libva: User requested driver 'iHD'
[AVHWDeviceContext @ 0x5590d517ee40] libva: Trying to open /usr/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x5590d517ee40] libva: Found init function __vaDriverInit_1_16
[AVHWDeviceContext @ 0x5590d517ee40] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5590d517ee40] Initialised VAAPI connection: version 1.17
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x41524742 -> bgra.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x42475241 -> argb.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x41424752 -> rgba.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x52474241 -> abgr.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x58524742 -> bgr0.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x42475258 -> 0rgb.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x58424752 -> rgb0.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x52474258 -> 0bgr.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30335241 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30334241 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30335258 -> x2rgb10le.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30334258 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x36314752 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x50424752 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x50524742 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x56555941 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30303859 -> gray.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x3231564e -> nv12.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x3132564e -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x32595559 -> yuyv422.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x59565955 -> uyvy422.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x32315659 -> yuv420p.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30323449 -> yuv420p.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x50313134 -> yuv411p.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x48323234 -> yuv422p.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x56323234 -> yuv440p.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x50343434 -> yuv444p.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x33434d49 -> unknown.
[AVHWDeviceContext @ 0x5590d517ee40] Format 0x30313050 -> p010le.
[AVHWDeviceContext @ 0x5590d517ee40] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 22.6.4 ().
[AVHWDeviceContext @ 0x5590d517ee40] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x5590d517e940] Use Intel(R) oneVPL to create MFX session, API version is 2.6, the required implementation version is 1.3



CPU starts being used intensively and then nothing happens.
Does anybody have any clue on it ?


I have an Intel i7-8550U (8th gen Kaby Lake) processor with 4 cores (8 threads).


I have also used these options to
ffmpeg
, getting the same results :

ffmpeg -loglevel debug -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -hwaccel_output_format qsv -i test_video.mp4 -vf 'format=qsv,hwupload=extra_hw_frames=64' -c:v hevc_qsv -f mp4 output.mp4



With VAAPI, transcoding runs flowlessly :


ffmpeg -init_hw_device vaapi=intel:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device intel -filter_hw_device intel -i test_video.mp4 -c:v hevc_vaapi -f mp4 output.mp4



-
Why is the ffmpeg process in discordpy terminating without playing anything ?
18 janvier 2024, par Bummbumm6I'm making a discord bot for playing music (ik very unoriginal) and everytime I try to play music, it gives this error :


2023-02-18 12:31:54 INFO discord.player ffmpeg process 4024 has not terminated. Waiting to terminate...
2023-02-18 12:31:54 INFO discord.player ffmpeg process 4024 should have terminated with a return code of -9.



It is in the voice chat and didn't play anything. Here's my code if you need it :


print("defining functions")
import discord, pytube, os, threading
from moviepy import editor
from discord.ext.commands import Bot
intents=discord.Intents.default()
intents.message_content = True
intents.voice_states = True
bot = Bot("b!",intents=intents)
check = False
token = "redacted"
@bot.command()
async def play(ctx, arg):
 await ctx.send("Downloading...")
 try:
 yt = pytube.YouTube(arg)
 print("STREAM: "+str(yt.streams.filter(only_audio=True,mime_type="audio/webm",type="audio",abr="160kbps")))
 def download(yt):
 print("DOWNLOADING STREAM TO AUDIO.WEBM")
 yt.streams.filter(only_audio=True,mime_type="audio/webm",type="audio",abr="160kbps").order_by("abr").first().download(filename="audio.webm")
 print("EXPORTING TO MP3")
 editor.AudioFileClip("audio.webm").write_audiofile("audio.webm"[:-5] + ".mp3")
 os.remove("audio.webm")
 print("DONE")
 thread = threading.Thread(target=download, args=(yt,))
 thread.start()
 thread.join()
 try:
 channel = ctx.author.voice.channel
 try:
 vc = await channel.connect()
 except Exception:
 ctx.send("already in vc, one sec")
 except Exception:
 pass
 vc.play(discord.FFmpegPCMAudio(source="audio.mp3", executable="./ffmpeg"))
 except Exception:
 pass
bot.run(token)




It worked on my computer in VS Code, but I wanted to test it on Replit and only there I got the error. I tried :


- 

- Reinstalling discord, pynacl, even pytube and moviepy.
- Using a local copy of ffmpeg on replit, see line 36.
- Adding the intents that were described in a different thread.








One thing that always happens is the exit code being -9 but the process number changing (ofc). I saw a GitHub Issue about this too which is not showing a fix so how do I fix that ?