
Recherche avancée
Autres articles (34)
-
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
Configuration spécifique d’Apache
4 février 2011, parModules spécifiques
Pour la configuration d’Apache, il est conseillé d’activer certains modules non spécifiques à MediaSPIP, mais permettant d’améliorer les performances : mod_deflate et mod_headers pour compresser automatiquement via Apache les pages. Cf ce tutoriel ; mode_expires pour gérer correctement l’expiration des hits. Cf ce tutoriel ;
Il est également conseillé d’ajouter la prise en charge par apache du mime-type pour les fichiers WebM comme indiqué dans ce tutoriel.
Création d’un (...) -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...)
Sur d’autres sites (8136)
-
Windows FFMPEG will not find my files at all [migrated]
22 mars 2014, par user2441247I have a folder full of images that go from 0 to whatever number, and I need to turn these images to a video. They are all .PNG files. Here is my command I am using :
ffmpeg.exe -f image2 -framerate 30 -pattern_type sequence -start_number 1 -r 30 -i "img%%04d.jpg" -s 1280x720 test.avi
When I run this I get this error :
[image2 @ 002be580] Could find no file with path 'img%04d.jpg' and index in the range 1-5
img%04d.jpg: No such file or directoryWhat can I change to get this to work ?
-
log : Unbreak windows support
3 avril 2014, par Luca Barbato -
Shell out to FFMPEG from Windows Service sometimes hangs
17 avril 2013, par Jake StevensonWe have a windows service which runs on multiple machines, waiting for MSMQ messages telling it to convert various files for us. Sometimes the files are video files and we shell out an ffmpeg process to do the conversion and wait for the process to complete or error before moving on. And on some occasions, that ffmpeg process appears to "hang" and we have to RDP to the machine as an admin and manually kill it off using task manager before it can continue to accept new messages. This hung ffmpeg process will stay that way indefinitely, I've waited several days on some occasions. The services all run under a special account.
The conversion process involves multiple steps— First copying the file locally, then running ffmpeg to convert, then running mp4box for "hinting", then another ffmpeg for a thumbnail. When it hangs, it is always on the first ffmpeg portion. Killing the ffmpeg process causes that code to receive an error and allows it to handle things normally from there.
Here is the code for that first FFMPEG process. As you can see, we've tried several things to detect a hung process :
public class FFMPEGEncoder : IEncoder
{
[DllImport("kernel32.dll", SetLastError = true)]
static extern int SetErrorMode(int wMode);
private ILogger _logger = NullLogger.Instance;
public ILogger Logger
{
get { return _logger; }
set { _logger = value; }
}
private static readonly string ffmpeg = System.IO.Path.Combine(ConfigurationManager.AppSettings["FFMPEG_Dir"], "ffmpeg.exe");
private const string ffmpegArgs =
"-r 30000/1001 -b 200k -bt 240k -vcodec libx264 -coder 0 -bf 0 -flags2 -wpred-dct8x8 -level 13 -maxrate 768k -acodec libfaac -ac 2 -ar 48000 -ab 192k -s 480x320 -async 1";
public EncoderResult EncodeTheFile(string originalFile)
{
var newFileName =
VideoFileNameHelper.GetVideoFileName(originalFile);
Logger.Debug("Encoding {0} to {1} with ffmpeg", originalFile, newFileName);
RunEncoding(originalFile, newFileName);
return new EncoderResult { Filename = newFileName };
}
private void RunEncoding(string originalFile, string newFileName)
{
var process = new System.Diagnostics.Process
{
StartInfo =
{
CreateNoWindow = true,
WorkingDirectory = ConfigurationManager.AppSettings["FFMPEG_Dir"],
UseShellExecute = false,
FileName = ffmpeg,
Arguments = "-i \"" + originalFile + "\" " + ffmpegArgs + " \"" + newFileName + "\"",
RedirectStandardOutput = false,
RedirectStandardError = true
}
};
Logger.Debug("Launching ffmpeg with the following arguments:");
Logger.Debug(process.StartInfo.Arguments);
int oldMode = SetErrorMode(3);
var startTime = DateTime.Now;
process.Start();
var output = process.StandardError.ReadToEnd();
Logger.Debug("ffmpeg output:");
Logger.Debug(output);
while(!process.WaitForExit(3000))
{
if (!process.Responding)
{
process.Kill();
SetErrorMode(oldMode);
throw new Exception("Process hung");
}
if (DateTime.Now.Subtract(startTime) > new TimeSpan(0, 0, 30, 0))
{
process.Kill();
SetErrorMode(oldMode);
throw new Exception("Process hung");
}
}
SetErrorMode(oldMode);
var exitCode = process.ExitCode;
if (exitCode != 0)
{
//We got an error from ffmpeg
process.Close();
if (System.IO.File.Exists(newFileName))
{
System.IO.File.Delete(newFileName);
}
Logger.Error("Error converting video {0}", originalFile);
throw new Exception(string.Format("Unable to process the video {0}", originalFile));
}
process.Close();
}
}Despite the errormode setting code AND the code that tries to kill the process after 30 minutes, I still end up with it hung occasionally and have to manually kill the process. What am I doing wrong that would allow my system to more gracefully handle the "hung" ffmpeg processes ?