Recherche avancée

Médias (91)

Autres articles (37)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Les thèmes de MediaSpip

    4 juin 2013

    3 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
    Thèmes MediaSPIP
    3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (3976)

  • FFMPEG MP4 conversion takes so long its not practical

    30 avril 2018, par Chrisco420365

    I want to start out by saying that I’m not just stating the fact that FFMPEG to MP4 conversion is so slow, but I’m hoping someone here can help me with this as I’ve searched around and haven’t really found out what to do in order to fix my problem.

    So I found a script that seems to do the job for me, it inputs several video file formats and will in turn convert to MP4 which I will later allow the web user to watch online.

    Two main things are done in this script by FFMPEG, a still image is captured in .jpg format and the video is converted to MP4. After some tweaking the script seems to work but at first I thought that it wasn’t working, that it was simply halting my server.

    Let me back up for a minute... I am using FFMPEG on my development server, which is really just my crappy laptop with XAMPP installed on Windows 10 and only 2GB of RAM. Once I have the site working perfectly I will move from my crappy laptop development environment to probably a entry level dedicated server hosting plan from Godaddy or other, since at first I expect the traffic to my website to be very low.

    The problem I am having is I am testing out the script that I will show you, and even with a 10MB video, it takes over 2 minutes to finish. Meanwhile the upload progress bar shows 100% since the upload is in fact complete, but no message for the user to know that something is going on behind the scenes. Obviously that I can figure out how to fix myself, maybe even just put a message letting them know that it will be a few minutes. When I tried a video that is 120MB, it took over 5 minutes which means I had to not only modify my php.ini file to allow for such script execution times, but it also makes it so that I can do nothing on the website while this is happening.

    Not only can I not even so much as scroll the page up or down, but if I try to open another tab and load my website it just sits there with a blank screen as if its trying to access my site. Obviously it’s because FFMPEG is using up all system resources during its conversion of the video file. If I open file explorer and click once on the video file that is being created, and continue clicking once on it I’ll see the file size of this file slowly get larger and larger, which is obvious since the file is being filled. This problem of course is with no users on it other than myself since its in its development stage, so I wonder what it will be like on a dedicated server with users online. Will the other users not be able to do anything for however many minutes until whoever is uploading a video has their video finished ?

    Should it be necessary for me to increase the max execution time in the php.ini file to more than 5 minutes for a 120MB file ? What will happen if a user tries to upload a file larger than 120MB ? Should I cut them off at 500MB perhaps ?

    I love the fact that my users will be able to upload videos and I can get thumbnails and even convert to MP4 to display using HTML5 but not thrilled if noone, including the user uploading the video, can use the site as the system resources are pegged. The last time I uploaded a video on YouTube I think I remember a message saying that it would take several minutes to finish but I don’t remember the website just completely stopping for several minutes. Perhaps this is because I’m running on my insignificant laptop ?

    While searching for answers to this I did come across some people complaining about it being slow but didn’t find any solutions and in fact don’t think I saw people saying it completely locked up the website until finished. As I said, I’d hate for others not to be able to get to my website or be kicked off simply because someone is uploading a video.

    Perhaps this is a common issue that can be resolved with a powerful enough dedicated server once I move to production ? I would greatly appreciate any and all suggestions on how to resolve this so the user may at least continue using other areas of our website, while the conversion is taking place. I can send them an alert once the conversion is finished. If there are any suggestions as to a minimum dedicated server specs that would help alleviate this from happening, I am all ears ! :) Thanks !

    Here is the script that I’m currently using :

    <?php
    include_once($_SERVER['DOCUMENT_ROOT'].'/includes/dbc.php');
    // size input prevents buffer overrun exploits.
      function sizeinput($input, $len){
           (int)$len;
        (string)$input;
        $n = substr($input, 0,$len);
        $ret = trim($n);
        $out = htmlentities($ret, ENT_QUOTES);
        return $out;
    }

    //Check the file is of correct format.  
    function checkfile($input){
       $ext = array('mpg', 'wma', 'mov', 'flv', 'mp4', 'avi', 'qt', 'wmv', 'rm');
       $extfile = substr($input['name'],-4);
       $extfile = explode('.',$extfile);
       $good = array();
       $extfile = $extfile[1];
       if(in_array($extfile, $ext)){
             $good['safe'] = true;
            $good['ext'] = $extfile;
       }else{
             $good['safe'] = false;
      }
        return $good;
    }

    $user_id = $_SESSION['user_id'];
    // if the form was submitted process request if there is a file for uploading
    if($_POST && array_key_exists("vid_file", $_FILES)){
                              //$uploaddir is for videos before conversion
                             $uploaddir = 'temp/';
                              //$live_dir is for videos after converted to flv
           $live_dir = 'library/';
                               //$live_img is for the first frame thumbs.
           $live_img = 'thumbs/';      
                              $seed = time();      
           $upload = $seed;
           $uploadfile = 'temp/'.$upload.'.mp4';        
           $vid_title = sizeinput($_POST['vidTitle'], 50);
           $vid_title = sanitizeString($vid_title);
           $vid_desc = sizeinput($_POST['vidDesc'], 2000);
           $vid_desc = sanitizeString($vid_desc);
           $vid_cat = (int)$_POST['vidCat'];
           $safe_file = checkfile($_FILES['vid_file']);
           if($safe_file['safe'] == 1){
               if (move_uploaded_file($_FILES['vid_file']['tmp_name'], 'temp/'.$upload.'.mp4')) {
                      echo "File was successfully uploaded.<br />";
                       //$base = basename($uploadfile, $safe_file['ext']);
                       $new_file = $seed.'.mp4';
                       $new_image = $seed.'.jpg';
                       $new_image_path = "thumbs/".$seed.'.jpg';
                       $new_flv = "library/".$new_file;
                       //exec('ffmpeg -i '.$uploadfile.' -an -ss 00:00:01-r 1 -vframes 1 -f mjpeg -y '.$new_image_path);
                       exec('ffmpeg  -i '.$uploadfile.' -f mjpeg -vframes 1 -s 300x300 -an '.$new_image_path.'');
                       //ececute ffmpeg generate flv
                         exec('ffmpeg -i '.$uploadfile.' -f mp4 '.$new_flv);
                          //execute ffmpeg and create thumb


               echo 'Thank You For Your Video!<br />';
                          //create query to store video

           $sql = "INSERT INTO videos (`user_id`, `title`,`desc`, `file`, `thumb`) VALUES('".$user_id."','".$vid_title."','".$vid_desc."','".$new_file."','".$new_image."')";


                       echo '<img src="http://stackoverflow.com/feeds/tag/&#039;.$new_image_path.&#039;" style='max-width: 300px; max-height: 300px' /><br />
                             <h3>'.$vid_title.'</h3>';
                       mysqli_query($link, $sql) or die(mysqli_error($mysql));
                } else {
                       echo "Possible file upload attack!\n";
                       print_r($_FILES);
                }

           }else{

                echo 'Invalid File Type Please Try Again. You file must be of type
                .mpg, .wma, .mov, .flv, .mp4, .avi, .qt, .wmv, .rm';

           }
    }
    ?>
  • Trimming and batch converting arbitrary video files to WebMs with python and ffmpeg

    22 juin 2018, par Romtromon

    I’ve got a whole lot of video files that I want to break up into multiple WebMs, each containing a trimmed portion of a specific video.

    I plan on having a csv file attached to each video file (having the same filename as the video) with a column structure similar to :

    Start Time | End Time | Rotation | Output Filename

    And I want to parse the csv files using python to execute ffmpeg, and I did a quick search and found the ffmpeg-python library and thought it might do the trick. The problem is, I don’t know the first thing about ffmpeg or video encoding. I’ve tried reading through the ffmpeg documentation and trying to replicate stuff using ffmpeg-python but the furthest I can get is an output video of the same format as the input file, trimmed (but mpv still shows the duration as the duration of the original file but cuts off playback when the end of the trim is reached) and without audio.

    As a side note, I currently use a software named "WebM for Retards" (excuse the offensive title) which uses ffmpeg and I’m happy with its output but it’s very tedious for my requirement. However I noticed that these are the arguments passed by using the software :

    -f nut -i pipe:0   -c:v libvpx -pix_fmt yuv420p -threads 8 -slices 4 -metadata title="This is a title" -ac 2 -c:a libvorbis -qmin 28 -crf 30 -qmax 32 -qcomp 1 -b:v 0 -qscale:a 3 -f webm -y "C:\Output.webm"

    I’d be happy if I could replicate output similar to what this provides. Thanks in advance for any help !

  • Rendering a remote raw h264 video stream in javascript using WebRTC [on hold]

    20 mai 2018, par Shahabi

    I’m new in Video streaming and decoding for rendering on Web Browser.
    My plan is to create a raw h264 stream on localhost environment and in Nodejs application, I want to read the raw h264 stream and render it on Web browser with Low latency.

    For creating a stream, I’m using VLC Stream option in h264 format on HTTP server. I’m using my laptop webcam and mic for streaming audio/video on localhost environment.

    Now I’m stuck on getting that stream on web page and render it on Web browser.
    I want to use WebRTC or any other opensource library for fast rendering.

    Anyone know or guide me into the right direction where i can solve my problem as mention above ?

    Thanks