Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (42)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (8984)

  • ffmpeg video thumbnail image not uploading in codeigniter

    15 mars 2015, par user3785746

    I am trying to upload a video in codeigniter and i also want to upload thumbnail image of this video using ffmpeg. it works fine in core php but the code is not working in codeigniter. Here is my code

    public function of_file_upload()
               {


                       $un = $_POST['un'];
                       $other_un = $_POST['other_un'];
                       $up_folder = "chat_file";
                       $uploded_files = array();
                       $base_path = base_url() . "uploads/" . $up_folder . "/";
                       $i = 0;
                       #######################################
                       if (!empty($_FILES)) {

                           foreach ($_FILES as $k => $arr) {
                               $temp = explode('.', $arr['name']);
                               $extention = end($temp);
                               $r_char = $this->get_random_string(6);
                               $unArr = explode("@", $un);
                               $un = $unArr[0];
                               $file_name = $un . '_' . $r_char . '_' . time() . '.' .  $extention;
                               $path = $_SERVER['DOCUMENT_ROOT'] . '/api/uploads/' . $up_folder  . '/';
                               $file_path = $path . $file_name;
                               try {

                                   if (move_uploaded_file($arr["tmp_name"], $file_path)) {
                                       $uploded_files[$i]["fn"] = $base_path . $file_name;
                                       $uploded_files[$i]["id"] = $k;
                                       if($extention != 'jpg' && $extention != 'png' && $extention != 'jpeg' && $extention != 'gif' && $extention != 'bmp')
                                       {  
                                           $ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg";
                                           $videoFile = $arr["tmp_name"];
                                           /*$imageFile = $path.$un . '_' . $r_char . '_' . time() . '.jpg' ;*/
                                           $imageFile = $_SERVER['DOCUMENT_ROOT'] . 'api/uploads/'.$un . '_' . $r_char . '_' . time() . '.jpg' ;
                                           //echo $imageFile;die;
                                           $size = "120x90";
                                           $getfromsecond = 5;
                                           $cmd = "$ffmpeg -i $videoFile -an -ss $getfromsecond   -s $size $imageFile";
                                           shell_exec($cmd);
                                       }
                                   } else {
                                       $this->_sendResponse(13);
                                   }
                               } catch (Exception $e) {
                                   print_r($e->getMessage());
                               }
                               $i++;
                           }
                       }
               }

    I have put the ffmpeg folder in c drive and is there any other place where I have to place this folder in codeigniter case. Here is my core php code which works fine.

                   
                   
                     
                   <form method="post" action="index1.php" enctype="multipart/form-data">
                   <input type="file" />
                   <input type="submit" value="submit" />
                   </form>
                   
                   &lt;?php
                        if(isset($_POST['submit']))
                         {
                           $ffmpeg = "C:\\ffmpeg\\bin\\ffmpeg";
                           $videoFile = $_FILES['video']['tmp_name'];
                           foreach($_FILES as $key =>$value)
                            {
                               $param = $value['name'];
                            }
                           $tmp = explode('.',$param);
                           $imgname = $tmp[0];
                           $folder = 'upload';
                           if(!file_exists($folder))
                           {
                               mkdir($folder);
                           }
                           $imageFile = $folder."/".$imgname.".jpg";
                           $size = "120x90";
                           $getfromsecond = 5;
                           $cmd = "$ffmpeg -i $videoFile -an -ss $getfromsecond -s $size                        $imageFile";
                           if(!shell_exec($cmd))
                            {
                                echo "success";
                            }
                           else
                           {
                               echo "failed";
                           }
                  }
                   ?>
                     
                   

    I have tried many things but no luck please help thanks in advance.

  • FFmpeg producing a flickering video from images

    21 juin 2018, par jjohnn91

    So I’m trying to make a video of a fractal rotating through some values, much like seen here.

    I generate the frames (1000 of them) using a different program written in Java that works just fine, so for the purposes of this scenario assume that all the images are in the target folder and also in numerical order as they need to appear in the video.

    I found the following code on the web to stitch images into a video, and I haven’t the faintest idea how it works, and when I run it, all of the images are indeed stitched into a video and placed on the desktop, but the video appears to have one specific frame just jump in at random positions. I’m not totally sure which one, but its one of the earlier frames, somewhere between 1 and 200 of the 1000.

    I’ve also tested making two half videos, one using the first 500 frames, and the other using the second 500 frames. The first video (1 -> 500) has flickering, and the second video (501 -> 1000) appears not to have flickering to my observations.

    I am seeking help in fixing the flickering behavior, and I will upload the video file to google drive later if asked. The Images are all 1920x1080, and in proper numerical order.

    Thanks in advance !

    import static org.bytedeco.javacpp.opencv_imgcodecs.*;
    import java.io.File;
    import org.bytedeco.javacpp.avcodec;
    import org.bytedeco.javacv.FFmpegFrameRecorder;
    import org.bytedeco.javacv.OpenCVFrameConverter;
    public class ImageToMovie{
       public static void main(String []args){
           String imgPath="C:\\Users\\John\\Images";
           String vidPath="C:\\Users\\John\\Desktop\\video.mp4";
           String[] links=new String[new File(imgPath).listFiles().length];
           File f=new File(imgPath);
           File[] f2=f.listFiles();
           for(int i=0;icode>
  • "Non-monotonous DTS in output stream" every 13 hours 14 minutes

    29 mars 2018, par Gnitry

    I have a problem with the latest ffmpeg from zeranoe.
    Every 13h14m ffmpeg stops recording.

    ffmpeg started on 2017-09-28 at 10:36:49
    Report written to "ffmpeg-20170928-103649.log"
    Command line:
    "D:\\ffmpeg\\ffmpeg.exe" -report
    ffmpeg version N-87353-g183fd30 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7.2.0 (GCC)
     configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib
     libavutil      55. 76.100 / 55. 76.100
     libavcodec     57.106.101 / 57.106.101
     libavformat    57. 82.101 / 57. 82.101
     libavdevice    57.  8.101 / 57.  8.101
     libavfilter     6.105.100 /  6.105.100
     libswscale      4.  7.103 /  4.  7.103
     libswresample   2.  8.100 /  2.  8.100
     libpostproc    54.  6.100 / 54.  6.100
    Splitting the commandline.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Hyper fast Audio and Video encoder

    I record video streams from 3 cameras.

    Stream 1 :

    Input #0, rtp, from 'rtp://225.1.1.1:1024':
     Duration: N/A, start: 60424.501000, bitrate: N/A
     Program 1
       Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressiv
    e), 1920x1080 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
       Stream #0:1(eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, mono,
    fltp, 164 kb/s

    Streams 2,3 :

    Input #0, rtsp, from 'rtsp://192.168.3.36:554/stream1':
     Metadata:
       title           : Session streamed by "Pelco Streaming Server"
       comment         : stream1
     Duration: N/A, start: 0.219167, bitrate: N/A
       Stream #0:0: Video: h264 (Baseline), yuv420p(progressive), 640x480, 25 fps,
    25 tbr, 90k tbn, 50 tbc

    I record each of them with segmentation every 1 minute using separated ffmpeg instances like :

    ffmpeg -i "rtsp://192.168.3.36:554/stream1" -vcodec copy -an -f segment -strftime 1 -segment_time 60 "novus-%Y-%m-%d_%H-%M-%S.ts"

    Every 13 hours 14 minutes (from beginning of recording) each ffmpeg stops recording with messages like "Non-monotonous DTS in output stream 0:0". And it doesn’t matter when I started every ffmpeg intance : if I started instance №2 1 minute later that instance №1, it will stop recording in 1 minute after №1 accordingly. I tried it on two PC : Windows Server 2012 x64 and Windows 10 x64.

    ...
    [NULL @ 000000000034a900] SEI type 5 size 408 truncated at 160
    [segment @ 000000000034e780] stream:0 start_pts_time:47640.5 pts:4289549528 pts_time:47661.7 dts:4289549528 dts_time:47661.7 -> pts:4289549528 pts_time:47661.7 dts:4289549528 dts_time:47661.7
    [NULL @ 000000000034a900] SEI type 5 size 408 truncated at 160
    [segment @ 000000000034e780] stream:0 start_pts_time:47640.5 pts:4289553131 pts_time:47661.7 dts:4289553131 dts_time:47661.7 -> pts:4289553131 pts_time:47661.7 dts:4289553131 dts_time:47661.7
    [NULL @ 000000000034a900] SEI type 5 size 408 truncated at 160
    [segment @ 000000000034e780] stream:0 start_pts_time:47640.5 pts:4289556734 pts_time:47661.7 dts:4289556734 dts_time:47661.7 -> pts:4289556734 pts_time:47661.7 dts:4289556734 dts_time:47661.7
    [NULL @ 000000000034a900] SEI type 5 size 336 truncated at 160
    [segment @ 000000000034e780] Non-monotonous DTS in output stream 0:0; previous: 4289535114, current: -5428580; changing to 4289535115. This may result in incorrect timestamps in the output file.
    [segment @ 000000000034e780] stream:0 start_pts_time:47640.5 pts:4289556735 pts_time:47661.7 dts:4289556735 dts_time:47661.7 -> pts:4289556735 pts_time:47661.7 dts:4289556735 dts_time:47661.7
    [NULL @ 000000000034a900] SEI type 5 size 408 truncated at 160
    [segment @ 000000000034e780] Non-monotonous DTS in output stream 0:0; previous: 4289535115, current: -5424977; changing to 4289535116. This may result in incorrect timestamps in the output file.
    [segment @ 000000000034e780] stream:0 start_pts_time:47640.5 pts:4289556736 pts_time:47661.7 dts:4289556736 dts_time:47661.7 -> pts:4289556736 pts_time:47661.7 dts:4289556736 dts_time:47661.7
    [NULL @ 000000000034a900] SEI type 5 size 408 truncated at 160
    [segment @ 000000000034e780] Non-monotonous DTS in output stream 0:0; previous: 4289535116, current: -5421374; changing to 4289535117. This may result in incorrect timestamps in the output file.
    [segment @ 000000000034e780] stream:0 start_pts_time:47640.5 pts:4289556737 pts_time:47661.7 dts:4289556737 dts_time:47661.7 -> pts:4289556737 pts_time:47661.7 dts:4289556737 dts_time:47661.7
    frame=1190370 fps= 25 q=-1.0 size=N/A time=13:14:21.50 bitrate=N/A speed=   1x    
    [NULL @ 000000000034a900] SEI type 5 size 408 truncated at 160
    [segment @ 000000000034e780] Non-monotonous DTS in output stream 0:0; previous: 4289535117, current: -5417772; changing to 4289535118. This may result in incorrect timestamps in the output file.
    ...

    The full debug log with this problem is here (25 Mb, zipped) :
    https://drive.google.com/file/d/0B1LIS8G55R7-OGY4QkdkQ0J1cVE/view?usp=sharing
    I can’t record video infinitely. Every 13 hours I have broken recording. I tried to record with "copytb 1", "genpts" but it doesn’t help. I don’t think it is the network problem, because I tried to record the same rtsp stream by two instances of ffmpeg with time shift of start : they stuck separately at separate time.
    Does anyone know how to solve it ? I can provide you with another information you need about this.

    Update : If I wait 13 hours after bug appeared, the recording starts again.