
Recherche avancée
Médias (1)
-
The Slip - Artworks
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (82)
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir
Sur d’autres sites (10365)
-
Find video resolution and video duration of remote mediafile
22 février 2012, par osgxI want to write an program which can find some metainformation of mediafile. I'm interested in popular video formats, such as avi, mkv, mp4, mov (may be other popular too). I want basically to get :
- Video size (720, 1080, 360 etc)
- Total runtime of video (may be not very exact)
- Number of audio streams
- Name of video codec
- Name of audio codec
There is already the mediainfo, but in my program I want to get information about remote file, which may be accessed via ftp, http, samba ; or even torrent (there are some torrent solutions, which allows to read not-yet downloaded file).
MediaInfo library have no support of samba (smb ://) and mkv format (for runtime).
Also, I want to know, how much data should be downloaded to get this information. I want not to download full videofile because I have no enough disk space.
Is this information in the first 1 or 10 or 100 KiloBytes of the file ? Is it at predictable offset if I know the container name and total file size ?
PS : Platform is Linux, Language is C/C++
-
How to convert a Stream on the fly with FFMpegCore ?
18 octobre 2023, par AdrianFor a school project, I need to stream videos that I get from torrents while they are downloading on the server.
When the video is a .mp4 file, there's no problem, but I must also be able to stream .mkv files, and for that I need to convert them into .mp4 before sending them to the client, and I can't find a way to convert my Stream that I get from MonoTorrents with FFMpegCore into a Stream that I can send to my client.


Here is the code I wrote to simply download and stream my torrent :


var cEngine = new ClientEngine();

var manager = await cEngine.AddStreamingAsync(GenerateMagnet(torrent), ) ?? throw new Exception("An error occurred while creating the torrent manager");

await manager.StartAsync();
await manager.WaitForMetadataAsync();

var videoFile = manager.Files.OrderByDescending(f => f.Length).FirstOrDefault();
if (videoFile == null)
 return Results.NotFound();

var stream = await manager.StreamProvider!.CreateStreamAsync(videoFile, true);
return Results.File(stream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);



I saw that the most common way to convert videos is by using ffmpeg. .NET has a package called
FFMpefCore
that is a wrapper for ffmpeg.

To my previous code, I would add right before the
return
:

if (!videoFile.Path.EndsWith(".mp4"))
{
 var outputStream = new MemoryStream();
 FFMpegArguments
 .FromPipeInput(new StreamPipeSource(stream), options =>
 {
 options.ForceFormat("mp4");
 })
 .OutputToPipe(new StreamPipeSink(outputStream))
 .ProcessAsynchronously();
 return Results.File(outputStream, contentType: "video/mp4", fileDownloadName: manager.Name, enableRangeProcessing: true);
}



I unfortunately can't get a "live" Stream to send to my client.


-
Anomalie #3248 (Nouveau) : Les fonctions parametre_url (js et php) n’insèrent pas correctement les...
26 juillet 2014, par Michel BystranowskiL’appel
parametre_url(’http://domaine/spip.php?t[]=1’,’t’,array(0,2)) ;
retournehttp://domaine/spip.php?t[]=1&t[]=0&t[]=2
au lieu dehttp://domaine/spip.php?t[]=0&t[]=2
Ce problème est présent à la fois dans la version javascript et la version php. Je n’ai testé que sur SPIP 3.0.16.
J’ai un patch qui corrige ça dans les deux cas.
Pour le javascript, il y a une regexp mal échappée, et un appel à la fonction substring avec un index négatif, ce qui n’est pas permis, seule la fonction substr le permet… (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring)
Et dans les deux cas, il faut bien vider les valeurs initiale du tableau dans l’url avant d’ajouter les nouvelles valeurs.
Je joins des fichiers corrigés, et voici un patch :
2 files changed, 9 insertions(+), 3 deletions(-) 2014/ecrire/inc/utils.php | 5 +++++ 2014/prive/javascript/ajaxCallback.js | 7 ++++---
Modified 2014/ecrire/inc/utils.php
diff —git a/2014/ecrire/inc/utils.php b/2014/ecrire/inc/utils.php
index b875aa2..01a7f53 100644
— - a/2014/ecrire/inc/utils.php
+++ b/2014/ecrire/inc/utils.php
@@ -333,6 +333,11 @@ function parametre_url($url, $c, $v=NULL, $sep=’& ;’)
$url[$n] = $r[1].’=’.$u ;
unset($ajouts[$r[1]]) ;
+ // Pour les tableaux on laisse tomber les valeurs de
+ // départ, on remplira à l’étape suivante
+ else
+ unset($url[$n]) ;
+
Modified 2014/prive/javascript/ajaxCallback.js
diff —git a/2014/prive/javascript/ajaxCallback.js b/2014/prive/javascript/ajaxCallback.js
index 118fc31..de434c4 100644
— - a/2014/prive/javascript/ajaxCallback.js
+++ b/2014/prive/javascript/ajaxCallback.js
@@ -809,7 +809,7 @@ function parametre_url(url,c,v,sep,force_vide)
else
a=url ;var regexp = new RegExp(’^(’ + c.replace(’[]’,’[]’) + ’[?] ?)(=.*) ?$’) ;
+ var regexp = new RegExp(’^(’ + c.replace(’[]’,’[]’) + ’[?] ?)(=.*) ?$’) ;
var ajouts = [] ;
var u = (typeof(v) !==’object’) ?encodeURIComponent(v):v ;
var na = [] ;
@@ -829,11 +829,12 @@ function parametre_url(url,c,v,sep,force_vide)
// Ajout. Pour une variable, remplacer au meme endroit,
// pour un tableau ce sera fait dans la prochaine boucleelse if (r[1].substring(-2) != ’[]’)
+ else if (r[1].substr(-2) != ’[]’)
na.push(r[1]+’=’+u) ;
ajouts.push(r[1]) ;
else na.push(args[n]) ;
+ /* Pour les tableaux ont laisse tomber les valeurs de départ, on
+ remplira à l’étape suivante */
else
na.push(args[n]) ;