
Recherche avancée
Autres articles (91)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)
Sur d’autres sites (17450)
-
Run ffmpeg using shell_exec from a file called by AJAX
20 décembre 2012, par user1255617Good morning,
I will do my best to phrase a "thoughtful" and "helpful" question for all regarding running FFMPEG using shell_exec from a file called by AJAX. First I will start by listing my current code.
AJAX script
<code class="echappe-js"><script><br />
var xmlhttp;<br />
if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari<br />
xmlhttp=new XMLHttpRequest();<br />
}else{// code for IE6, IE5<br />
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");<br />
}<br />
xmlhttp.onreadystatechange=function(){<br />
if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){<br />
//Do something<br />
}<br />
}<br />
xmlhttp.open("GET","video_convert.php",true);<br />
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");<br />
xmlhttp.send(id=&lt;?php echo $video_upload_result; ?>);<br />
</script>PHP Code
$destination = "files/videos/";
$ffmpeg = '/ffmpeg/ffmpeg';
$videoid = mysql_clean($_GET['id']);
$sql = "SELECT file_name FROM cb_video WHERE videoid = '$videoid' ";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$file_old = glob('files/videos/'.$file_name.'.*');
shell_exec($ffmpeg." -i '/var/www/html/".$file_old[0]."' -ar 44100 /var/www/html/".$destination.$file_name.".flv");FFMPEG is installed and working properly as I have used it elsewhere on the site and have attempted a file conversion using PuTTY. I am able to run a PHP file called by AJAX as I have done it in a separate instance on this site. The only thing I can think of is that the shell_exec isn't running properly, which I have used elsewhere, since it is in a separate file called by ajax or else it is being closed pre-maturely. I have also tested this code in a main file and it works properly until I try to call the separate file with it in it.
So, my question is can this code actually work and if so what steps should I take to get it working ?
Also I would greatly appreciate it if before closing my questions I had a chance to defend or rephrase them to properly suit this boards high standards for questions if I have somehow failed it in any way.
Thank you.
-
How to compile c99-to-c89 convertor with clang ?
27 septembre 2016, par theateistI’m trying to compile ffmpeg in windows for VisualStudio and one of the step is to compile c99-to-c89 code with clang according to this post. I managed to create clang.exe but how I compile c99-to-c89 code with it ?
I changed a little bit the makefile in c99-to-c89 so
CC
variable points now to clang.exe compiler and not cl.exeEXT=.exe
all: c99conv$(EXT) c99wrap$(EXT)
CLANGDIR=C:/build
CC=C:/build/bin/Release/clang.exe
CFLAGS=-nologo -Z7 -D_CRT_SECURE_NO_WARNINGS=1 -Dpopen=_popen -Dunlink=_unlink -Dstrdup=_strdup -Dsnprintf=_snprintf -I. -I$(CLANGDIR)/tools/clang/include
LDFLAGS=-nologo -Z7 $(CLANGDIR)/lib/Release/libclang.lib
clean:
rm -f c99conv$(EXT) c99wrap$(EXT) convert.o compilewrap.o
rm -f unit.c.c unit2.c.c
test1: c99conv$(EXT)
$(CC) -P unit.c -Fiunit.prev.c
./c99conv unit.prev.c unit.post.c
diff -u unit.{prev,post}.c
test2: c99conv$(EXT)
$(CC) -P unit2.c -Fiunit2.prev.c
./c99conv unit2.prev.c unit2.post.c
diff -u unit2.{prev,post}.c
test3: c99conv$(EXT)
$(CC) $(CFLAGS) -P -Ficonvert.prev.c convert.c
./c99conv convert.prev.c convert.post.c
diff -u convert.{prev,post}.c
c99conv$(EXT): convert.o
$(CC) -Fe$@ $< $(LDFLAGS) $(LIBS)
c99wrap$(EXT): compilewrap.o
$(CC) -Fe$@ $< $(LDFLAGS)
%.o: %.c
$(CC) $(CFLAGS) -Fo$@ -c $<but when I run
make
command I getclang: error: unsupported use of internal gcc -Z option '-Z7'
. I guess the problem inCFLAGS
andLDFLAGS
but I don’t know how to fix it because the lack of knowledge in makefile and clang. -
ffmpeg unexpected exit code 1 for -list_devices and -list_options
8 janvier 2024, par djvgDescription


If I run any of the following commands from the examples in the documentation, using
ffmpeg
4.2.2 on Windows 10, the requested information is successfully displayed in the console, but the process exits with exit code1
, instead of the expected0
(success).

ffmpeg -list_devices true -f dshow -i dummy

ffmpeg -list_options true -f dshow -i video="MyCamera"



As far as I know, exit code
1
on Windows implies "Incorrect function", so I consider this behavior to be unexpected.

If I stream camera input to disk, using e.g.
ffmpeg -f dshow -i video="MyCamera" "myfile.mp4"
, then stop using q, the exit code is0
, as expected.

Question


Does the exit code
1
constitute normal behavior forffmpeg
, or am I doing something wrong ?

Relevance


When running the commands manually, from the command line, the exit code does not make much difference, as long as the requested information is displayed.


However, when running the commands programmatically, it may cause trouble. For example, using Python's
subprocess.run(..., check=True)
, the nonzero exit code causes a CalledProcessError.

Of course there are ways around this, e.g. use
check=False
, but the point is that a workaround would not be necessary ifffmpeg
behaved as expected, i.e. returned0
.