Recherche avancée

Médias (1)

Mot : - Tags -/remix

Autres articles (68)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

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

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (8632)

  • Realtime ffmpeg shell output PHP

    26 septembre 2013, par matthew johnston

    Alright, I've been fighting this problem for a few days. Works fine on my local windows machine but, can't seem to get it to work on my CentOS server. My script grabs the duration of the video being converted and also grabs the current seconds it has processed inside of ffmpeg. However, it is only grabbing the "input file" of the ffmpeg output and stopping there. I have tried using both pipes (STDOUT [1] & STDERR [2]) for some reason ffmpeg likes to output on the STDERR pipe. Weird.

    $filename = "somefilename.tmp";
    $descriptor = array(
       0 => array("pipe", "r"),
       1 => array("pipe", "w"),
       2 => array("pipe", "w")
    );

    $ffmpeg = "ffmpeg -i /var/www/spotloader/videos/flipped/tmp/".$file."_comb.ts -vcodec mpeg2video -acodec pcm_s16le -pix_fmt yuv422p -vtag xdvb -b:v 13000k -r 30000/1001 /var/www/spotloader/videos/flipped/tmp/".$file.".mov";

    //open the process
    $process = proc_open($ffmpeg, $descriptor, $pipes, NULL, $_ENV);

    //if the process opened
    if ( is_resource( $process ) == true )
    {
       //get process status
       $procStatus = proc_get_status( $process );

       //if its running, let node know
       if ( $procStatus['running'] )
       {
           //nodejs socket, nothing wrong here
           $this->_sendSocket('converting', array('filename' => str_replace('.tmp', '', $file)));
       }

       //while the process is running
       while( $procStatus['running'] === true )
       {
           //there is output in the pipe
           if ( !feof( $pipes[1] ) )
           {
               //get the output
               $data = fgets($pipes[1], 128);
               //match the outputs duration and save it.
               if(preg_match('/Duration:\s([0-9]{2}:[0-9]{2}:[0-9]{2})/', $data, $matches))
               {
                   static $duration;
                   $duration = $this->_convertToSeconds($matches[1]);
               }

               //match the outputs current encoding time
               if(preg_match('/time=([0-9]{2}:[0-9]{2}:[0-9]{2})/', $data, $matches))
               {
                   //convert to seconds works fine, so it is not included.
                   $curTime = $this->_convertToSeconds($matches[1]);
                   //nodejs socket, nothing wrong here
                   $this->_sendSocket('update', array('percent' => round( ($curTime / $duration) * 100), 'filename' => str_replace('.tmp', '', $file)));
               }
           }

           //update process status
           $procStatus = proc_get_status( $process );
       }

       //nodejs socket, nothing wrong here
       $this->_sendSocket('converted', array('percent' => 100, 'filename' => str_replace('.tmp', '', $file)));
    }

    FFMPEG output I receive using the PHP code above

    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
    built on May 10 2013 15:14:14 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
    configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
    --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl
    --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads
    --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv
    --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut
    --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
    --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis
    --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid
    --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
    -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC'
    --disable-stripping
    libavutil      52. 18.100 / 52. 18.100
    libavcodec     54. 92.100 / 54. 92.100
    libavformat    54. 63.104 / 54. 63.104
    libavdevice    54.  3.103 / 54.  3.103
    libavfilter     3. 42.103 /  3. 42.103
    libswscale      2.  2.100 /  2.  2.100
    libswresample   0. 17.102 /  0. 17.102
    libpostproc    52.  2.100 / 52.  2.100
    [mpegts @ 0x243c620] max_analyze_duration 5000000 reached at 5016000 microseconds
    Input #0, mpegts, from '/var/www/spotloader/videos/flipped/tmp/Wildlife10.tmp_comb.ts':
    Duration: 00:00:02.02, start: 1.389978, bitrate: 227018 kb/s
    Program 1
    Metadata:
     service_name    : Service01
     service_provider: FFmpeg
    Stream #0:0[0x100]: Video: mpeg2video (4:2:2) ([2][0][0][0] / 0x0002), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 1 channels (FL+FR), s16p, 128 kb/s

    FFMPEG output I'm expecting the "time=00:00:00" towards the end is what I need to capture in realtime. This is taken by running the FFMPEG command directly in the shell.

    ffmpeg version 1.2.1 Copyright (c) 2000-2013 the FFmpeg developers
    built on May 10 2013 15:14:14 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4)
    configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64
    --mandir=/usr/share/man --enable-shared --enable-runtime-cpudetect --enable-gpl
    --enable-version3 --enable-postproc --enable-avfilter --enable-pthreads
    --enable-x11grab --enable-vdpau --disable-avisynth --enable-frei0r --enable-libopencv
    --enable-libdc1394 --enable-libgsm --enable-libmp3lame --enable-libnut
    --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
    --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis
    --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid
    --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
    -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC'
    --disable-stripping
     libavutil      52. 18.100 / 52. 18.100
     libavcodec     54. 92.100 / 54. 92.100
     libavformat    54. 63.104 / 54. 63.104
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 42.103 /  3. 42.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  2.100 / 52.  2.100
    [mpegts @ 0x10c9620] max_analyze_duration 5000000 reached at 5016000 microseconds
    Input #0, mpegts, from '/var/www/spotloader/videos/flipped/tmp/Wildlife10.tmp_comb.ts':
     Duration: 00:00:02.02, start: 1.389978, bitrate: 227018 kb/s
     Program 1
       Metadata:
         service_name    : Service01
         service_provider: FFmpeg
       Stream #0:0[0x100]: Video: mpeg2video (4:2:2) ([2][0][0][0] / 0x0002), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
       Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, 1 channels (FL+FR), s16p, 128 kb/s
    Channel layout 'stereo' with 2 channels does not match specified number of channels 1: ignoring specified channel layout
    Output #0, mov, to '/var/www/spotloader/videos/flipped/tmp/Wildlife10.tmp.mov':
     Metadata:
       encoder         : Lavf54.63.104
       Stream #0:0: Video: mpeg2video (xdvb / 0x62766478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 13000 kb/s, 30k tbn, 29.97 tbc
       Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (mpeg2video -> mpeg2video)
     Stream #0:1 -> #0:1 (mp2 -> pcm_s16le)
    Press [q] to stop, [?] for help
    Input stream #0:1 frame changed from rate:48000 fmt:s16p ch:1 chl:1 channels (FL+FR) to rate:48000 fmt:s16p ch:2 chl:stereo
    Input stream #0:1 frame changed from rate:48000 fmt:s16p ch:2 chl:stereo to rate:48000 fmt:s16p ch:1 chl:mono
    Input stream #0:1 frame changed from rate:48000 fmt:s16p ch:1 chl:mono to rate:48000 fmt:s16p ch:2 chl:stereo
    Input stream #0:0 frame changed from size:1920x1080 fmt:yuv422p to size:1280x720 fmt:yuv422p0
    Input stream #0:1 frame changed from rate:48000 fmt:s16p ch:2 chl:stereo to rate:44100 fmt:s16p ch:2 chl:stereo
    frame=  741 fps= 52 q=2.6 size=   43866kB time=00:00:24.65 bitrate=14573.5kbits/s dup=5 drop=0

    Any ideas ? What needs changing from the switch from Windows to CentOS ?

    EDIT :
    I got this to work using popen instead. It also reduced my code. If anyone else does have a solution go ahead and post it. Thanks !

  • Encoding a readable movie by QuickTime using FFMPEG

    3 octobre 2014, par itamarb

    I’m trying to encode an image sequence using the following command :

    ffmpeg.exe -i %d.png -f mp4 -vcodec h264 test.mp4

    However, QuickTime failed to open this file or sometimes play a black movie, while this movie plays great in VLC player. Any suggestions how to make it play well in QuickTime ?

    Here is the output :

    ffmpeg.exe -i %d.png -f mp4 -vcodec libx264 13.mp4
    ffmpeg version N-49044-g89afa63 Copyright (c) 2000-2013 the FFmpeg developers
     built on Jan 19 2013 20:36:06 with gcc 4.7.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libg
    sm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --e
    nable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --e
    nable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --en
    able-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable
    -libxavs --enable-libxvid --enable-zlib --enable-filter=frei0r
     libavutil      52. 15.100 / 52. 15.100
     libavcodec     54. 89.100 / 54. 89.100
     libavformat    54. 61.101 / 54. 61.101
     libavdevice    54.  3.102 / 54.  3.102
     libavfilter     3. 32.101 /  3. 32.101
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  2.100 / 52.  2.100
    [image2 @ 0221b940] max_analyze_duration 5000000 reached at 5000000 microseconds

    Input #0, image2, from '%d.png':
     Duration: 00:01:19.36, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: png, rgb24, 639x480, 25 fps, 25 tbr, 25 tbn, 25 tbc
    [libx264 @ 0221edc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE
    4.2 AVX
    [libx264 @ 0221edc0] profile High 4:4:4 Predictive, level 3.0, 4:4:4 8-bit
    [libx264 @ 0221edc0] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Cop
    yleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deb
    lock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 m
    e_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chro
    ma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 in
    terlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b
    _bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecu
    t=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0
    qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '13.mp4':
     Metadata:
       encoder         : Lavf54.61.101
       Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 639x480, q=-1--1
    , 12800 tbn, 25 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (png -> libx264)
    Press [q] to stop, [?] for help
    frame=   76 fps=0.0 q=28.0 size=       3kB time=00:00:00.96 bitrate=  22.3kbits/
    frame=  156 fps=155 q=28.0 size=       7kB time=00:00:04.16 bitrate=  14.7kbits/
    frame=  219 fps=145 q=28.0 size=      12kB time=00:00:06.68 bitrate=  14.1kbits/
    frame=  283 fps=141 q=28.0 size=      16kB time=00:00:09.24 bitrate=  14.2kbits/
    frame=  352 fps=140 q=28.0 size=      25kB time=00:00:12.00 bitrate=  17.4kbits/
  • How to grab voice and video in ffmpeg/mplayer/mencoder ? [closed]

    4 février 2013, par Kill Kill

    My target is to grab voice and video via webcamera.
    There are three ways to do :

    1.ffmpeg

    ffmpeg -f oss -i /dev/dsp -f video4linux2 -r 25 -b 500000 -s 320x240 -i /dev/video0 out.mpg  
    WARNING: gnome-keyring:: couldn't connect to: /home/debian/.cache/keyring-4Hzs4r/pkcs11: No such file or directory  
    ffmpeg version 0.8.5-6:0.8.5-1, Copyright (c) 2000-2012 the Libav developers  
    built on Jan 13 2013 16:02:15 with gcc 4.7.2  
    *** THIS PROGRAM IS DEPRECATED ***  
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.  
    [oss @ 0x9d63c60] /dev/dsp: No such file or directory  
    /dev/dsp: Input/output error

    in my computer how to revise it ?

    2.mplayer :

    mplayer tv:// -tv driver=v4l2:input=0:width=640:height=480:fps=25 -vo x11  

    I can see the video when the command run, how can I save the output into a file and grab the voice ?

    3.mencoder :

    mencoder tv:// -tv driver=v4l2:width=800:height=600:device=/dev/video0:fps=30:outfmt=yuy2:forceaudio:alsa:adevice=hw.2,0 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1800 -ffourcc xvid -oac mp3lame -lameopts cbr=128 -o output.avi  

    MEncoder svn r34540 (Debian), built with gcc-4.7 (C) 2000-2012 MPlayer Team  
    success: format: 9 data: 0x0 - 0x0  
    TV file format detected.  
    Selected driver: v4l2  
    name: Video 4 Linux 2 input  
    author: Martin Olschewski  
    comment: first try, more to come  
    v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.  
    Selected device: PC Camera  
    Capabilities: video capture read/write streaming  
    supported norms:  
    inputs: 0 = zc3xx;  
    Current input: 0  
    Current format: unknown (0x4745504a)  
    tv.c: norm_from_string(pal): Bogus norm parameter, setting default.  
    v4l2: ioctl enum norm failed: Inappropriate ioctl for device  
    Error: Cannot set norm!  
    Selected input hasn't got a tuner!  
    ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card  
    Error opening audio: No such file or directory  
    ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card  
    Error opening audio: No such file or directory  
    ALSA lib pcm_hw.c:1401:(_snd_pcm_hw_open) Invalid value for card  
    Error opening audio: No such file or directory  
    v4l2: ioctl set mute failed: Invalid argument  
    v4l2: 0 frames successfully processed, 0 frames dropped.  
    ============ Sorry, this file format is not recognized/supported =============  
    === If this file is an AVI, ASF or MPEG stream, please contact the author! ===  
    Cannot open demuxer.  

    Exiting...