
Recherche avancée
Autres articles (34)
-
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 -
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 (...) -
De l’upload à la vidéo finale [version standalone]
31 janvier 2010, parLe chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
Upload et récupération d’informations de la vidéo source
Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)
Sur d’autres sites (4622)
-
Converting avi to mp4 php fail
27 octobre 2013, par Dirk SwarzI'm able to convert video via server command using :
ffmpeg -i movie.avi -acodec libmp3lame -vcodec libx264 -s 1280x720 -ar 44100 -async 44100 -r 29.970 -ac 2 -qscale 5 goodmovie.mp4
For this test I used a 1.8mb video and after conversion it is 5 MB. I'm able to upload the video to my server after I download it from FTP and it will work with flash player, but when I try to automate this it fails.
CODE :
$ffmpeg_command = 'ffmpeg -i '.$new_name.' -acodec libmp3lame -vcodec libx264 -s 1280x720 -ar 44100 -async 44100 -r 29.970 -ac 2 -qscale 5 '.$anew_name;
$convert_avi = true;It converts to MP4, but
- it is not 5 MB but rather 2.2 MB when the original file is 1.8 MB
- it doesn't play in flash player.
The main upload script is in upload.php which anyone can download from here :
http://www.mediafire.com/?lp3f5pjal2oc19c
That code which i provided i just put into config.php
-
Anomalie #4206 (Nouveau) : Sauvegarde impossible
27 octobre 2018, par Franck DBonjour :-)
Test fait chez ovh en php 7.2.10 sur une installation toute neuve de SPIP 3.3.0-dev [24131]
version php : php 7.2
Moteur : phpcgi
Mode : développementJe vais dans ecrire/ ?exec=sauvegarder je clique sur Sauvegarder la base
La sauvegarde ne va pas au bout !Fatal error : Uncaught Error : Call to undefined method mysqli::quote() in /.../ecrire/req/sqlite_generique.php:2023 Stack trace : #0 /.../ecrire/req/sqlite_generique.php(1166) : _sqlite_calculer_cite(’T\xC3\xA2che CRON que...’, ’text NOT NULL D...’) #1 /.../ecrire/base/abstract_sql.php(792) : spip_sqlite_insertq_multi(’spip_jobs’, Array, Array, ’dump’, true) #2 /.../ecrire/base/dump.php(723) : sql_insertq_multi(’spip_jobs’, Array, Array, ’dump’) #3 /.../ecrire/base/dump.php(638) : base_inserer_copie(’spip_jobs’, Array, Array, ’dump’) #4 /.../plugins-dist/dump/inc/sauvegarder.php(63) : base_copier_tables(’../tmp/status_d...’, Array, ’’, ’dump’, Array) #5 /.../plugins-dist/dump/action/sauvegarder.php(49) : inc_sauvegarder_dist(’../tmp/status_d...’, ’http://www.lien...’) #6 /.../ecrire/public/aiguiller.php(67) : action_sauvegarde in /.../ecrire/req/sqlite_generique.php on line 2023
Franck
-
Java shelling out to FFMPEG not running nor giving error
4 janvier, par ToddI'm writing a Podcast downloader where I want to be able to download one or more podcasts then run them through FFMPEG.


It does run when I run the program in Windows.

It does not run when I run the program in Linux - Meaning FFMPEG may or may not have been called. I have no way of knowing. I get a -1 back from process.waitfor() but no error in my Java logs and no entries at all in the ffmpeg.log file. And there is no file in the processed file directory that FFMPEG would have created.

It does run in Linux if I run the same command that fails in Java from the command line.

FFMPEG has the permissions : rwxr-xr-x , so it doesn't seem as if it'd be a permission error. The Java code looks like :


ProcessBuilder processBuilder = new ProcessBuilder( commands );
 processBuilder.redirectErrorStream( true );
 // Added the next line to see if I could log an error from ffmpeg
 processBuilder.redirectOutput( ProcessBuilder.Redirect.appendTo( new File( "./ffmpeg.log" ) ) );

 Process process = processBuilder.start();
 BufferedReader bufferedOutputReader = new BufferedReader( new InputStreamReader( process.getInputStream() ) );
 do {
 outputString = bufferedOutputReader.readLine();
 if ( outputString != null ) {
 LOGGER.trace( outputString );
 }
 } while ( outputString != null );
 results = process.waitFor();
 LOGGER.debug( "Exit value: " + results );



The commands are :


2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: /bin/ffmpeg 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -y 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -i 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: "/home/todd/aggregator/incoming/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3" 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -ac 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: 1 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: -af 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: "atempo=1.4,volume=1.4" 
2023-10-25 16:21:52,452 224257 [pool-1-thread-4] DEBUG org.sperbolink.utils.CodecUtils - command string: "/home/todd/aggregator/processed/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3"



And the manually constructed and run command line that DOES work is :


/bin/ffmpeg -y -i "/home/todd/aggregator/incoming/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3" -ac 1 -af "atempo=1.4,volume=1.4" "/home/todd/aggregator/processed/Downrange Radio/Downrange_Radio_2023-02-15_The_Avidity_PD-10_Delivers_.mp3"



The ffmpeg.log file is empty, so I'm doubting whether FFMPEG is ever being reached.


What am I doing wrong ?


EDIT :
I changed the commands to be


"/bin/ffmpeg 2> foo.txt" 



and the execution code to :


ProcessBuilder processBuilder = new ProcessBuilder( commands );
// processBuilder.redirectErrorStream( true );
 // Added the next line to see if I could log an error from ffmpeg
// processBuilder.redirectOutput( ProcessBuilder.Redirect.appendTo( new File( "./ffmpeg.log" ) ) );
 Process process = processBuilder.start();
 results = process.waitFor();



Running that command from the command line displays a list of MMPEG commands that can be run within foo.txt. Upon running from within the Java app, the foo.txt file is empty, so it doesn't appear that FFMPEG ever gets reached. But, I'm clueless why not.


EDIT 2 :
I converted the /bin/ffmpeg path to uppercase to see if that would return an error and it did.


ERROR org.mrpc.utilities.ShellUtils - Cannot run program "/BIN/FFMPEG": error=2, No such file or directory



This seems to confirm that the Java Process object can locate ffmpeg successfully when it is properly cased (i.e. my original code) as I don't see an error message when the case is incorrect. Still not sure why nothing happens when it is called.


EDIT 3 :
I punted on this a year ago, but recently had to revisit. This time I found the answer. It is because I included double quotes around some of the command parameters. That caused the files to not be found. This link states that the Process class handles embedded spaces without any intervention required by you : ProcessBuilder adds extra quotes to command line