
Recherche avancée
Autres articles (82)
-
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 (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (8667)
-
Ffmpeg output stream closed
29 novembre 2023, par excaliburThere is one problem in my code that uses ffmpeg to convert webm videos to mp4 and set duration to 10 seconds, it works well but, sometimes returns "output Stream closed" error. What can be a reason of this problem, and how can i solve it ?


My code :


async convertWebmVideoToMp4(buffer: any) {
 try {
 return new Promise((resolve, reject) => {
 const videoMp4Buffer = Buffer.from(buffer);

 const readable = Readable.from(videoMp4Buffer);

 const outputBuffer = [];

 const outputStream = new Writable({
 write(chunk, encoding, callback) {
 outputBuffer.push(chunk);
 callback();
 },
 });

 const ffmpegProcess = ffmpeg()
 .input(readable)
 .outputFormat('mp4')
 .videoCodec('libx264')
 .audioCodec('aac')
 .duration(10)
 .outputOptions([
 '-movflags frag_keyframe+empty_moov',
 '-preset ultrafast',
 '-c:a aac',
 '-r 30',
 '-tune fastdecode',
 ])
 .on('end', () => {
 outputStream.end();
 const finalOutputBuffer = Buffer.concat(outputBuffer);
 resolve(finalOutputBuffer);
 })
 .on('error', (err, stdout, stderr) => {
 console.error(err);
 reject(err);
 });

 outputStream.on('error', err => {
 this.logger.error(err);
 });

 ffmpegProcess.pipe(outputStream, { end: true });
 });
 } catch (error) {
 throw error;
 }
}



My code should return the buffer of video that type is mp4 and length is 10 seconds, but it returns "output stream closed" error.


-
How to stop perl buffering ffmpeg output
4 février 2017, par Sebastian KingI am trying to have a Perl program process the output of an ffmpeg encode, however my test program only seems to receive the output of ffmpeg in periodic chunks, thus I am assuming there is some sort of buffering going on. How can I make it process it in real-time ?
My test program (the
tr
command is there because I thought maybe ffmpeg’s carriage returns were causing perl to see one big long line or something) :#!/usr/bin/perl
$i = "test.mkv"; # big file, long encode time
$o = "test.mp4";
open(F, "-|", "ffmpeg -y -i '$i' '$o' 2>&1 | tr '\r' '\n'")
or die "oh no";
while(<f>) {
print "A12345: $_"; # some random text so i know the output was processed in perl
}
</f>Everything works fine when I replace the
ffmpeg
command with this script :#!/bin/bash
echo "hello";
for i in `seq 1 10`; do
sleep 1;
echo "hello $i";
done
echo "bye";When using the above script I see the output each second as it happens. With
ffmpeg
it is some 5-10 seconds or so until it outputs and will output sometimes 100 lines each output.I have tried using the program
unbuffer
ahead offfmpeg
in the command call but it seems to have no effect. Is it perhaps the2>&1
that might be buffering ?
Any help is much appreciated.If you are unfamiliar with ffmpeg’s output, it outputs a bunch of file information and stuff to
STDOUT
and then during encoding it outputs lines likeframe= 332 fps= 93 q=28.0 size= 528kB time=00:00:13.33 bitrate= 324.2kbits/s speed=3.75x
which begin with carriage returns instead of new lines (hence
tr
) onSTDERR
(hence2>&1
). -
ffmpeg x11grab moov atom not found
30 mars 2021, par Jintor2 FFMPEG process


(1) generating a ffmpeg x11grab to a .mp4
(2) take the .mp4 and restream it simultaneously to multiple rtmp endpoints


ISSUE the generated file in (1) have this error "moov atom not found"


This is the command that generate (1) :


ffmpeg -re -y -f x11grab -draw_mouse 0 -framerate 30 
-video_size $RESOLUTION -i :$DISPLAY_NUM -c:a aac -c:v libx264 
-movflags +faststart -preset ultrafast -crf 28 -refs 4 -qmin 4 
-pix_fmt yuv420p -filter:v fps=30 file.mp4



in the (2) => when I try to ffmpeg -i file.mp4 output somewhere : I get "moov atom not found" so the (2) can't read or open (1).


What I'm I missing


in (1)
-movflags +faststart
doesn't seem to fix the issue

••••••• EDIT : more details on the context ••••••


I'm using openvidu : webrtc with kurento and coturn.


The record feature creates a .mp4 on the fly as the chat is going on.


To start the recording, there is an API call i can make to my server and it automatically stops when all users leaves the chatroom OR do an other api call to stop. see composed video in this link https://docs.openvidu.io/en/2.17.0/advanced-features/recording/


openvidu have also webhooks.


My problem is not how to stop ffmpeg, but getting FFMPEG to encode while the mp4 or other is being generated "on the fly".


There is 2 options :


OPTION 1 : individual => 1 .webm per camare => this .webm ffmpeg can restream as hls or RTMP => it's working.


OPTION 2 : ** but the issue is with "Composed" video => it's using ffmpeg to x11grab the session... but it's mp4 without moov ato, so ffmpeg don't do anything with this.


see the composed.sh script here
https://github.com/OpenVidu/openvidu/blob/master/openvidu-server/docker/openvidu-recording/scripts/composed.sh