
Recherche avancée
Autres articles (75)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (15293)
-
Creating a continuous stream for RTMP in Node.js
9 mars 2023, par hankthetank27I'm working on an app that downloads audio from youtube that will be streamed sequentially, similar to radio broadcast. I'm having trouble getting the individual tracks to stream continuously. My idea was to write the tracks sequentially into a readable stream that then is read by FFMPEG. Here is the code I'm having trouble with...


import ytdl from "ytdl-core";
import ffmpeg from 'fluent-ffmpeg';
import { Readable } from "node:stream"

export async function startAudioStream(): Promise<void>{

 const mainStream = await createStreamedQueue()

 ffmpeg(mainStream)
 .inputOptions([
 '-re'
 ])
 .outputOption([
 // '-c:v libx264',
 // '-preset veryfast',
 // '-tune zerolatency',
 '-c:a aac',
 '-ar 44100',
 ])
 .save('rtmp://localhost/live/main.flv');
};

async function createStreamedQueue(): Promise<readable>{

 function createStream(): Readable{
 const stream = new Readable({
 read(){},
 highWaterMark: 1024 * 512,
 });
 stream._destroy = () => { stream.destroyed = true };
 return stream;
 }

 const mainStream = createStream();

 const ref1 = 'https://youtu.be/lLCEUpIg8rE'
 const ref2 = 'https://youtu.be/bRdyzdXJ0KA';

 function queueSong(src: string, stream: Readable): Promise<void>{
 return new Promise<void>((resolve, reject) => {
 ytdl(src, {
 filter: 'audioonly',
 quality: 'highestaudio'
 })
 .on('data', (data) => {
 stream.push(data);
 })
 .on('end', () => {
 resolve();
 })
 .on('error', (err) => {
 console.error('Error downloading file from YouTube.', err);
 reject(err);
 })
 })
 }
 
 await queueSong(ref1, mainStream);
 // console.log('after firsrt: ', mainStream)
 await queueSong(ref2, mainStream);
 // console.log('after second: ', mainStream)
 return mainStream;
};
</void></void></readable></void>


To start,
startAudioStream
is called to initiate a readable stream of audio to an RTMP server via FFMPEG. That is working fine. The part I'm having trouble with is "queuing" the tracks into the stream that's being fed into FFMPEG. Right now, I have a "main" stream that each songs data is being pushed into, as you can see inqueueSong
. At the end of ytdl stream, the promise is resolved, allowing for the next song to be queued and its data to be pushed intomainStream
. The issue that I'm experiencing is that the audio fromref1
is only every played.

I can see in the logs that
mainStream
does grow in length after each call toqueueSong
, but still will only stream the audio from the first track. My initial thought was that there is a terminating character at the of the last data chunk thats being written to the steam for each song ? But maybe im getting screwed up on how streams work...

-
FFMPEG : merging multiple audio (MP3) and single image convert them into a video [on hold]
9 décembre 2013, par user3027136I'm tired of searching for this problem. I have found 2 solutions here, but both work only partially.
What I want to do is to convert all the MP3 inside a folder (if possible subfolders, too) to avi or anything else accepted by Youtube. I have created 2 .bat that should do this (according to the other threads here). They don't, one of them creates the avi without the image (black) and the other seems to capture the screen.
Here they are.
If you know about ffmpeg please point me to the right direction. Thank you.This one uses mp3info.exe - to be honest I have no idea what mp3info does, I just guess it finds the lenght of the song to be mathed later with the length of the video.
@echo off
for %%a in (*.mp3) do (
for /f "delims=" %%b in ('mp3info.exe -p %%S "%%a"') do (
ffmpeg -i "%%a" -loop 1 -r 1 -i "cover.jpg" -acodec copy "%%~na.mp4" -t %%b
)
)This seems more simple, runs faster but captures the screenshot and ignores the cover.jpg file.
@echo off
for %%A IN (*.mp3) DO ffmpeg -i "%%A" -i "cover.jpg" "%%A.mpg"
donemp2info.exe, cover.jpeg and the .bat scripts are in the same folder with the .mp3 files.
-
Batch extract first 10 seconds of multiple mp3 files using ffmpeg
26 décembre 2018, par MaudeI have a folder filled with songs. I would like to make ONE mp3 file containing a mashup of 10 seconds of each song.
I have found that FFMPEG is an easy software to do so.
I found how to cut a single file :
ffmpeg -ss 0 -t 10 -i file.mp3 file.wav
And how to write a loop for multiple steps :
for i in *.mp3; do ...
But I am not sure how to mix the two into only 1 file. If it’s not possible, I guess I can also make a separate 10 sec file for each and then regroup.