Recherche avancée

Médias (91)

Autres articles (95)

  • 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

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

Sur d’autres sites (5090)

  • ffmpeg video conversion from webm to mp4 is adding lag to the video

    21 janvier 2016, par Hemant Kumar

    Hi I am trying to convert video from .webm extension to .mp4 extension and it is adding lags to the video, also not showing me the full video.

    I am using following video conversion command.

    "ffmpeg -i {$input} -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ".fix_video_orientation($input)."' -threads 0 -ab 64k -s {$resolution}  -movflags faststart -metadata:s:v:0 rotate=0 {$output}";

    "fix_video_orientation" function is given below. It rotate the resulting video if video while recording is rotated to certain angle.

    function fix_video_orientation($input){

    $return= ", transpose=1 ";

    $dd= exec("ffprobe -of json -show_streams  {$input}   | grep rotate");

    if(!empty($dd)){

    $dd=explode(":",$dd);
    $rotate=str_replace(",","",str_replace('"',"",$dd[1]));

    if($rotate=="90")return $return;

    else if ($rotate=="180") return ", transpose=2,transpose=2 ";

    else if($rotate == "270") return ", transpose=2 ";
    }

    Currently above script is supporting "flv","avi","mp4","mkv","mpg","wmv","asf","webm","mov","3gp","3gpp" extensions, also the script is supporting the resulting .mp4 file to play on all browsers and devices.

    For query :

    ffmpeg -i <server path="path">/g9zyy2qg54qp1l5spo2-mergedFile.webm -strict -2 -vcodec libx264 -preset slow -vb 500k -maxrate 500k -bufsize 1000k -vf 'scale=-1:480 ' -threads 0 -ab 64k -s 640x480 -movflags faststart -metadata:s:v:0 rotate=0 <server path="path">/g9zyy2qg54qp1l5spo2-mergedFile5.mp4
    </server></server>

    Console output :

    ffmpeg version 2.2.5 Copyright (c) 2000-2014 the FFmpeg developers
     built on Aug  1 2014 09:24:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libtheora --enable-libx264 --enable-libvpx --enable-libmp3lame
     libavutil      52. 66.100 / 52. 66.100
     libavcodec     55. 52.102 / 55. 52.102
     libavformat    55. 33.100 / 55. 33.100
     libavdevice    55. 10.100 / 55. 10.100
     libavfilter     4.  2.100 /  4.  2.100
     libswscale      2.  5.102 /  2.  5.102
     libswresample   0. 18.100 /  0. 18.100
     libpostproc    52.  3.100 / 52.  3.100
    Input #0, matroska,webm, from '<server path="path">/g9zyy2qg54qp1l5spo2-mergedFile.webm':
     Metadata:
       encoder         : Lavf55.33.100
     Duration: 00:00:13.53, start: 0.000000, bitrate: 387 kb/s
       Stream #0:0: Audio: vorbis, 44100 Hz, stereo, fltp
       Stream #0:1: Video: vp8, yuv420p, 320x240, SAR 1:1 DAR 4:3, 1k fps, 1k tbr, 1k tbn, 1k tbc (default)
    [libx264 @ 0x38fcf40] using SAR=1/1
    [libx264 @ 0x38fcf40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x38fcf40] profile High, level 5.2
    [libx264 @ 0x38fcf40] 264 - core 142 r2453 ea0ca51 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x3:0x113 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=cbr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=500 vbv_bufsize=1000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to '<server path="path">/g9zyy2qg54qp1l5spo2-mergedFile5.mp4':
     Metadata:
       encoder         : Lavf55.33.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 500 kb/s, 16k tbn, 1k tbc (default)
       Metadata:
         rotate          : 0
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp, 64 kb/s
    Stream mapping:
     Stream #0:1 -> #0:0 (vp8 -> libx264)
     Stream #0:0 -> #0:1 (vorbis -> aac)
    Press [q] to stop, [?] for help
    frame=  358 fps=0.0 q=39.0 size=      27kB time=00:00:00.74 bitrate= 295.4kbits/frame=  723 fps=691 q=41.0 size=      57kB time=00:00:01.39 bitrate= 335.1kbits/frame= 1410 fps=706 q=45.0 size=     108kB time=00:00:01.74 bitrate= 509.0kbits/frame= 1777 fps=710 q=45.0 size=     134kB time=00:00:02.13 bitrate= 512.7kbits/frame= 2126 fps=707 q=45.0 size=     164kB time=00:00:02.50 bitrate= 535.0kbits/frame= 2497 fps=710 q=45.0 size=     191kB time=00:00:02.85 bitrate= 547.8kbits/frame= 2869 fps=708 q=45.0 size=     225kB time=00:00:03.20 bitrate= 575.7kbits/frame= 3226 fps=707 q=45.0 size=     250kB time=00:00:03.59 bitrate= 568.2kbits/frame= 3586 fps=709 q=46.0 size=     282kB time=00:00:03.94 bitrate= 585.7kbits/frame= 3956 fps=710 q=45.0 size=     305kB time=00:00:04.59 bitrate= 543.8kbits/frame= 4358 fps=710 q=46.0 size=     340kB time=00:00:04.71 bitrate= 591.1kbits/frame= 4751 fps=712 q=45.0 size=     362kB time=00:00:05.10 bitrate= 581.3kbits/frame= 5133 fps=713 q=45.0 size=     393kB time=00:00:05.50 bitrate= 584.9kbits/frame= 5510 fps=715 q=45.0 size=     416kB time=00:00:05.89 bitrate= 578.5kbits/frame= 5880 fps=715 q=45.0 size=     448kB time=00:00:06.24 bitrate= 587.6kbits/frame= 6250 fps=715 q=45.0 size=     472kB time=00:00:06.64 bitrate= 582.3kbits/frame= 6651 fps=715 q=45.0 size=     501kB time=00:00:06.98 bitrate= 587.1kbits/frame= 7012 fps=713 q=50.0 size=     524kB time=00:00:07.68 bitrate= 559.0kbits/frame= 7396 fps=714 q=45.0 size=     551kB time=00:00:07.75 bitrate= 582.5kbits/frame= 7771 fps=714 q=47.0 size=     575kB time=00:00:08.10 bitrate= 581.1kbits/frame= 8139 fps=714 q=50.0 size=     604kB time=00:00:08.52 bitrate= 580.8kbits/frame= 8509 fps=715 q=46.0 size=     628kB time=00:00:08.87 bitrate= 580.4kbits/frame= 8885 fps=715 q=46.0 size=     655kB time=00:00:09.19 bitrate= 583.1kbits/frame= 9233 fps=714 q=46.0 size=     677kB time=00:00:09.54 bitrate= 581.2kbits/frame= 9603 fps=714 q=46.0 size=     706kB time=00:00:09.96 bitrate= 580.6kbits/frame= 9975 fps=714 q=46.0 size=     728kB time=00:00:10.65 bitrate= 559.8kbits/frame=10376 fps=715 q=46.0 size=     757kB time=00:00:10.75 bitrate= 577.0kbits/frame=10730 fps=714 q=46.0 size=     780kB time=00:00:11.07 bitrate= 577.1kbits/frame=11090 fps=713 q=47.0 size=     808kB time=00:00:11.42 bitrate= 579.7kbits/frame=11447 fps=713 q=46.0 size=     832kB time=00:00:11.79 bitrate= 578.0kbits/frame=11802 fps=712 q=48.0 size=     858kB time=00:00:12.14 bitrate= 578.5kbits/frame=12181 fps=713 q=46.0 size=     880kB time=00:00:12.51 bitrate= 576.3kbits/frame=12563 fps=713 q=46.0 size=     908kB time=00:00:12.95 bitrate= 573.9kbits/frame=13527 fps=715 q=46.0 size=     960kB time=-577014:-32:-22.-77 bitrate=N/A [mp4 @ 0x3912e00] Starting second pass: moving the moov atom to the beginning of the file
    frame=13527 fps=713 q=-1.0 Lsize=    1139kB time=00:00:13.52 bitrate= 689.8kbits/s dup=13036 drop=0    
    video:863kB audio:107kB subtitle:0 data:0 global headers:0kB muxing overhead 17.479137%
    [libx264 @ 0x38fcf40] frame I:55    Avg QP:33.13  size:  6072
    [libx264 @ 0x38fcf40] frame P:3409  Avg QP:32.90  size:    95
    [libx264 @ 0x38fcf40] frame B:10063 Avg QP:39.74  size:    22
    [libx264 @ 0x38fcf40] consecutive B-frames:  0.8%  0.0%  0.0% 99.2%
    [libx264 @ 0x38fcf40] mb I  I16..4: 25.7% 69.5%  4.8%
    [libx264 @ 0x38fcf40] mb P  I16..4:  0.2%  0.2%  0.0%  P16..4:  1.4%  0.1%  0.4%  0.0%  0.0%    skip:97.7%
    [libx264 @ 0x38fcf40] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.3%  0.0%  0.0%  direct: 0.0%  skip:99.7%  L0:41.0% L1:58.9% BI: 0.0%
    [libx264 @ 0x38fcf40] 8x8 transform intra:67.9% inter:94.6%
    [libx264 @ 0x38fcf40] direct mvs  spatial:86.6% temporal:13.4%
    [libx264 @ 0x38fcf40] coded y,uvDC,uvAC intra: 36.1% 36.9% 1.7% inter: 0.1% 0.1% 0.0%
    [libx264 @ 0x38fcf40] i16 v,h,dc,p: 32% 27%  9% 31%
    [libx264 @ 0x38fcf40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 13% 18%  7%  7%  8%  8%  9%  8%
    [libx264 @ 0x38fcf40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 16%  7%  7%  9% 10%  9%  7%  8%
    [libx264 @ 0x38fcf40] i8c dc,h,v,p: 73% 14%  9%  4%
    [libx264 @ 0x38fcf40] Weighted P-Frames: Y:0.6% UV:0.0%
    [libx264 @ 0x38fcf40] ref P L0: 77.5% 12.2%  9.1%  0.9%  0.2%  0.0%
    [libx264 @ 0x38fcf40] ref B L0: 86.6% 13.2%  0.2%  0.0%
    [libx264 @ 0x38fcf40] ref B L1: 89.8% 10.2%
    [libx264 @ 0x38fcf40] kb/s:522.05
    </server></server>
  • close the running application in vb.net from background

    22 janvier 2016, par TOM

    i want to stop the running (ffmpeg) process from background . i use the

     process.kill()  

    i wrote the code . but in this process the output file is getting corrupted.

    Dim pProcess() As Process = Process.GetProcesses
     For Each p As Process In pProcess
      If p.ProcessName = "ffmpeg" Then
       p.WaitForExit(1000)
       p.Kill()      
       p.Close()
     End If
    Next

    is there any other method to terminate the process without file being corrupt

    thanks

  • Android how to increase ffmpeg mp4 perfromance ?

    4 janvier 2013, par testCoder

    I have detected that function avcodec_decode_audio3 works slow with mp4 format, here my code cycle for decoding audio :

    while (av_read_frame(av_format_context, &amp;packet) >= 0 &amp;&amp; is_play == 1) {
           if (av_codec_context->codec_type == AVMEDIA_TYPE_AUDIO
                   &amp;&amp; is_play == 1) {
               int out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
               int size = packet.size;
               int n;
               int dataLength = size;
               int decoded = 0;
               while (size > 0) {

                   //start measure time
                   gettimeofday(&amp;tvBegin, NULL);

                   int len = avcodec_decode_audio3(av_codec_context,
                           (int16_t *) pAudioBuffer, &amp;out_size, &amp;packet);

                   //stop measure time
                   gettimeofday(&amp;tvEnd, NULL);
                   timeval_subtract(&amp;tvDiff, &amp;tvEnd, &amp;tvBegin);

                   LOGI("%d", tvDiff.tv_usec / 1000);
                   LOGI("len=&#39;%d&#39;", len);
                   LOGI("out_size=&#39;%d&#39;", out_size);

                   if (len &lt; 0) {
                       break;
                       return 1;
                   }
                   if (out_size > 0) {



                       jbyte *bytes = (*env)->GetByteArrayElements(env, array,
                               NULL);
                       memcpy(bytes, (int16_t *) pAudioBuffer, out_size);
                       (*env)->ReleaseByteArrayElements(env, array, bytes, 0);
                       (*env)->CallVoidMethod(env, obj, play, array, out_size,
                               is_play);

                   }
                   size -= len;
               }

           }
           if (packet.data)
               av_free_packet(&amp;packet);

       }

    But with other formats like flac and mp3 it works fine. avcodec_decode_audio3 take about 1-2 milisecounds for decoding mp3 frame with out_size = 4608 but with the same frame size in mp4 decoding take about 6-7 millisecounds. I got my build script from here.

    Does it normal behavior ? Is any way to increase performance of decoding mp4 ?