
Recherche avancée
Autres articles (33)
-
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. -
Emballe Médias : Mettre en ligne simplement des documents
29 octobre 2010, parLe plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...) -
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 (5292)
-
os.system() returning False for some reason
22 février 2017, par Kendall WeiheI have a rather large program (memory-wise), it’s a neural network with Tensorflow. I’m working with volumetric data. My end goal is to use
ffmpeg
to create a video through the volume — where each frame is a z-slice. I’ve successfully done this before using theos
python library. The code looks like this :videoFile = self.slicesPath + "/0.mp4"
sliceFiles = self.slicesPath + "/%04d.jpg"
os.system("ffmpeg -y -framerate 10 -start_number 0 -i " + sliceFiles + " -vcodec mpeg4 " + videoFile)When I step through this with
pdb
and I try to execute theos.system()
command I get-1
as if there were some error.(Pdb) os.system("ffmpeg -y -framerate 10 -start_number 0 -i " + sliceFiles + " -vcodec mpeg4 " + videoFile)
-1So then I printed the two variables...
(Pdb) sliceFiles
'/home/volcart/UnsupervisedResults/HercFragment/VAE/0/1/%04d.jpg'
(Pdb) videoFile
'/home/volcart/UnsupervisedResults/HercFragment/VAE/0/1/0.mp4'Opened up a python console in a new terminal tab, copy and pasted the exact same line of code (with the strings above instead of variable names), and BAM ! it magically works.
Why is this ? It works in a separate python console, it works in bash, but it doesn’t work inside my program (when it is the exact same thing). My only guess is something to do with memory, but I know for certain I am not out of memory... my machine has 64GB and python has no limits.
EDIT
I just tried a
subprocess
instead and got this :(Pdb) subprocess.call("ffmpeg -y -framerate 10 -start_number 0 -i " + sliceFiles + " -vcodec mpeg4 " + videoFile, shell=True)
*** OSError: [Errno 12] Cannot allocate memoryBut how is it unable to allocate memory ? Python doesn’t have memory bounds right ? I have 64GB of memory, and I can execute the
ffmpeg
command outside the program, so something is bounding my program. -
How to Show result after uploaded file in PHP
23 avril 2022, par i0x4rI have a script that uploads the video to a server, everything is correct but there is a problem, after the upload of the video to the server is completed
it shows all the uploaded files in the (uploads) folder as array !


I only want the result of the file I just uploaded, and it doesn't show me the previous files !
I need ffmpeg to improve video quality


index.php


<?php
//index.php

?>


 
 
 
 <code class="echappe-js"><script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>

 
<script src="https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/dropzone.js"></script>

 
 
 



 
 
 








 



<script>&#xA;&#xA;$(document).ready(function(){&#xA; &#xA; Dropzone.options.dropzoneFrom = {&#xA; autoProcessQueue: true,&#xA; timeout: 300000,&#xA; acceptedFiles:"video/*",&#xA; init: function(){&#xA; var submitButton = document.querySelector(&#x27;#submit-all&#x27;);&#xA; myDropzone = this;&#xA; submitButton.addEventListener("click", function(){&#xA; myDropzone.processQueue();&#xA; });&#xA; this.on("complete", function(){&#xA; if(this.getQueuedFiles().length == 0 &amp;&amp; this.getUploadingFiles().length == 0)&#xA; {&#xA; var _this = this;&#xA; _this.removeAllFiles();&#xA; }&#xA; list_image();&#xA; });&#xA; },&#xA; };&#xA;&#xA; list_image();&#xA;&#xA; function list_image()&#xA; {&#xA; $.ajax({&#xA; url:"upload.php",&#xA; success:function(data){&#xA; $("#preview").html(data);&#xA; }&#xA; });&#xA; }&#xA;&#xA; $(document).on(&#x27;click&#x27;, &#x27;.remove_image&#x27;, function(){&#xA; var name = $(this).attr(&#x27;id&#x27;);&#xA; $.ajax({&#xA; url:"upload.php",&#xA; method:"POST",&#xA; data:{name:name},&#xA; success:function(data)&#xA; {&#xA; list_image();&#xA; }&#xA; })&#xA; });&#xA; &#xA;});&#xA;</script>



upload.php


<?php

//upload.php

$folder_name = 'upload/';
$tumb_name = 'thumb/';
$imageext = '.png';

if(!empty($_FILES))
{

 $temp_file = $_FILES['file']['tmp_name'];
 $location = $folder_name . $_FILES['file']['name'];
 move_uploaded_file($temp_file, $location);
 $upload = $_FILES['file']['name'];
 $uploadStr = str_replace(" ", "\ ",$upload);
 $locationStr = str_replace(" ","\ ",$location);
 $cmd = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&1";
 echo shell_exec($cmd);
}

if(isset($_POST["name"]))
{
 $filename = $folder_name.$_POST["name"];
 $imagename = $thumb_name.$_POST["name"].$imageext;
 unlink($filename);
 unlink($imagename);
}

$result = array();

$files = scandir('upload');

$output = '<div class="row">';

if(false !== $files)
{
 foreach($files as $file)
 {
 if('.' != $file && '..' != $file)
 {
 $output .= '
 <a href="http://stackoverflow.com/view.php?file=&#x27;.$file.&#x27;" target="_blank"> <img src="http://stackoverflow.com/feeds/tag/thumb/&#x27;.$file.&#x27;.png" class="img-thumbnail" width='246' height='138' /></a>
 <button type="button" class="btn btn-link remove_image">Remove</button>
 ';
 }
 }
}
$output .= '</div>';
echo $output;

?>



EDIT :
I put the example on an Array, I don't want it, I just want it to show the downloaded video I just uploaded as a result.


EDIT 2 :
There are some who say type $location and it displays the downloaded file, but this does not work !!!
I just tried more than once and with several uses, there is no display where the text is empty


This is an example of that


<?php

//upload.php

$folder_name = 'upload/';
$tumb_name = 'thumb/';
$imageext = '.png';

if(!empty($_FILES))
{

 $temp_file = $_FILES['file']['tmp_name'];
 $location = $folder_name . $_FILES['file']['name'];
 move_uploaded_file($temp_file, $location);
 $upload = $_FILES['file']['name'];
 $uploadStr = str_replace(" ", "\ ",$upload);
 $locationStr = str_replace(" ","\ ",$location);
 $cmd = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&1";
 echo shell_exec($cmd);
}

if(isset($_POST["name"]))
{
 $filename = $folder_name.$_POST["name"];
 $imagename = $thumb_name.$_POST["name"].$imageext;
 unlink($filename);
 unlink($imagename);
}


$output .= 'Successfly file is "'.$location.'"';
echo $output;

?>



Result : Successfly file is ""
no name file :(


EDIT 3 :


this code upload.php
functions not working


<?php

//upload.php

$folder_name = 'upload/';
$tumb_name = 'thumb/';
$imageext = '.png';

if(!empty($_FILES))
{

 $temp_file = $_FILES['file']['tmp_name'];
 $location = $folder_name . $_FILES['file']['name'];
 move_uploaded_file($temp_file, $location);
 $upload = $_FILES['file']['name'];
 $uploadStr = str_replace(" ", "\ ",$upload);
 $locationStr = str_replace(" ","\ ",$location);
 $cmd = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&1";
 echo shell_exec($cmd);
}


echo "The file " . $location . " has been uploaded";
// not working
echo "<br />";
echo "The file " . $upload . " has been uploaded";
// not working
echo "<br />";
echo "The file " . $uploadStr . " has been uploaded";
// not working
echo "<br />";
echo "The file " . $locationStr . " has been uploaded";
// not working

?>





this error :
[23-Apr-2022 12:31:56 Asia/Riyadh] PHP Notice : Undefined variable : location in /home/prdix/public_html/test/upload.php on line 38


line 38 : echo $location ;


About the developer solution Markus AO


I did the experiment and it is quite good, but dropzone is still missing, because I will upload a large video and the normal upload compresses the video before uploading, here is a picture from my mobile while uploading, but this does not happen with dropzone



I want to implement this in dropzone as well, because this library does not compress the video, but upload it in full size.


Thank you bro.


-
ffmpeg fails to connect to pulse audio when scheduled through cron
4 février 2017, par BarrettI would like to start ffmpeg to capture audio from pulse through a cron task. I am currently running Linux arch 4.8.13-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux.
$ ffmpeg
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 6.2.1 (GCC) 20160830
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: CX20583 Analog [CX20583 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0/usr/local/sbin/ffmpeg-audio
#! /bin/sh
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
n=$(date +"%s")
out="/home/user/audio/out"$n".mp3"
cd /
echo -e $USER" "$(id -u)"\n"$out"\n" > $out.txt
/usr/bin/ffmpeg -y -f alsa -i pulse -t 5 -codec:a libmp3lame -q:a 9 "file:"$out$ crontab -l
* * * * * /usr/local/sbin/ffmpeg-audio
$ journalctl -u cronie
Feb 04 11:51:01 arch crond[8913]: pam_unix(crond:session): session opened for user user by (uid=0)
Feb 04 11:51:01 arch CROND[8914]: (user) CMD (/usr/local/sbin/ffmpeg-audio)
Feb 04 11:51:01 arch sudo[8919]: user : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/ffmpeg -y -f alsa -i pulse -t 5 -codec:a libmp3lame -q:a 9 file:/home/user/audio/out1486237861.mp3
Feb 04 11:51:01 arch sudo[8919]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT (ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( built with gcc 6.2.1 (GCC) 20160830)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavutil 55. 34.100 / 55. 34.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavcodec 57. 64.101 / 57. 64.101)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavformat 57. 56.100 / 57. 56.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavdevice 57. 1.100 / 57. 1.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavfilter 6. 65.100 / 6. 65.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavresample 3. 1. 0 / 3. 1. 0)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libswscale 4. 2.100 / 4. 2.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libswresample 2. 3.100 / 2. 3.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libpostproc 54. 1.100 / 54. 1.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT (ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ()
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ([alsa @ 0x55a46e0144a0] cannot open audio device pulse (Connection refused))
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT (pulse: Input/output error)
Feb 04 11:51:01 arch sudo[8919]: pam_unix(sudo:session): session closed for user root
Feb 04 11:51:01 arch CROND[8913]: pam_unix(crond:session): session closed for user userffmpeg runs correctly from the command line and ’$ which ffmpeg-audio’ returns /usr/local/sbin/ffmpeg-audio, but ffmpeg returns
([alsa @ 0x55a46e0144a0] cannot open audio device pulse (Connection
refused))when scheduled through cron.
Any suggestions ?