
Recherche avancée
Autres articles (69)
-
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 (...) -
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 (...) -
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)
Sur d’autres sites (13579)
-
MediaRecorder - FFMPEG - RTMP issue
5 octobre 2017, par Bear10Currently I’m working on streaming Audio and Video from a video captured in Chrome 61.0.3163.100 with the MediaRecorder API.
The backend is running on node and it spawns a child process which runs ffmpeg :
ffmpeg -threads 4 -i udp://127.0.0.1:41234 -t 5400 -ar 44100
-b:a 128k -c:v libx264 -c:a libfdk_aac -pix_fmt yuv420p -r 30 -g 60 -vb 2048k -preset slow -minrate 2000k -maxrate 4000k test.mp4On the client side I send the raw Blob from Chrome to the Node server via web socket :
var mediaStream = new MediaStream([videoOutput.getVideoTracks()[0], audioOutput.getAudioTracks()[0]]),
recorder = new MediaRecorder(mediaStream, {
mimeType: 'video/webm;codecs=vp8'
});
socket = io('http://localhost:' + port);
recorder.addEventListener('dataavailable', function (evt) {
socket.emit('video:data', evt.data);
});And in Node we simply resend via udp to the ffmpeg process :
let client = dgram.createSocket('udp4'),
client.send(chunk, 0, chunk.length, 41234, '127.0.0.1', function (err, bytes) {
if (err) {
throw err;
}
});The resulting mp4 is viewable on VLC without any issues, despite many of the following warnings showing up in the FFMPEG console :
stderr: frame= 1751 fps= 31 q=17.0 size= 15997kB time=00:00:58.39 bitrate=2244.3kbits/s dup=449 drop=32 speed=1.03x
stderr: [mp4 @ 0x7fefe6019000] Non-monotonous DTS in output stream 0:1; previous: 2573919, current: 2573792; changing to 2573920. This may result in incorrect timestamps in the output file.
stderr: frame= 1767 fps= 31 q=17.0 size= 16166kB time=00:00:58.90 bitrate=2248.4kbits/s dup=452 drop=32 speed=1.03x
stderr: [libmp3lame @ 0x7fefe7004c00] Queue input is backward in time
stderr: [mp4 @ 0x7fefe6019000] Non-monotonous DTS in output stream 0:1; previous: 2614768, current: 2614686; changing to 2614769. This may result in incorrect timestamps in the output file.However when I try to re stream this specific video on Youtube or any other RTMP platform (ex : Facebook) the audio is choppy, the command I use :
ffmpeg -i ./test.mp4 -f flv rtmp://a.rtmp.youtube.com/live2/MYAPIKEY
On the other hand any other "good" video not made from the aforementioned process re streams just fine and I suspect it might be from the warnings I’m getting.
As an added bit of information streaming directly from my PC with avfoundation to youtube also works fine, and writing from avfoundation to a file and then streaming to youtube also works ok.
The goal is to stream from my browser to the node server and directly to the Youtube RTMP without the choppy audio issue.
If someone knows how to get rid of the warning to ensure ffmpeg isn’t the issue or can point me in the direction to achieve the desired result that’d be great.
-
Replicating C metadata example from ffmpeg in C# using ffmpeg-autogen - av_dict_get fails
2 octobre 2017, par Adam BaxterI am trying to replicate https://ffmpeg.org/doxygen/3.0/doc_2examples_2metadata_8c_source.html in C# using the wrapper from https://github.com/Ruslan-B/FFmpeg.AutoGen
I can open and read some properties of the file just fine, however
tag
is always null, even after the call toav_dict_get
My code is as follows
using System;
using System.IO;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using FFmpeg.AutoGen;
namespace ffmpeg_test
{
class Program
{
static void Main(string[] args)
{
var currentPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var libPath = Path.Combine(currentPath, "lib");
SetDllDirectory(libPath);
ffmpeg.av_register_all();
ffmpeg.avcodec_register_all();
DoRiskyThings();
}
private static unsafe void DoRiskyThings()
{
var pFormatContext = ffmpeg.avformat_alloc_context();
if (ffmpeg.avformat_open_input(&pFormatContext, "01 - 999,999.opus", null, null) != 0)
throw new ApplicationException(@"Could not open file.");
ffmpeg.avformat_find_stream_info(pFormatContext, null);
AVStream* pStream = null;
pStream = pFormatContext->streams[0];
var codecContext = *pStream->codec;
Console.WriteLine($"codec name: {ffmpeg.avcodec_get_name(codecContext.codec_id)}");
Console.WriteLine($"number of streams: {pFormatContext->nb_streams}");
//attempting to replicate https://ffmpeg.org/doxygen/3.0/doc_2examples_2metadata_8c_source.html
AVDictionaryEntry* tag = null;
tag = ffmpeg.av_dict_get(pFormatContext->metadata, "", null, 2);
while (tag != null)
{
tag = ffmpeg.av_dict_get(pFormatContext->metadata, "", tag, 2);
Console.WriteLine(Encoding.UTF8.GetString(tag->key,100));
//tag->key and //tag->value are byte pointers
}
}
[DllImport("kernel32", SetLastError = true)]
private static extern bool SetDllDirectory(string lpPathName);
}
} -
MediaSource through socket stops
23 août 2017, par Paulo Galdo Sandovali’m trying to stream a rtsp live stream through
socket.io
usingffmpeg
(this works fine), but now i need to get that video from the socket and play it on a HTML5 video tag.To do this i’m using
MediaSurce
, getting small pieces of video through the socket and then appending it to theMediaSource
This solution reproduces the video a few seconds o minutes and then suddenly stops
and it doesn’t throw me any error on theChrome console
var socket = io();
var ms = new MediaSource();
var sourceBuffer;
var queue = [];
var video = document.getElementById("video");
video.src = window.URL.createObjectURL(ms);
socket.on('start', function (response) {
console.log(response);
socket.emit('streaming', $stateParams.id);
ms.addEventListener('sourceopen', videoLoad, false);
ms.addEventListener('sourceclose', videoClosed, false);
});
function videoLoad() {
sourceBuffer = ms.addSourceBuffer('video/webm; codecs="vorbis,vp8"');
sourceBuffer.addEventListener('update', function () {
if (queue.length > 0 && !sourceBuffer.updating) {
console.log(queue.length);
sourceBuffer.appendBuffer(queue.shift());
}
});
socket.on('data', function (response) {
var bytes = new Uint8Array(response);
var blob = new Blob(bytes);
console.log(blob.size);
if (sourceBuffer.updating || queue.length > 0) {
queue.push(bytes);
} else {
sourceBuffer.appendBuffer(bytes);
}
});
}
function videoClosed(e) {
console.log('mediaSource readyState: ' + this.readyState);
}On my
chrome://media-internals/
the video players log show me a couple of time this, and then the video stopsvideo_buffering_state BUFFERING_HAVE_ENOUGH