
Recherche avancée
Médias (3)
-
Elephants Dream - Cover of the soundtrack
17 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (43)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
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 (5968)
-
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.


-
Shaka Player : ignore empty AdaptationSet
24 juin 2019, par MityaI’m trying to play DASH stream in Shaka Player.
Sometimes the stream doesn’t have an audio source and its manifest file contains an emptyAdaptationSet
entry.
In this case Shaka Player returns the manifest parsing error :| DASH_EMPTY_ADAPTATION_SET | 4003 | number | The DASH Manifest contained an AdaptationSet with no Representations. |
Is it possible to ignore this error somehow and play the video without audio source ?
Example of manifest file :
<?xml version="1.0" encoding="utf-8"?>
<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="dynamic" minimumupdateperiod="PT4S" suggestedpresentationdelay="PT4S" availabilitystarttime="2019-06-24T13:38:04Z" publishtime="2019-06-24T13:38:34Z" timeshiftbufferdepth="PT14.9S" minbuffertime="PT9.9S">
<programinformation>
</programinformation>
<period start="PT0.0S">
<adaptationset contenttype="video" segmentalignment="true" bitstreamswitching="true">
<representation mimetype="video/mp4" codecs="avc1.640028" bandwidth="2000000" width="1920" height="1080" framerate="20/1">
<segmenttemplate timescale="10240" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startnumber="5">
<segmenttimeline>
<s t="201697" d="51190" r="2"></s>
</segmenttimeline>
</segmenttemplate>
</representation>
</adaptationset>
<adaptationset contenttype="audio" segmentalignment="true" bitstreamswitching="true">
</adaptationset>
</period>
</mpd> -
Process in c# freezes up
12 juillet 2022, par Quicksoapyenvironment : Rider 2022.1.2, .NET 6.0, Windows 10


The following piece of code should copy the musicFile that is given and add a cover to the copy, then place it as name :
title - artist.extension
in the same directory, for examplenever gonna give you up - rick astley.mp3


When debugging, if i copy-paste what is saved in the variable
p.StartInfo.Arguments
in a CMD terminal, it works perfectly, but in my c# code the program freezes up atp.WaitForExit();
.

What could i be doing wrong ?


using (Process p = new Process())
 {
 p.StartInfo.UseShellExecute = false;
 p.StartInfo.CreateNoWindow = true;
 p.StartInfo.RedirectStandardOutput = true;
 p.StartInfo.FileName = "CMD.exe";
 p.StartInfo.Arguments = "ffmpeg -i \""+ musicFile +"\" -i \""+ albumInfo.Image.Uri.ToString() +"\" -map 0:a -map 1 -codec copy -metadata:s:v title=\"Album cover\" -metadata:s:v comment=\"Cover (front)\" -disposition:v attached_pic \"" + directoryFile + "\\" + title + " - " + artist + "." + formatName + "\"";
 p.Start();
 p.WaitForExit();
 }