
Recherche avancée
Médias (1)
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
Autres articles (46)
-
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
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 -
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
Sur d’autres sites (6656)
-
Revision 36454 : uniformiser les inputs du formulaire de login
19 mars 2010, par brunobergot@… — Loguniformiser les inputs du formulaire de login
-
C# FFMPEG Process and Multiple files
23 novembre 2023, par wesmanI am working on a C# Form tool that will help me convert all of my phone and DSLR video to HEVC, currently, i have a program that uploads the photos and videos to different directories in my home server each time i connect to the WiFi. Once a month or so, i manually convert all the videos, but thought I would automate the process.. I have the Form working perfectly for processing 1 file. but get into trouble when processing a Directory (with possible sub-directories) all at once..



Sorry, this is long, just want to be thorough. here is the button calls



private void processFile_Click(object sender, EventArgs e)
 {
 OpenFileDialog file = new OpenFileDialog();
 file.InitialDirectory = baseMediaDirectory;
 if (file.ShowDialog() == DialogResult.OK)
 {
 ProcessSinlgeFile(file.FileName);
 }
 }




(above)for one file and (below) for a directory



private void processDirectory_Click(object sender, EventArgs e)
{
 FolderBrowserDialog file = new FolderBrowserDialog();
 file.SelectedPath = baseMediaDirectory;
 if(file.ShowDialog() == DialogResult.OK)
 {
 ProcessDirectoryOfFiles(file.SelectedPath);
 }
}

private void ProcessDirectoryOfFiles(string selectedPath)
 {
 List<string> listOfFiles = GetAllFiles(selectedPath);
 foreach (string s in listOfFiles)
 {
 ProcessSinlgeFile(s);
 }
 }
</string>



both ultimately call this method, to do some checks and setup



private void ProcessSinlgeFile(string fileName)
 {

 if (IsAcceptableMediaFile(fileName))
 {
 outputWindow.AppendText("File to Process: " + fileName);
 processMediaFile = 
 new MediaFileWrapper(this.outputWindow, new MediaFile(fileName), new NReco.VideoInfo.FFProbe());
 if (processMediaFile.OkToProcess)
 {
 int initialCRFValue = 15;
 //ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
 string intialSpeed = "veryfast";
 try {

 ConvertToMPEG(processMediaFile.getFFMPEGCommand(initialCRFValue, intialSpeed), processMediaFile);
 }
 catch
 {
 // at somepoint, we'll catch a bad file size (or compression)
 // then change the CRF value and/or compression speed
 }
 }
 }
 }




ultimately I get to this Method and run into trouble.



private async void ConvertToMPEG(string arguments, MediaFileWrapper processMediaFile)
 {
 startTime = DateTime.Now;
 watch = new Stopwatch();
 watch.Start();
 progressBar1.Minimum = 0;
 progressBar1.Maximum = processMediaFile.GetTotalMilliseconds();

 // Start the child process.
 p = new Process();

 //Setup filename and arguments
 outputWindow.AppendText("ffmpeg " + arguments);
 p.StartInfo.Arguments = arguments;
 p.StartInfo.FileName = "ffmpeg.exe";
 p.StartInfo.UseShellExecute = false;

 // Redirect the output stream of the child process.
 p.StartInfo.RedirectStandardOutput = true;
 p.StartInfo.RedirectStandardError = true;
 p.StartInfo.RedirectStandardInput = true;

 // capture the date for stdout and std error
 // note FFMPEG uses Stderr exclusively
 p.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived);
 p.OutputDataReceived += new DataReceivedEventHandler(OutputDataReceived);

 // Hide Console Window
 p.StartInfo.CreateNoWindow = true;
 p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

 p.Start();
 p.BeginErrorReadLine();
 p.BeginOutputReadLine();
 await p.WaitForExitAsync();
 }




and WaitForExitAsync is in another class because in can not be in here with a Form



public static Task WaitForExitAsync(this Process process,
 CancellationToken cancellationToken = default(CancellationToken))
 {
 var tcs = new TaskCompletionSource();
 process.EnableRaisingEvents = true;
 process.Exited += (sender, args) => tcs.TrySetResult(null);
 if (cancellationToken != default(CancellationToken))
 cancellationToken.Register(tcs.SetCanceled);

 return tcs.Task;
 }




however, single files work fine, when I call a directory through, it continuously starts processes for each file, trying to run them all at the same time. You can see I tried implementing this 
process.WaitForExit() asynchronously
with no luck.


-
C# FFMPEG Process and Multiple files
3 novembre 2016, par wesmanI am working on a C# Form tool that will help me convert all of my phone and DSLR video to HEVC, currently, i have a program that uploads the photos and videos to different directories in my home server each time i connect to the WiFi. Once a month or so, i manually convert all the videos, but thought I would automate the process.. I have the Form working perfectly for processing 1 file. but get into trouble when processing a Directory (with possible sub-directories) all at once..
Sorry, this is long, just want to be thorough. here is the button calls
private void processFile_Click(object sender, EventArgs e)
{
OpenFileDialog file = new OpenFileDialog();
file.InitialDirectory = baseMediaDirectory;
if (file.ShowDialog() == DialogResult.OK)
{
ProcessSinlgeFile(file.FileName);
}
}(above)for one file and (below) for a directory
private void processDirectory_Click(object sender, EventArgs e)
{
FolderBrowserDialog file = new FolderBrowserDialog();
file.SelectedPath = baseMediaDirectory;
if(file.ShowDialog() == DialogResult.OK)
{
ProcessDirectoryOfFiles(file.SelectedPath);
}
}
private void ProcessDirectoryOfFiles(string selectedPath)
{
List<string> listOfFiles = GetAllFiles(selectedPath);
foreach (string s in listOfFiles)
{
ProcessSinlgeFile(s);
}
}
</string>both ultimately call this method, to do some checks and setup
private void ProcessSinlgeFile(string fileName)
{
if (IsAcceptableMediaFile(fileName))
{
outputWindow.AppendText("File to Process: " + fileName);
processMediaFile =
new MediaFileWrapper(this.outputWindow, new MediaFile(fileName), new NReco.VideoInfo.FFProbe());
if (processMediaFile.OkToProcess)
{
int initialCRFValue = 15;
//ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
string intialSpeed = "veryfast";
try {
ConvertToMPEG(processMediaFile.getFFMPEGCommand(initialCRFValue, intialSpeed), processMediaFile);
}
catch
{
// at somepoint, we'll catch a bad file size (or compression)
// then change the CRF value and/or compression speed
}
}
}
}ultimately I get to this Method and run into trouble.
private async void ConvertToMPEG(string arguments, MediaFileWrapper processMediaFile)
{
startTime = DateTime.Now;
watch = new Stopwatch();
watch.Start();
progressBar1.Minimum = 0;
progressBar1.Maximum = processMediaFile.GetTotalMilliseconds();
// Start the child process.
p = new Process();
//Setup filename and arguments
outputWindow.AppendText("ffmpeg " + arguments);
p.StartInfo.Arguments = arguments;
p.StartInfo.FileName = "ffmpeg.exe";
p.StartInfo.UseShellExecute = false;
// Redirect the output stream of the child process.
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
// capture the date for stdout and std error
// note FFMPEG uses Stderr exclusively
p.ErrorDataReceived += new DataReceivedEventHandler(ErrorDataReceived);
p.OutputDataReceived += new DataReceivedEventHandler(OutputDataReceived);
// Hide Console Window
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
p.BeginErrorReadLine();
p.BeginOutputReadLine();
await p.WaitForExitAsync();
}and WaitForExitAsync is in another class because in can not be in here with a Form
public static Task WaitForExitAsync(this Process process,
CancellationToken cancellationToken = default(CancellationToken))
{
var tcs = new TaskCompletionSource();
process.EnableRaisingEvents = true;
process.Exited += (sender, args) => tcs.TrySetResult(null);
if (cancellationToken != default(CancellationToken))
cancellationToken.Register(tcs.SetCanceled);
return tcs.Task;
}however, single files work fine, when I call a directory through, it continuously starts processes for each file, trying to run them all at the same time. You can see I tried implementing this
process.WaitForExit() asynchronously
with no luck.