
Recherche avancée
Autres articles (103)
-
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
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 (13017)
-
Workflow and data format for sending MediaRecorder output to express server
30 avril 2021, par MaxI've been trying to figure this out for a while but got lost between different ways of sending files and different data formats.


I am recording the stream of a canvas animation with MediaRecorder. As far as I understand this returns a blob with the video in binary format. Now I want to send this data to my express server and convert it to an h264 encoded mp4 file. My first impulse was to use ffmpeg on the server. Unfortunately I'm struggling with the details of the implementation. I am unsure on how to best transmit the data and in what format and how to feed it to ffmpeg.


This is what I have on the client side :


// Get stream from element
stream = element.captureStream(30)

// Create media recorder with stream
const recorder = new MediaRecorder(stream)

// Save to file
recorder.ondataavailable = ({ data }) => {
 
 const formData = new FormData()
 formData.append("file", data)

 const options = {
 method: "POST",
 body: formData,
 }

 fetch("http://localhost:3001/api/blob_to_mp4", options).then(
 (res) => {
 console.log(res)
 }
 )
}



And this is what I have on the server side :


"use strict";

const express = require("express");
const cors = require("cors");
const ffmpeg = require("fluent-ffmpeg");
const fs = require("fs");

const port = process.env.PORT || 3001;
const app = express();
var command = ffmpeg();

app.use(cors());
app.use(express.urlencoded({ extended: true }));
app.use(express.json());

app.post("/api/blob_to_mp4", function (req, res) {
 var data = Buffer.from("");

 // Add data
 req.on("data", function (chunk) {
 data = Buffer.concat([data, chunk]);
 });

 // Full data available
 req.on("end", () => {
 req.rawBody = data;
 });

 res.send("hello world");
});

app.listen(port);
console.log(`Server running on port ${port}`);



-
ffmpeg run from c# Process not closing when using '-i anullsrc'
1er octobre 2022, par Brown BearI am generating a large collection MP4 videos from an OpenGL source. This has worked perfectly so far but I recently noticed that some TV media player don't like video without audio, see here for more info.


So far i hve been using the following code :


private bool StartRecording()
 {
 _ffmpeg = new Process();
 _ffmpeg.StartInfo.FileName = "ffmpeg.exe";
 _ffmpeg.StartInfo.Arguments = $"-f rawvideo -pix_fmt rgba -s {RecordSize.Width}x{RecordSize.Height} -r 30 -i - -c libx264 -crf 17 -pix_fmt yuv420p -b:v 1024k -bufsize:v 1835008 {RecordFile} -tune animation";
 _ffmpeg.StartInfo.RedirectStandardInput = true;
 _ffmpeg.Start();

 if(_ffmpeg.HasExited)
 {
 IsRecording = false;
 return false;
 }
 return true;
 }

 private void RecordFrame(RenderUpdate update)
 {
 if (_ffmpeg == null)
 return;

 var frame = Project.RecordFrame(update);
 var data = new byte[frame.Length];
 var height = RecordSize.Height;
 var width = RecordSize.Width;

 for (var k = 0; k < height; k++)
 {
 var j = height - k - 1;
 Buffer.BlockCopy(
 frame, k * width * 4,
 data, j * width * 4,
 width * 4);
 }

 _ffmpeg.StandardInput.BaseStream.Write(data, 0, data.Length);
 }

 private void StopRecording()
 {
 Project.StopRecording();
 if (_ffmpeg == null)
 return;

 _ffmpeg.StandardInput.Flush();
 _ffmpeg.StandardInput.Close();
 _ffmpeg.Close();
 _ffmpeg.Dispose();
 }



And it has worked perfectly until I modified the 'ffmpeg' cmd line arguments to include '-i anullsrc' for the audio.


_ffmpeg.StartInfo.Arguments = $"-f rawvideo -pix_fmt rgba -s {RecordSize.Width}x{RecordSize.Height} -r 30 -i - -f lavfi -i anullsrc=channel_layout=mono:sample_rate=8k -c:v libx264 -crf 17 -pix_fmt yuv420p -b:v 1024k -bufsize:v 1835008 {RecordFile} -tune animation";



The moment I add '-f lavfi -i anullsrc' to the cmd line the call to 'StopRecording()' has no effect and ffmpeg continues to run.


I can manually stop it by closing the console window or even using ctrl-c, but the job needs to be automated so this is just not an option.


Ultimately my question is Why is ffmpeg behaving this way ?


I've come up with a couple of work arounds, but I don't like either :


- 

- Post process the videos as per the link I mentioned earlier. Not practical. I need to generate 1000s of videos and a single batch of 350 takes around 6 hours. 50% of that time is consumed by ffmpeg encoding, so to re-encode them all just to add a null audio track would nearly double the time.
- Try to push a 'ctrl-c' through to the ffmpeg process as per this post. I did some quick tests with 'GenerateConsoleCtrlEvent' without sucess, and the idea of having to manually start and stop the Process via 'kernel32.dll' seems excessive not to mention old school.






Any insight would be greatly appreciated.


-
Revision 3202 : Et on update la conf d’emballe_medias tant qu’à faire
6 avril 2010, par kent1 — LogEt on update la conf d’emballe_medias tant qu’à faire