
Recherche avancée
Médias (3)
-
Exemple de boutons d’action pour une collection collaborative
27 février 2013, par
Mis à jour : Mars 2013
Langue : français
Type : Image
-
Exemple de boutons d’action pour une collection personnelle
27 février 2013, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (54)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
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 -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (5283)
-
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]) ;