
Recherche avancée
Médias (5)
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
-
Valkaama DVD Cover Outside
4 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
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
Autres articles (51)
-
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 -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (6345)
-
Concurrently redirect Process stdin and stdout in Process Class
3 décembre 2013, par Andrew SimpsonI have a desktop application written in C#.
I am using ffmpeg using the Process class.
Currently there are 2 stages in my code.
The first is that I supply byte arrays (each array is a jpeg) to the stdin to create an ogg file.
This is the code for that :
public byte[] EncodeAndUploadImages(string _args1, string _fn)
{
byte[] _data = null;
try
{
clientBuild = new Process();
clientBuild.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
clientBuild.StartInfo.Arguments = " -f mjpeg -r 30 -i - -c:v libtheora -q:v 7 -r 30 -f ogg -";
clientBuild.StartInfo.FileName = Environment.CurrentDirectory + @"\ffmpeg.exe";
clientBuild.StartInfo.UseShellExecute = false;
clientBuild.StartInfo.RedirectStandardOutput = true;
clientBuild.StartInfo.RedirectStandardError = true;
clientBuild.StartInfo.RedirectStandardInput = true;
clientBuild.StartInfo.CreateNoWindow = true;
clientBuild.StartInfo.LoadUserProfile = false;
clientBuild.EnableRaisingEvents = true;
clientBuild.Start();
using (BinaryWriter bw = new BinaryWriter(clientBuild.StandardInput.BaseStream))
{
for (int i = 1; i < 20; i++)
{
using (MemoryStream ms = new MemoryStream())
{
System.Diagnostics.Debug.Write(i.ToString("00000"));
Bitmap bmp = new Bitmap("h:\\streamin\\" + i.ToString("00000") + ".jpg");
bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);
bw.Write(ms.ToArray());
bmp.Dispose();
ms.Close();
}
}
bw.Close();
}
mStandardOutput = clientBuild.StandardOutput.BaseStream;
mStandardOutput.BeginRead(mReadBuffer, 0, mReadBuffer.Length, StandardOutputReadCallback, null);
clientBuild.WaitForExit();
_data = mStandardOutputMs.ToArray();
mStandardOutput.Close();
}
catch (Exception _ex)
{
}
finally
{
clientBuild.Dispose();
}
return _data;
}The stdout gives me that ogg file in a new byte array.
The second part of my code takes a ogg file on my hard disk and extracts all the jpegs contained init to stdout in byte array format.
Here is that code :
private void ExtractImagesFromVideo(byte[] data,string _args)
{
try
{
build = new Process();
build = new Process();
build.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
build.StartInfo.Arguments = "-i \"h:\\streamout\\cache.ogg\" -vf scale=640:-1 -an -vframes 100 -r 1 -f image2pipe -";
build.StartInfo.FileName = @"C:\inetpub\wwwroot\bin\ffmpeg.exe";
build.StartInfo.UseShellExecute = false;
build.StartInfo.RedirectStandardOutput = true;
build.StartInfo.RedirectStandardError = true;
build.StartInfo.RedirectStandardInput = true;
build.StartInfo.CreateNoWindow = true;
build.StartInfo.LoadUserProfile = false;
build.EnableRaisingEvents = true;
build.Start();
mStandardOutput = build.StandardOutput.BaseStream;
mStandardOutput.BeginRead(mReadBuffer, 0, mReadBuffer.Length, StandardOutputReadCallback, null);
build.WaitForExit();
byte[] _data5 = mStandardOutputMs.ToArray();
mStandardOutput.Close();
}
catch (Exception _ex)
{
}
finally
{
build.Dispose();
}
}Now I would like to fuse the 2 processes. The ultimate aim is to supply stdin from a ogg file in byte array format and to extract the contaomed jpegs in byte array format.
But if i do this :
private void ExtractImagesFromVideo(byte[] data,string _args)
{
try
{
build = new Process();
build = new Process();
build.StartInfo.WorkingDirectory = Environment.CurrentDirectory;
build.StartInfo.Arguments = "-i pipe:0 -vf scale=640:-1 -an -vframes 100 -r 1 -f image2pipe -";
build.StartInfo.FileName = @"C:\inetpub\wwwroot\bin\ffmpeg.exe";
build.StartInfo.UseShellExecute = false;
build.StartInfo.RedirectStandardOutput = true;
build.StartInfo.RedirectStandardError = true;
build.StartInfo.RedirectStandardInput = true;
build.StartInfo.CreateNoWindow = true;
build.StartInfo.LoadUserProfile = false;
build.EnableRaisingEvents = true;
build.Start();
using (BinaryWriter bw = new BinaryWriter(build.StandardInput.BaseStream))
{
bw.Write(data); //code hangs here!!!!
}
mStandardOutput = build.StandardOutput.BaseStream;
mStandardOutput.BeginRead(mReadBuffer, 0, mReadBuffer.Length, StandardOutputReadCallback, null);
build.WaitForExit();
byte[] _data5 = mStandardOutputMs.ToArray();
mStandardOutput.Close();
}
catch (Exception _ex)
{
}
finally
{
build.Dispose();
}
}The code hangs where I indicated.
Can anyone advise please ?
Thanks
-
Révision 82048 : le message ’probleme_technique’ a l’envoi d’un mail merite une class erreur plut...
21 avril 2014, par Fil Up -
Révision 82049 : le message ’probleme_technique’ a l’envoi d’un mail merite une class erreur plut...
21 avril 2014, par Fil Up