
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (96)
-
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 (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...) -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (8046)
-
A Soundboard for Discord with Discord.py with already downloaded .mp3 files
8 août 2019, par Kerberos KevI’m setting up a discord bot with discord.py, and want to implement an soundboard.The soundboard should take already downloaded .mp3 files and play them in the discord. The bot already automatically joins and disconnects from a voice channel but does not play any of my sound files.
I tried converting the mp3 file into an opus one and just play it without ffmpeg but this didn’t work either.
import discord
from discord.ext import commands
from discord.utils import get
from mutagen.mp3 import MP3
import time
import os
client = commands.Bot(command_prefix='<')
a = './'+'kurz-kacken.mp3'
class Soundboard(commands.Cog):
def __init__(self, client):
self.client = self
@commands.command(pass_context=True)
async def soundboard(self, ctx, songname: str):
channel = ctx.message.author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice = await channel.connect()
print(f"The bot has connected to {channel}\n")
# audio = MP3('./'+'kurz-kacken.mp3')
# a = audio.info.length
voice.play(discord.FFmpegPCMAudio('./'+'kurz-kacken.mp3'),
after=lambda e: print("Song done!"))
voice.source = discord.PCMVolumeTransformer(voice.source)
voice.source.volume = 0.07
# time.sleep(a)
await ctx.send(f'ended')
if voice and voice.is_connected():
await voice.disconnect()
def setup(client):
client.add_cog(Soundboard(client)) -
ffmpeg itsoffset doesnt apply offset to mp4
26 juillet 2019, par bruxThe following command mixes an mp4 and an mp3 together, keeping the audio from the mp4.
ffmpeg -i video.mp4 -i audio.mp3 -map 0:v -c:v copy -filter_complex '[0:a][1:a]amix[aout]' -map '[aout]' -shortest out.mp4
The command works as expected.
Now I want to offset the mp4 file (both the audio and video stream of the mp4) so that there is a delay of 500ms at the start of the mp4, here is my command :
ffmpeg -itsoffset 00:00:00.500 -i video.mp4 -i audio.mp3 -map 0:v -c:v copy -filter_complex '[0:a][1:a]amix[aout]' -map '[aout]' -shortest out.mp4
This doesnt work as expected, the output doesnt have the expected delay of 500ms at the start of the mp4 streams. It appears the output is just the same as the first command I ran.
The version of ffmpeg I am using is :
ffmpeg version n4.0-39-gda39990
Here are the files I’m using :
video.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2019-07-26T03:28:49.000000Z
com.android.version: 8.0.0
Duration: 00:00:07.64, start: 0.000000, bitrate: 20534 kb/s
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 20966 kb/s, SAR 1:1 DAR 16:9, 29.70 fps, 29.75 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 270
creation_time : 2019-07-26T03:28:49.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of 90.00 degrees
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2019-07-26T03:28:49.000000Z
handler_name : SoundHandleaudio.mp3
Input #0, mp3, from '/storage/emulated/0/audio.mp3':
Metadata:
album : Sunflower (Spider-Man: Into the Spider-Verse) - Single
composer : Louis Bell, Carter Lang, Austin Richard Post, Billy Walsh & Khalif Malik Ibin Shaman Brown
genre : Hip-Hop/Rap
copyright : This Compilation ℗ 2018 Republic Records, a division of UMG Recordings, Inc.
title : Sunflower (Spider-Man: Into the Spider-Verse)
artist : Post Malone & Swae Lee
album_artist : Post Malone & Swae Lee
track : 01/01
TYER : 2018-10-18T07:00:00Z
Duration: 00:02:38.07, start: 0.000000, bitrate: 325 kb/s
Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 320 kb/s
Stream #0:1: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1400x1400 [SAR 300:300 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
Metadata:
comment : Cover (front) -
Streaming audio over websockets and process it with ffmpeg, Invalid frame size error
12 avril 2024, par Nimrod SadehI am building an application in Python that processes audio data on a streaming connection with WebSockets. To work with it, I need to process it with ffmpeg on the server before passing it to some ML algorithms.


I have the following ffmpeg code setup to process each byte sequence that comes over WebSockets :


async def ffmpeg_read(bpayload: bytes, sampling_rate: int = 16000) -> np.array:
 ar = f"{sampling_rate}"
 ac = "1"
 format_for_conversion = "f32le"
 ffmpeg_command = [
 "ffmpeg",
 "-i", "pipe:0",
 "-ac", ac,
 "-acodec", f"pcm_{format_for_conversion}",
 "-ar", ar,
 "-f", format_for_conversion,
 "pipe:1"]
 try:
 process = await asyncio.create_subprocess_exec(
 *ffmpeg_command,
 stdin=asyncio.subprocess.PIPE,
 stdout=asyncio.subprocess.PIPE)

 process.stdin.write(bpayload)
 await process.stdin.drain() 
 process.stdin.close()

 out_bytes = await process.stdout.read(8000) # Read asynchronously
 audio = np.frombuffer(out_bytes, np.float32)

 if audio.shape[0] == 0:
 raise ValueError("Malformed soundfile")
 return audio

 except FileNotFoundError:
 raise ValueError(
 "ffmpeg was not found but is required to load audio files from filename")



In every test, this works for exactly one message and prints the desired output to the screen, but the second one gets the following :


[mp3 @ 0x1208051e0] Invalid frame size (352): Could not seek to 363.
[in#0 @ 0x600002214200] Error opening input: Invalid argument
Error opening input file pipe:0.



How do I fix this ?