
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (79)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)
Sur d’autres sites (12316)
-
Seeking with ffmpeg options fails or causes delayed playback in Discord bot
29 août 2022, par J PetersenMy Discord bot allows users to play a song starting from a timestamp.


The problem is that playback is delayed and audio plays faster and is jumbled if start times >= 30s are set.


Results from testing different start times. Same URL, 30 second duration :







 Entered Start Time (s) 

Playback Delay (s) 

Song Playback Time (s) 







 0 

3 

30 




 30 

10 

22 




 60 

17 

17 




 120 

31 

2 




 150 

120 

<1 









I am setting the start time using ffmpeg_options as suggested in this question.


Does anyone understand why the audio playback is being delayed/jumbled ? How can I improve playback delay and allow users to start in the middle of a multi-chapter YouTube video ?


Code :


import discord
import youtube_dl
import asyncio


# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ""


ytdl_format_options = {
 "format": "bestaudio/best",
 "outtmpl": "%(extractor)s-%(id)s-%(title)s.%(ext)s",
 "restrictfilenames": True,
 "noplaylist": False,
 "yesplaylist": True,
 "nocheckcertificate": True,
 "ignoreerrors": False,
 "logtostderr": False,
 "quiet": True,
 "no_warnings": True,
 "default_search": "auto",
 "source_address": "0.0.0.0", # Bind to ipv4 since ipv6 addresses cause issues at certain times
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


class YTDLSource(discord.PCMVolumeTransformer):
 def __init__(self, source: discord.AudioSource, *, data: dict, volume: float = 0.5):
 super().__init__(source, volume)

 self.data = data

 self.title = data.get("title")
 self.url = data.get("url")

 @classmethod
 async def from_url(cls, url, *, loop=None, stream=False, timestamp = 0):
 ffmpeg_options = {
 "options": f"-vn -ss {timestamp}"}

 loop = loop or asyncio.get_event_loop()

 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
 if "entries" in data:
 # Takes the first item from a playlist
 data = data["entries"][0]

 filename = data["url"] if stream else ytdl.prepare_filename(data)
 return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)


intents = discord.Intents.default()

bot = discord.Bot(intents=intents)

@bot.slash_command()
async def play(ctx, audio: discord.Option(), seconds: discord.Option(), timestamp: discord.Option()):
 channel = ctx.author.voice.channel
 voice = await channel.connect()
 player = await YTDLSource.from_url(audio, loop=bot.loop, stream=True, timestamp=int(timestamp))
 voice.play(player)
 await asyncio.sleep(int(seconds))
 await voice.disconnect()

token = token value
bot.run(token)



-
How to see default NVENC hevc options in ffmpeg
18 mars 2023, par Ivan GorinI am trying to use the hevc_nvenc encoder in ffmpeg to reencode an old video I have. Obviously software encoding using libx265 would be better, but I want to make in fast. I am trying to optimize for video quality, so I am using these options :


-profile:v main -b_ref_mode 0 -preset p7 -tune hq -rc vbr



b_ref_mode 0
since my gpu doesn't support bframe reference mode.

This gives results with average bitrate of around 2M, so I am guessing that is the default bitrate setting for nvenc. Increasing
-b:v
increases average bitrate, but around 6.5M it stops. Even using-b:v 50M
gives the same video bitrate. I have also tried setting-cq 1
to force the best quality possible, but that actually decreases bitrate to around 4.5M. The only way I found to get the desired bitrate is using-cq 1
and-maxrate
set to a big value. This removes the restriction, and actually the-b:v
option is no longer needed, it seems like it doesn't have any effect at all.

All of this behaviour seems very strange to me, with some hidden default values for bitrate and maxrate, so the question is where can I see these values ? I tried using ffmpeg with
-loglevel debug
but didn't see these values getting passed, and the documentation I found says maxrate default in ffmpeg is 0 (what does this mean ?).

-
Sending Blobs from a Chrome Extension to a Node.js Process without WebSockets [closed]
29 octobre 2023, par Matrix 404Question :
I have a Puppeteer script that runs a Chrome extension, which opens a webpage. The extension records that tab and sends the recorded blobs to the main Node.js process using WebSockets. The main process then streams these blobs to an RTMP server.


I'm looking for an alternative method to send blobs to the main process without using WebSockets. Additionally, I want to know if it's possible to stream these blobs directly from the browser using FFmpeg wasm.


Details :


- 

-
My current setup : Puppeteer script -> Chrome extension (recording) -> WebSockets -> Node.js process -> RTMP server.


-
I'm exploring options to eliminate the use of WebSockets while maintaining the ability to send recorded blobs from the Chrome extension to the Node.js process efficiently.


-
Is it possible to use FFmpeg wasm to stream blobs directly from the browser to an RTMP server ? If so, how can this be achieved ?










Additional Information :


- 

- The technology stack I'm using includes Puppeteer, Chrome extension, Node.js, and FFmpeg.
- Any code snippets, examples, or recommended libraries are greatly appreciated.






Constraints :


- 

- Compatibility with modern browsers and reasonable performance are essential.
- Ideally, the solution should work in a headless Chrome instance.






Thank you for your assistance in finding an efficient solution to this problem !


- 

- The technology stack I'm using includes Puppeteer, Chrome extension, Node.js, and FFmpeg.
- Any code snippets, examples, or recommended libraries are greatly appreciated.






-