
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (93)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.
Sur d’autres sites (8660)
-
C# FFMPEG : Code bugs out and stops producing media files
24 mai 2020, par HamezI've made a joke program in C# that uses ffmpeg to edit videos with different effects such as stuttering. I've finished 3 effects so far and each of them work on their own but as soon as I put one after another
e.g. fx.CrashStutter(0, 2); fx.CrashBeep(2, 2); fx.Wow(4, 2);

The code breaks and no longer produces photo/video files but once I stop debugging the file it was supposed to be processing appears. I've used a system where it loops over trying to execute a command to create a text file as a marker for when ffmpeg is done processing a file. The debug console also repeatedly says "The process tried to write to a nonexistent pipe."


Here's the code for all 3 effects :



public void Wow(double start, double duration)
 {
 if (fxstart == true)
 {
 //MessageBox.Show("WowFX Duration" + duration);
 string folderName = ("W_s" + start);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("mkdir " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("ffmpeg -ss " + start + " -t " + (duration / 6) + " -i " + source + " a.mp4");
 //wait until a.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\a.txt") == false)
 {
 /*aha got a live one!*/FXcmd.StandardInput.WriteLine(" echo a > a.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i a.mp4 -vf reverse -af areverse b.mp4");
 //wait until b.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\b.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo b > b.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -ss " + start + " -t " + (duration / 3) + " -i " + source + " c.mp4");
 //wait until c.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\c.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo c > c.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i c.mp4 -vf reverse -af areverse d.mp4");
 //wait until d.mp4 appears
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\d.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo d > d.txt");
 System.Threading.Thread.Sleep(1500);
 }
 string[] concatList = { "file 'a.mp4'", "file 'b.mp4'", "file 'c.mp4'", "file 'd.mp4'" };
 //FXcmd.StandardInput.Write("del a.txt, b.txt, c.txt, d.txt");
 //System.Threading.Thread.Sleep(1000);
 System.IO.File.WriteAllLines(("FxSource(Temporary)\\" + folderName + "\\concatList.txt"), concatList);
 System.Threading.Thread.Sleep(1500);
 FXcmd.StandardInput.WriteLine("ffmpeg -f concat -i concatList.txt -c copy " + folderName + ".mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\" + "1.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo 1 > 1.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("copy " + folderName + ".mp4 ..");
 while (File.Exists("FxSource(Temporary)\\" + folderName + ".mp4") == false)
 {
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cls");
 FXcmd.StandardInput.Flush();
 }
 }
 public void CrashStutter(int start, int duration)
 {
 if (fxstart == true)
 {
 string folderName = ("Cs_s" + start);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("mkdir " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("ffmpeg -ss " + start + " -t 0.1" + " -i " + source + " a.mp4");
 System.Threading.Thread.Sleep(100);
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\a.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo a > a.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -stream_loop "+10*duration+" -i a.mp4 "+folderName+".mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\" + "1.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo 1 > 1.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("copy " + folderName + ".mp4 ..");
 while (File.Exists("FxSource(Temporary)\\" + folderName + ".mp4") == false)
 {
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cls");
 FXcmd.StandardInput.Flush();
 }
 }
 public void CrashBeep(int start, int duration)
 {
 //this effect cannot last longer than 7 seconds
 double contrast = 25;
 double red = 0.75;
 if (fxstart == true)
 {
 string folderName = ("Cb_s" + start);
 FXcmd.StandardInput.WriteLine("mkdir " + folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd " + folderName);
 System.Threading.Thread.Sleep(100);
 /*gets stuck*/FXcmd.StandardInput.WriteLine("ffmpeg -i "+source+ " -vf fps=1 a.jpg");
 System.Threading.Thread.Sleep(100);
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\a.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo a > a.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i a.jpg -vf eq=contrast="+contrast+" b.jpg");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\b.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo b > b.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i b.jpg -vf colorbalance=rm=" + red + " c.jpg");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\c.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo > c.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -loop 1 -i c.jpg -c:v libx264 -t "+ duration +" -pix_fmt yuv420p -vf scale=1920:1080 d.mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\d.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo d > d.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("copy beep.mp3 "+folderName+"/beep.mp3");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cd "+folderName);
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("ffmpeg -i beep.mp3 -ss 0 -t " + duration + " e.mp3");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\e.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo e > e.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("ffmpeg -i d.mp4 -i e.mp3 -c copy -map 0:v:0 -map 1:a:0 " + folderName + ".mp4");
 while (File.Exists("FxSource(Temporary)\\" + folderName + "\\" + "1.txt") == false)
 {
 FXcmd.StandardInput.WriteLine(" echo 1 > 1.txt");
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("copy " + folderName + ".mp4 ..");
 while (File.Exists("FxSource(Temporary)\\" + folderName + ".mp4") == false)
 {
 System.Threading.Thread.Sleep(1500);
 }
 FXcmd.StandardInput.WriteLine("cd ..");
 System.Threading.Thread.Sleep(100);
 FXcmd.StandardInput.WriteLine("cls");
 FXcmd.StandardInput.Flush();
 }
 }




Any suggestions ? Thanks !


-
Cannot use FFmpeg in Xcode iOS Project (file .h not found)
19 mars 2016, par BlackBoxI followed almost step by step this guide.
Almost because I downloaded, as a user suggested, ffmpeg ios library already built from here
I followed from "Linking static libraries in Xcode" but I cannot import anyway the header files of ffmpeg. (So I got the .a files)
For example
#include "avformat.h"
// or
#import "libavformat/avformat.h"
// or
#import <libavformat></libavformat>avformat.h>Everything that I use does not work.
I specify that those .a files are currently in my project directory, indeed, if I import the .a file, it doesn’t complain that it isn’t found, but when compiling, it complains about UTF-8 stuff because .a files are object libraries and cannot be imported that way.
I put also the Header Search Paths for the project as it was suggested and the config.log file but nothing.
Also I see libraries are missing from every project example of FFmpeg I was able to find on GitHub.
Any ideas ?
-
Run avconv in python and direct stdout/stderr to a file
19 février 2016, par tdkI wish to run Avconv commands and record the logs in a file. In the Ubuntu terminal this can be accomplished using
&>>
operator after the actual command enclosed in parenthesis i.e.(avconv -i SRCFILE -ss 00:15:00 -t 00:30:00 TARGETFILE -threads auto) &>> LOGFILE
The above command works perfectly when run in the terminal.
Now I have a number of such commands to run, and thought running them through Python would be good.
-
I tried using the
os.system(command_string)
way
, which when run does not pack the Avconv output to the LOGFILE, and the avconv command seems to execute after the Python script is done - evidenced by some string outputs I put in for debugging. I’m also getting some permission errors. Here is how the first portion of output looks likeAVCONV COMMAND EXECUTED
sh: 1: : Permission denied
sh: 1: : Permission denied
sh: 1:
PROGRAM DONE
: Permission denied
$ avconv version 11.2-6:11.2-1, Copyright (c) 2000-2014 the Libav developers
built on Jan 18 2015 05:12:33 with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu2)
Trailing options were found on the commandline.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ... -
I also tried using the
subprocess.call()
method for which I get the following error (NOTE : all files exist)Traceback (most recent call last):
File "/home/usr/cnv.py", line 61, in <module>
main()
File "/home/usr/cnv.py", line 46, in main
subprocess.call(newcmd)
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
</module>
I wish to run multiple (think 50+) commands of Avconv similar to the version shown at the top, and have the logs saved in a file instead of in stdout. How do I do this - in Python or otherwise ?
-