
Recherche avancée
Autres articles (30)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (2871)
-
I made this code, but the sound is too loud, how can I reduce it ?
7 juillet 2021, par Luiz TorresI want to reduce the volume, but nothing I tried worked


async def play1(guild : discord.Guild, url):
 guild = client.get_guild(guild)
 FFMPEG_OPTIONS = {'before_options' : '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options' : '-vn'} #youtube_dl options
 YDL_OPTIONS = {'format': 'bestaudio/best', 'extractaudio': True, 'audioformat': 'mp3', 'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
 'restrictfilenames': True, 'noplaylist': True, 'nocheckcertificate': True, 'ignoreerrors': False, 'logtostderr': False, 'quiet': True,
 'no_warnings': True, 'default_search': 'auto', 'source_address': '0.0.0.0'}
 cn = guild.voice_client #guild
 with youtube_dl.YoutubeDL(YDL_OPTIONS) as ydl :
 info = ydl.extract_info(url, download = False)
 url2 = info['formats'][0]['url']
 source = discord.FFmpegOpusAudio(source=url2, executable="ffmpeg", **FFMPEG_OPTIONS)
 cn.play(source) #play in channel



-
ffmpeg timestamps on extracted frames wrong / extract frames a equal timestamps
21 juillet 2021, par SamI have a set of videos with different length, sizes, fps etc. and extract from each video exactly 60 frames as images, with timestamps put on each frame.


For this purpose I divide each videos length by 60 and use
fps=1/x
to extract the frames at even seconds from the video.

This works fine but the printed timestamps are slightly off.


This is the code I use (part of a bash script).


- 

- Compute intervals :




output_frame_count=60
video_duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -i file.mp4)
capture_distance=$(bc <<< "scale=0; ($video_duration / $output_frame_count)")



- 

- Then run ffmpeg with the arguments




ffmpeg -i file.mp4 -vf "fps=1/$capture_distance,scale=-1:$height,drawtext=fontfile=/usr/...: text='%{pts\:gmtime\:0\:%H\\\\\:%M\\\\\:%S}: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" frames%04d.png



I checked the images and all timestamps are wrong, compared to the original image from which they were extracted.


Does anyone has a more reliable way to extract exactly 60 frames from a video with correct timestamps printed on them ?


-
OpusError while using ffmpeg library in discord.py
18 avril 2021, par The Assignment NerdWhile playing a local file or youtube audio, I get
OpusError: invalid argument
error

The play command looks like :


# bot.py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from models import *
from discord.voice_client import VoiceClient
import logging
from config import *
import youtube_dl
from youtube_dl import YoutubeDL

@bot.command()
async def play(ctx):
 user=ctx.author
 voice_channel=user.voice.channel
 channel=None
 # only play music if user is in a voice channel
 if voice_channel:
 # grab user's voice channel
 channel=voice_channel.name
 await ctx.send('User is in channel: '+ channel)
 # create StreamPlayer
 vc = await voice_channel.connect()
 url="https://www.youtube.com/watch?v=AOeY-nDp7hI"
 YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist':'True'}
 FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 voice = discord.utils.get(bot.voice_clients, guild=ctx.guild)
 print(0)
 if not voice.is_playing():
 print("1")
 with YoutubeDL(YDL_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 print(2)
 URL = info['formats'][0]['url']
 print(3)
 voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
 print(4)
 voice.is_playing()
 print("Strated playing")
 else:
 await ctx.send("Already playing song")
 return
 else:
 await ctx.send('User is not in a channel.')



My error :


0
1
[youtube] AOeY-nDp7hI: Downloading webpage
[youtube] Downloading just video AOeY-nDp7hI because of --no-playlist
2
3
Ignoring exception in command play:
Traceback (most recent call last):
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "/Users/mohit/programming/discord/area-51-helper/main.py", line 115, in play
 voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
 File "/opt/homebrew/lib/python3.9/site-packages/discord/voice_client.py", line 564, in play
 self.encoder = opus.Encoder()
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 291, in __init__
 self.set_fec(True)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 326, in set_fec
 _lib.opus_encoder_ctl(self._state, CTL_SET_FEC, 1 if enabled else 0)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 92, in _err_lt
 raise OpusError(result)
discord.opus.OpusError: invalid argument

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
 raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusError: invalid argument



I'm using these version


discord.py==1.0.1
ffmpeg==4.3.2
youtube_dl==2021.4.17