Recherche avancée

Médias (0)

Mot : - Tags -/signalement

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (33)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette 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, par

    Le 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, par

    MediaSPIP 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 Weihe

    I 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 the os 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 the os.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)
    -1

    So 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 memory

    But 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 i0x4r

    I 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

    


    &lt;?php&#xA;//index.php&#xA;&#xA;?>&#xA;&#xA;&#xA; &#xA;  &#xA;  &#xA;  <code class="echappe-js">&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js&quot;&gt;&lt;/script&gt;&#xA;        &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;        &#xA;  &#xA;  &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/dropzone.js&quot;&gt;&lt;/script&gt;&#xA;  &#xA; &#xA; &#xA;  
    &#xA;&#xA;
    &#xA;&#xA;

    &#xA; &#xA; &#xA; &#xA;
    &#xA;&#xA;

    &#xA;&#xA;
    &#xA;

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

    &#xA;

    upload.php

    &#xA;

        &lt;?php&#xA;&#xA;//upload.php&#xA;&#xA;$folder_name = &#x27;upload/&#x27;;&#xA;$tumb_name = &#x27;thumb/&#x27;;&#xA;$imageext = &#x27;.png&#x27;;&#xA;&#xA;if(!empty($_FILES))&#xA;{&#xA;&#xA; $temp_file = $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;];&#xA; $location = $folder_name . $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; move_uploaded_file($temp_file, $location);&#xA; $upload = $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; $uploadStr = str_replace(" ", "\ ",$upload);&#xA; $locationStr = str_replace(" ","\ ",$location);&#xA; $cmd  = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&amp;1";&#xA; echo shell_exec($cmd);&#xA;}&#xA;&#xA;if(isset($_POST["name"]))&#xA;{&#xA; $filename = $folder_name.$_POST["name"];&#xA; $imagename = $thumb_name.$_POST["name"].$imageext;&#xA; unlink($filename);&#xA; unlink($imagename);&#xA;}&#xA;&#xA;$result = array();&#xA;&#xA;$files = scandir(&#x27;upload&#x27;);&#xA;&#xA;$output = &#x27;<div class="row">&#x27;;&#xA;&#xA;if(false !== $files)&#xA;{&#xA; foreach($files as $file)&#xA; {&#xA;  if(&#x27;.&#x27; !=  $file &amp;&amp; &#x27;..&#x27; != $file)&#xA;  {&#xA;   $output .= &#x27;&#xA;   <a href="http://stackoverflow.com/view.php?file=&#38;#x27;.$file.&#38;#x27;" target="_blank"> <img src="http://stackoverflow.com/feeds/tag/thumb/&#38;#x27;.$file.&#38;#x27;.png" class="img-thumbnail" width='246' height='138' /></a>&#xA;    <button type="button" class="btn btn-link remove_image">Remove</button>&#xA;   &#x27;;&#xA;  }&#xA; }&#xA;}&#xA;$output .= &#x27;</div>&#x27;;&#xA;echo $output;&#xA;&#xA;?>&#xA;

    &#xA;

    EDIT :&#xA;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.

    &#xA;

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

    &#xA;

    This is an example of that

    &#xA;

    &lt;?php&#xA;&#xA;//upload.php&#xA;&#xA;$folder_name = &#x27;upload/&#x27;;&#xA;$tumb_name = &#x27;thumb/&#x27;;&#xA;$imageext = &#x27;.png&#x27;;&#xA;&#xA;if(!empty($_FILES))&#xA;{&#xA;&#xA; $temp_file = $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;];&#xA; $location = $folder_name . $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; move_uploaded_file($temp_file, $location);&#xA; $upload = $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; $uploadStr = str_replace(" ", "\ ",$upload);&#xA; $locationStr = str_replace(" ","\ ",$location);&#xA; $cmd  = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&amp;1";&#xA; echo shell_exec($cmd);&#xA;}&#xA;&#xA;if(isset($_POST["name"]))&#xA;{&#xA; $filename = $folder_name.$_POST["name"];&#xA; $imagename = $thumb_name.$_POST["name"].$imageext;&#xA; unlink($filename);&#xA; unlink($imagename);&#xA;}&#xA;&#xA;&#xA;$output .= &#x27;Successfly file is "&#x27;.$location.&#x27;"&#x27;;&#xA;echo $output;&#xA;&#xA;?>&#xA;

    &#xA;

    Result : Successfly file is ""&#xA;no name file :(

    &#xA;

    EDIT 3 :

    &#xA;

    this code upload.php&#xA;functions not working

    &#xA;

    &lt;?php&#xA;&#xA;//upload.php&#xA;&#xA;$folder_name = &#x27;upload/&#x27;;&#xA;$tumb_name = &#x27;thumb/&#x27;;&#xA;$imageext = &#x27;.png&#x27;;&#xA;&#xA;if(!empty($_FILES))&#xA;{&#xA;&#xA; $temp_file = $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;];&#xA; $location = $folder_name . $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; move_uploaded_file($temp_file, $location);&#xA; $upload = $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; $uploadStr = str_replace(" ", "\ ",$upload);&#xA; $locationStr = str_replace(" ","\ ",$location);&#xA; $cmd  = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&amp;1";&#xA; echo shell_exec($cmd);&#xA;}&#xA;&#xA;&#xA;echo "The file " . $location . " has been uploaded";&#xA;// not working&#xA;echo "<br />";&#xA;echo "The file " . $upload . " has been uploaded";&#xA;// not working&#xA;echo "<br />";&#xA;echo "The file " . $uploadStr . " has been uploaded";&#xA;// not working&#xA;echo "<br />";&#xA;echo "The file " . $locationStr . " has been uploaded";&#xA;// not working&#xA;&#xA;?>&#xA;

    &#xA;

    Result upload.php in EDIT 3

    &#xA;

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

    &#xA;

    line 38 : echo $location ;

    &#xA;

    About the developer solution Markus AO

    &#xA;

    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&#xA;enter image description here

    &#xA;

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

    &#xA;

    Thank you bro.

    &#xA;

  • ffmpeg fails to connect to pulse audio when scheduled through cron

    4 février 2017, par Barrett

    I 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 user

    ffmpeg 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 ?