Recherche avancée

Médias (1)

Mot : - Tags -/belgique

Autres articles (93)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie 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 (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • 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.

Sur d’autres sites (5866)

  • FFmpeg : canvas and crop work separately but result in black screen when combined

    25 janvier, par didi00

    I'm working on a video processing pipeline with FFmpeg, where I :

    


      

    • Create a black canvas using the color filter.
    • 


    • Crop a region from my video input.
    • 


    • Overlay the cropped region onto the black canvas.
    • 


    


    Both the canvas and the crop display correctly when tested individually. However, when I attempt to combine them (overlay the crop onto the canvas), the result is a black screen.
What Works :

    


    Black Canvas Alone :

    


    ffmpeg -filter_complex "color=c=black:s=1920x1080[out]" -map "[out]" -f nut - | ffplay 
-


    


    This shows a plain black screen, as expected.

    


    Cropped Region Alone :

    


    ffmpeg -f v4l2 -input_format yuyv422 -framerate 60 -video_size 1920x1080 -i /dev/video0 
\ -vf "crop=1024:192:0:0" -f nut - | ffplay -


    


    This shows the cropped region of the video correctly.

    


    When I combine these steps to overlay the crop onto the black canvas, I get a black screen :

    


    ffmpeg -f v4l2 -input_format yuyv422 -framerate 60 -video_size 1920x1080 -i /dev/video0 
\-filter_complex "color=c=black:s=1920x1080,format=yuv420p[background]; \
[0:v]crop=1024:192:0:0,format=yuv420p[region0]; \
[background][region0]overlay=x=0:y=0[out]" \
-map "[out]" -f nut - | ffplay -


    


    Environment :

    


      

    • OS : Linux (Debian-based)
    • 


    • FFmpeg Version : [Insert version, e.g., 4.x or 5.x]
    • 


    • Capture Card Format : yuyv422
    • 


    


    Question :

    


    Why does the pipeline result in a black screen when combining the canvas and the crop, even though both work separately ? Is this an issue with pixel format compatibility, or is there something I'm overlooking in the overlay filter setup ?

    


  • 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;

  • Why does this ffmpeg conversion result in variable bitrate ? [closed]

    6 juin 2013, par Trace

    I have this command

    ffmpeg -i test.mp3 -ac 1 -ab 64000 -ar 44100 output.mp3

    The requirements are

    mp3 (mpeg-1 layer 3)
    Bit rate: 64kbps CBR(constant Bit Rate)
    Sampling rate: 44.1
    Bit depth: 16bit
    Channels: mono

    The sample rate is correct, but file came through with a variable bit rate, not constant bit rate.

    Any ideas what I'm missing here ?