Recherche avancée

Médias (91)

Autres articles (56)

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (5514)

  • ffmpeg : corrupt audio in usage of avfoundation

    3 janvier 2016, par Andy

    I am trying to record my desktop screen (MacBook Pro (Retina, 15-inch, Mid 2014), OSX 10.10.5) with audio. First, I have to find the devices for recording, video:1 and audio:0 in my case.

    User@User-MacBook-Pro:~/test$ ffmpeg -hide_banner -f avfoundation -list_devices true -i ""
    [AVFoundation input device @ 0x7ff19a422320] AVFoundation video devices:
    [AVFoundation input device @ 0x7ff19a422320] [0] FaceTime HD Camera
    [AVFoundation input device @ 0x7ff19a422320] [1] Capture screen 0
    [AVFoundation input device @ 0x7ff4b9c22320] [2] Capture screen 1
    [AVFoundation input device @ 0x7ff19a422320] AVFoundation audio devices:
    [AVFoundation input device @ 0x7ff19a422320] [0] Soundflower (2ch)
    [AVFoundation input device @ 0x7ff19a422320] [1] Built-in Microphone
    [AVFoundation input device @ 0x7ff19a422320] [2] Soundflower (64ch)
    : Input/output error

    Then I run to capture the screen :

    ffmpeg -f avfoundation -i "1:0" out_desktop.mkv

    and the audio of the output stutters terribly.
    But if I use the second external screen (which is connect via HDMI) :

    ffmpeg -f avfoundation -i "2:0" out_ext.mkv

    Then I have no audio problems.

    So, what could be the cause of this behaviour ? Somehow the video device "Capture screen 0" causes the audio stutter.

    Here are the full outputs of the two commands above, Screen 0 :

    User@User-MacBook-Pro:~/test$ ffmpeg -f avfoundation -i "1:0" out.mkv
    ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
     built with Apple LLVM version 7.0.2 (clang-700.1.81)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    [avfoundation @ 0x7fca1200da00] Selected pixel format (yuv420p) is not supported by the input device.
    [avfoundation @ 0x7fca1200da00] Supported pixel formats:
    [avfoundation @ 0x7fca1200da00]   uyvy422
    [avfoundation @ 0x7fca1200da00]   yuyv422
    [avfoundation @ 0x7fca1200da00]   nv12
    [avfoundation @ 0x7fca1200da00]   0rgb
    [avfoundation @ 0x7fca1200da00]   bgr0
    [avfoundation @ 0x7fca1200da00] Overriding selected pixel format to use uyvy422 instead.
    [avfoundation @ 0x7fca1200da00] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, avfoundation, from '1:0':
     Duration: N/A, start: 11734.092500, bitrate: 2822 kb/s
       Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 2880x1800, 1000k tbr, 1000k tbn, 1000k tbc
       Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
    File 'out.mkv' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x7fca1390e000] MB rate (20340000000) > level limit (2073600)
    [libx264 @ 0x7fca1390e000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x7fca1390e000] profile High 4:2:2, level 5.2, 4:2:2 8-bit
    [libx264 @ 0x7fca1390e000] 264 - core 148 r2601 a0cd7d3 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 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=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=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 scenecut=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, matroska, to 'out.mkv':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 2880x1800, q=-1--1, 1000k fps, 1k tbn, 1000k tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 44100 Hz, stereo, fltp
       Metadata:
         encoder         : Lavc56.60.100 libvorbis
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (pcm_f32le (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    frame=  969 fps= 29 q=-1.0 Lsize=    6911kB time=00:00:34.80 bitrate=1626.8kbits/s    
    video:6475kB audio:396kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 0.591309%
    [libx264 @ 0x7fca1390e000] frame I:4     Avg QP:15.77  size:1461092
    [libx264 @ 0x7fca1390e000] frame P:246   Avg QP:16.00  size:  2608
    [libx264 @ 0x7fca1390e000] frame B:719   Avg QP:13.91  size:   200
    [libx264 @ 0x7fca1390e000] consecutive B-frames:  0.9%  0.4%  0.0% 98.7%
    [libx264 @ 0x7fca1390e000] mb I  I16..4: 11.6% 43.3% 45.2%
    [libx264 @ 0x7fca1390e000] mb P  I16..4:  0.0%  0.0%  0.1%  P16..4:  0.4%  0.0%  0.0%  0.0%  0.0%    skip:99.5%
    [libx264 @ 0x7fca1390e000] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:39.9% L1:60.0% BI: 0.1%
    [libx264 @ 0x7fca1390e000] 8x8 transform intra:41.6% inter:38.8%
    [libx264 @ 0x7fca1390e000] coded y,uvDC,uvAC intra: 76.9% 77.9% 75.5% inter: 0.0% 0.1% 0.0%
    [libx264 @ 0x7fca1390e000] i16 v,h,dc,p: 51% 34% 11%  4%
    [libx264 @ 0x7fca1390e000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 17% 19%  7%  4%  3%  8%  5% 16%
    [libx264 @ 0x7fca1390e000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 24% 10%  7%  6%  5%  8%  7% 12%
    [libx264 @ 0x7fca1390e000] i8c dc,h,v,p: 59% 14% 18%  9%
    [libx264 @ 0x7fca1390e000] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x7fca1390e000] ref P L0: 71.5%  3.4% 13.0% 12.1%
    [libx264 @ 0x7fca1390e000] ref B L0: 46.6% 52.3%  1.1%
    [libx264 @ 0x7fca1390e000] ref B L1: 95.1%  4.9%
    [libx264 @ 0x7fca1390e000] kb/s:1525.48

    and Screen 1 :

    User@User-MacBook-Pro:~/test$ ffmpeg -f avfoundation -i "2:0" out.mkv
    ffmpeg version 2.8.4 Copyright (c) 2000-2015 the FFmpeg developers
     built with Apple LLVM version 7.0.2 (clang-700.1.81)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.8.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 --enable-nonfree --enable-vda
     libavutil      54. 31.100 / 54. 31.100
     libavcodec     56. 60.100 / 56. 60.100
     libavformat    56. 40.101 / 56. 40.101
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 40.101 /  5. 40.101
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  2.101 /  1.  2.101
     libpostproc    53.  3.100 / 53.  3.100
    [avfoundation @ 0x7fc2e900da00] Selected pixel format (yuv420p) is not supported by the input device.
    [avfoundation @ 0x7fc2e900da00] Supported pixel formats:
    [avfoundation @ 0x7fc2e900da00]   uyvy422
    [avfoundation @ 0x7fc2e900da00]   yuyv422
    [avfoundation @ 0x7fc2e900da00]   nv12
    [avfoundation @ 0x7fc2e900da00]   0rgb
    [avfoundation @ 0x7fc2e900da00]   bgr0
    [avfoundation @ 0x7fc2e900da00] Overriding selected pixel format to use uyvy422 instead.
    [avfoundation @ 0x7fc2e900da00] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Input #0, avfoundation, from '2:0':
     Duration: N/A, start: 11809.126333, bitrate: 2822 kb/s
       Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 2560x1080, 1000k tbr, 1000k tbn, 1000k tbc
       Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
    File 'out.mkv' already exists. Overwrite ? [y/N] y
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x7fc2ea82ac00] MB rate (10880000000) > level limit (2073600)
    [libx264 @ 0x7fc2ea82ac00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x7fc2ea82ac00] profile High 4:2:2, level 5.2, 4:2:2 8-bit
    [libx264 @ 0x7fc2ea82ac00] 264 - core 148 r2601 a0cd7d3 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 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=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=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 scenecut=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, matroska, to 'out.mkv':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 2560x1080, q=-1--1, 1000k fps, 1k tbn, 1000k tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: vorbis (libvorbis) (oV[0][0] / 0x566F), 44100 Hz, stereo, fltp
       Metadata:
         encoder         : Lavc56.60.100 libvorbis
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
     Stream #0:1 -> #0:1 (pcm_f32le (native) -> vorbis (libvorbis))
    Press [q] to stop, [?] for help
    frame=  755 fps= 30 q=-1.0 Lsize=    1025kB time=00:00:26.65 bitrate= 315.1kbits/s    
    video:680kB audio:326kB subtitle:0kB other streams:0kB global headers:4kB muxing overhead: 2.003084%
    [libx264 @ 0x7fc2ea82ac00] frame I:4     Avg QP:13.22  size:145661
    [libx264 @ 0x7fc2ea82ac00] frame P:191   Avg QP:19.87  size:   250
    [libx264 @ 0x7fc2ea82ac00] frame B:560   Avg QP:28.31  size:   116
    [libx264 @ 0x7fc2ea82ac00] consecutive B-frames:  1.1%  0.0%  0.4% 98.5%
    [libx264 @ 0x7fc2ea82ac00] mb I  I16..4: 54.5% 29.2% 16.2%
    [libx264 @ 0x7fc2ea82ac00] mb P  I16..4:  0.2%  0.1%  0.0%  P16..4:  0.1%  0.0%  0.0%  0.0%  0.0%    skip:99.6%
    [libx264 @ 0x7fc2ea82ac00] 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:69.2% L1:30.8% BI: 0.0%
    [libx264 @ 0x7fc2ea82ac00] 8x8 transform intra:31.7% inter:13.1%
    [libx264 @ 0x7fc2ea82ac00] coded y,uvDC,uvAC intra: 10.9% 8.8% 8.5% inter: 0.0% 0.0% 0.0%
    [libx264 @ 0x7fc2ea82ac00] i16 v,h,dc,p: 69% 31%  0%  0%
    [libx264 @ 0x7fc2ea82ac00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27%  5% 67%  0%  0%  0%  0%  0%  0%
    [libx264 @ 0x7fc2ea82ac00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 38% 25% 14%  3%  3%  4%  5%  4%  5%
    [libx264 @ 0x7fc2ea82ac00] i8c dc,h,v,p: 92%  3%  4%  0%
    [libx264 @ 0x7fc2ea82ac00] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x7fc2ea82ac00] ref P L0: 76.3%  1.7% 16.8%  5.2%
    [libx264 @ 0x7fc2ea82ac00] ref B L0: 38.9% 56.9%  4.2%
    [libx264 @ 0x7fc2ea82ac00] ref B L1: 97.3%  2.7%
    [libx264 @ 0x7fc2ea82ac00] kb/s:208.84

    EDIT

    The main differences between the two (lengthy) outputs above via

    wdiff -n output1 output2 |colordiff

    is the resolution ([-2880x1800,-] {+2560x1080,+}) and the resulting MB rate ([-(20340000000)-] {+(10880000000)+}). So, what could increase the performance of ffmpeg ?

  • video after ffmpeg command conversion is not playing on windows

    10 décembre 2015, par Hemant Kumar

    I am stuck at a very weird and complex problem, hoping if anyone know the solution :

    I am converting user uploaded video using ffmpeg command on server and it was working fine as well. Today I found that if a video is recorded by a webcam from windows, is playing well in linux as well as on windows where as if user is creating a video by webcam from linux, is playing only on linux (any browser). On window it’s screen either show loading icon or black screen while audio is working fine.

    I am using following codec :

    ['-strict', '-2', '-preset slow', '-maxrate 500k', '-bufsize 1000k', vfOption, '-threads 0', '-ab 64k', '-movflags faststart','-vf scale=-1:480', '-metadata:s:v:0 rotate=0', '-vcodec libx264']

    I work on linux and using html5 player on my website. I am converting video in mp4 format.

    Input :

    ffmpeg -i /<server path="path">/stream_FE2AF05B-E630-1F7B-390B-37325B31B362.flv -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">/testing.mp4
    </server></server>

    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, flv, from '/<server path="path">/stream_FE2AF05B-E630-1F7B-390B-37325B31B362.flv':
     Metadata:
       canSeekToEnd    : true
     Duration: 00:00:04.04, start: 0.000000, bitrate: 636 kb/s
       Stream #0:0: Video: flv1, yuv420p, 640x480, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
    [libx264 @ 0x23c5340] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x23c5340] profile High, level 5.2
    [libx264 @ 0x23c5340] 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">/testing.mp4':
     Metadata:
       canSeekToEnd    : true
       encoder         : Lavf55.33.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=-1--1, 500 kb/s, 16k tbn, 1k tbc
       Metadata:
         rotate          : 0
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 64 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (flv -> libx264)
     Stream #0:1 -> #0:1 (nellymoser -> aac)
    Press [q] to stop, [?] for help
    [mp4 @ 0x23c0200] Starting second pass: moving the moov atom to the beginning of the file2 drop=0    
    frame= 4020 fps=706 q=-1.0 Lsize=     355kB time=00:00:04.08 bitrate= 712.0kbits/s dup=3931 drop=0    
    video:271kB audio:32kB subtitle:0 data:0 global headers:0kB muxing overhead 16.957901%
    [libx264 @ 0x23c5340] frame I:17    Avg QP:27.55  size:  7119
    [libx264 @ 0x23c5340] frame P:1013  Avg QP:25.37  size:    88
    [libx264 @ 0x23c5340] frame B:2990  Avg QP:27.32  size:    22
    [libx264 @ 0x23c5340] consecutive B-frames:  0.8%  0.0%  0.1% 99.1%
    [libx264 @ 0x23c5340] mb I  I16..4: 42.0% 55.1%  2.9%
    [libx264 @ 0x23c5340] mb P  I16..4:  0.3%  0.4%  0.0%  P16..4:  0.6%  0.1%  0.0%  0.0%  0.0%    skip:98.6%
    [libx264 @ 0x23c5340] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:35.7% L1:64.3% BI: 0.0%
    [libx264 @ 0x23c5340] 8x8 transform intra:55.0% inter:84.5%
    [libx264 @ 0x23c5340] direct mvs  spatial:87.6% temporal:12.4%
    [libx264 @ 0x23c5340] coded y,uvDC,uvAC intra: 33.4% 51.9% 0.7% inter: 0.0% 0.1% 0.0%
    [libx264 @ 0x23c5340] i16 v,h,dc,p: 26% 54% 15%  5%
    [libx264 @ 0x23c5340] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 16% 53%  3%  1%  2%  2%  3%  3%
    [libx264 @ 0x23c5340] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 20% 13% 14%  5%  7%  7% 11%  8%
    [libx264 @ 0x23c5340] i8c dc,h,v,p: 43% 31% 23%  3%
    [libx264 @ 0x23c5340] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x23c5340] ref P L0: 80.9%  9.0%  6.9%  2.6%  0.7%
    [libx264 @ 0x23c5340] ref B L0: 89.4%  8.6%  1.8%  0.2%
    [libx264 @ 0x23c5340] ref B L1: 91.0%  9.0%
    [libx264 @ 0x23c5340] kb/s:551.72
    </server></server>

    Outout from file recorded on window :

    Input :

    ffmpeg -i /<server path="path">/stream_window.flv -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">/testing_1.mp4
    </server></server>

    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, flv, from '/<server path="path">/stream_window.flv':
     Metadata:
       canSeekToEnd    : true
     Duration: 00:00:09.22, start: 0.000000, bitrate: 420 kb/s
       Stream #0:0: Video: flv1, yuv420p, 640x480, 1k tbr, 1k tbn, 1k tbc
       Stream #0:1: Audio: nellymoser, 44100 Hz, mono, flt
    [libx264 @ 0x1e09fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 0x1e09fc0] profile High, level 5.2
    [libx264 @ 0x1e09fc0] 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">/testing_1.mp4':
     Metadata:
       canSeekToEnd    : true
       encoder         : Lavf55.33.100
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x480, q=-1--1, 500 kb/s, 16k tbn, 1k tbc
       Metadata:
         rotate          : 0
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, mono, fltp, 64 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (flv -> libx264)
     Stream #0:1 -> #0:1 (nellymoser -> aac)
    Press [q] to stop, [?] for help
    [mp4 @ 0x1e06220] Starting second pass: moving the moov atom to the beginning of the file7 drop=0    
    frame= 8936 fps=703 q=-1.0 Lsize=     771kB time=00:00:09.26 bitrate= 681.5kbits/s dup=8907 drop=0    
    video:585kB audio:73kB subtitle:0 data:0 global headers:0kB muxing overhead 17.106213%
    [libx264 @ 0x1e09fc0] frame I:40    Avg QP:29.54  size:  7449
    [libx264 @ 0x1e09fc0] frame P:2248  Avg QP:30.88  size:    69
    [libx264 @ 0x1e09fc0] frame B:6648  Avg QP:39.17  size:    22
    [libx264 @ 0x1e09fc0] consecutive B-frames:  0.8%  0.0%  0.1% 99.1%
    [libx264 @ 0x1e09fc0] mb I  I16..4: 36.8% 60.7%  2.5%
    [libx264 @ 0x1e09fc0] mb P  I16..4:  0.2%  0.3%  0.0%  P16..4:  0.4%  0.0%  0.0%  0.0%  0.0%    skip:98.9%
    [libx264 @ 0x1e09fc0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:34.2% L1:65.8% BI: 0.0%
    [libx264 @ 0x1e09fc0] 8x8 transform intra:60.6% inter:87.6%
    [libx264 @ 0x1e09fc0] direct mvs  spatial:72.8% temporal:27.2%
    [libx264 @ 0x1e09fc0] coded y,uvDC,uvAC intra: 36.3% 62.8% 4.7% inter: 0.0% 0.0% 0.0%
    [libx264 @ 0x1e09fc0] i16 v,h,dc,p: 33% 46% 15%  7%
    [libx264 @ 0x1e09fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 46%  3%  1%  1%  1%  2%  4%
    [libx264 @ 0x1e09fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 17% 14%  9%  4%  4%  5%  5%  7%
    [libx264 @ 0x1e09fc0] i8c dc,h,v,p: 42% 31% 23%  4%
    [libx264 @ 0x1e09fc0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1e09fc0] ref P L0: 82.6%  9.9%  5.2%  1.7%  0.5%
    [libx264 @ 0x1e09fc0] ref B L0: 87.1% 11.0%  1.4%  0.4%
    [libx264 @ 0x1e09fc0] ref B L1: 90.3%  9.7%
    [libx264 @ 0x1e09fc0] kb/s:536.03
    </server></server>

    Can anyone figure what could be the problem ?

    @LordNeckbeard : Please find the command and its output above. Thanks

  • FFMPEG Converted Video Not Working In HTML5

    27 novembre 2015, par Suprabhat Biswal

    Converted Avi to Mp4 using FFMPEG, Converted video not working in html
    5

    I have a section in my web page where user can upload any types of videos of any format , currently only restricted to .mp4 and .avi. After successfull upload i have displayed the same video to the user. I have bind the path in HTML5 video so that the user can view the content he/she has uploded. Video with extension .mp4 no doubt are working properly as HTML5 support them. Tricky part is it don’t support Avi files. Now here what the problem has arised. In order to display avi videos i have used FFMPEG to convert videos with extension .avi to .mp4. With lots of googling and reading forum, i have succesfully converted avi videos to mp4 . Here’s what i have used :-

    1. ffmpeg -i input.avi -acodec libfaac -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

    2. ffmpeg -i input.avi -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 output.mp4

    Above two are working perfectly, they have succesfully converted the video. But when i run them on browser in HTML5 and in new tab (Flash Player Plugin Installed), HTML5 doesn’t play it and flash player return an error message "Video can’t be played because the file is corrupt". But when i played them on KMplayer and in Window media player they are running perfectly.

    I have been to various threads in stackoverflow related to convert avi to mp4 and here i found following in one of the forum. where one of user has accepted this a correct answer but it ain’t worked out for me.

    1. ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4

    Above argument returned me following error "File for preset ’slow’ not found".

    Following my futher searches i came across this thread ffmpeg convert mov file to mp4 for HTML5 video tag IE9. Here following argument worked perfectly and it able to convert video in such way that it is playble on browser.

    1. ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p output.mp4.

    Problem i faced here was video is converted to 420p reso which quality is noty upto mark. Smaller resolution videos are been enlarged and seems pixelated

    Thus, i had to finally put up a question. I will be very obliged if someone can give a solution for above problem. I need to convert an avi video to mp4 supported by HTML5 video tag. It should able to play it on browser and during conversion of video it should maintain original audio and video quality plus resolution.

    Thanks

    My C# Code :

           public void Create(string input, string output, string parametri, string ThumbnailPhysicalPath, int ConvertType)
           {
               ffmpeg = new Process();

               if (ConvertType == Convert.ToInt32(ConversionType.Thumbnail))
                   ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vframes 1 \"" + output + "\"";
               else if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
                   ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -c:v libx264 -b:a 128k -vcodec mpeg4 -b:v 1200k -flags +aic+mv4 \"" + output + "\"";
                   //ffmpeg.StartInfo.Arguments = " -i \"" + input + "\" -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_aacenc -b:a 128k -pix_fmt yuv420p \"" + output + "\"";
               ffmpeg.StartInfo.FileName = ThumbnailPhysicalPath + @"ffmpeg.exe";
               ffmpeg.StartInfo.UseShellExecute = false;
               ffmpeg.StartInfo.RedirectStandardOutput = true;
               ffmpeg.StartInfo.RedirectStandardError = true;
               ffmpeg.StartInfo.CreateNoWindow = true;
               try
               {
                   ffmpeg.Start();
                   ffmpeg.WaitForExit();
                   string error = ffmpeg.StandardError.ReadToEnd();
               }
               catch (Exception Ex)
               {
                   Common.WriteLog("Exception occurred during conversion. Error Message :- " + Ex.Message + "\n Input Parameter :- " + input+ "\n Output Paramenter :- "+ output);
               }
               finally
               {
                   ffmpeg.Close();
                   if (ConvertType == Convert.ToInt32(ConversionType.AviToMp4))
                       UpdateConvertedVideoDetails(input,output);
               }
           }

    Command Prompt FFMPEG Output :-

    Sample 3 Result :-

    D:\Client\WebSite\Converter_Tools>ffmpeg -y -i sample.avi -b:v 1500k -vcodec libx264 -vpre slow -vpre baseline -g 30 sample.mp4
    ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
    ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
    enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
    le-zlib
     libavutil      54. 19.100 / 54. 19.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 23.105 / 56. 23.105
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.101 /  5. 11.101
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    [avi @ 037c8480] non-interleaved AVI
    Guessed Channel Layout for  Input Stream #0.1 : mono
    Input #0, avi, from 'sample.avi':
     Duration: 00:00:34.00, start: 0.000000, bitrate: 1433 kb/s
       Stream #0:0: Video: cinepak (cvid / 0x64697663), rgb24, 320x240, 15 fps, 15 tbr, 15 tbn, 15 tbc
       Stream #0:1: Audio: pcm_u8 ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, u8, 176 kb/s
    File for preset 'slow' not found

    Sample 4 Result :-

    D:\Client\WebSite\Converter_Tools>ffmpeg -y -i input.avi -vcodec libx264 -vprofile high -preset slow -b:v 500k -maxrate 500k -bufsize 1000k -vf scale=-1:480 -threads 0 -acodec libvo_
    aacenc -b:a 128k -pix_fmt yuv420p output.mp4
    ffmpeg version N-70239-g111d79a Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libblu
    ray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrw
    b --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
    enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enab
    le-zlib
     libavutil      54. 19.100 / 54. 19.100
     libavcodec     56. 26.100 / 56. 26.100
     libavformat    56. 23.105 / 56. 23.105
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 11.101 /  5. 11.101
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, avi, from 'input.avi':
     Duration: 00:00:03.93, start: 0.000000, bitrate: 3255 kb/s
       Stream #0:0: Video: msrle ([1][0][0][0] / 0x0001), pal8, 300x250, 3301 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
    [libx264 @ 002ec860] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 002ec860] profile High, level 2.2
    [libx264 @ 002ec860] 264 - core 144 r2525 40bb568 - 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 subm
    e=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=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 i
    nterlaced=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=15 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 'output.mp4':
     Metadata:
       encoder         : Lavf56.23.105
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 576x480, q=-1--1, 500 kb/s, 15 fps, 15360 tbn, 15 tbc
       Metadata:
         encoder         : Lavc56.26.100 libx264
    Stream mapping:
     Stream #0:0 -> #0:0 (msrle (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    frame=   59 fps= 30 q=-1.0 Lsize=     229kB time=00:00:03.80 bitrate= 493.5kbits/s
    video:227kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.637976%
    [libx264 @ 002ec860] frame I:3     Avg QP:26.53  size: 10657
    [libx264 @ 002ec860] frame P:25    Avg QP:30.49  size:  5608
    [libx264 @ 002ec860] frame B:31    Avg QP:32.26  size:  1935
    [libx264 @ 002ec860] consecutive B-frames: 22.0% 16.9% 20.3% 40.7%
    [libx264 @ 002ec860] mb I  I16..4: 16.7% 69.0% 14.4%
    [libx264 @ 002ec860] mb P  I16..4: 11.1% 29.9%  3.8%  P16..4: 21.3%  6.8%  2.6%  0.0%  0.0%    skip:24.6%
    [libx264 @ 002ec860] mb B  I16..4:  1.7%  3.0%  0.3%  B16..8: 29.7%  5.6%  0.8%  direct: 2.1%  skip:56.8%  L0:50.5% L1:45.6% BI: 3.9%
    [libx264 @ 002ec860] 8x8 transform intra:66.5% inter:79.4%
    [libx264 @ 002ec860] direct mvs  spatial:93.5% temporal:6.5%
    [libx264 @ 002ec860] coded y,uvDC,uvAC intra: 40.3% 48.8% 25.7% inter: 12.4% 8.4% 1.4%
    [libx264 @ 002ec860] i16 v,h,dc,p: 19% 59%  6% 17%
    [libx264 @ 002ec860] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 10% 25% 16%  7%  8%  6% 11%  7% 10%
    [libx264 @ 002ec860] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 21%  9%  7%  9%  8% 10%  7% 10%
    [libx264 @ 002ec860] i8c dc,h,v,p: 41% 33% 13% 13%
    [libx264 @ 002ec860] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 002ec860] ref P L0: 67.6%  8.1%  9.6%  5.4%  6.6%  2.8%
    [libx264 @ 002ec860] ref B L0: 84.6% 10.5%  3.9%  1.0%
    [libx264 @ 002ec860] ref B L1: 95.9%  4.1%
    [libx264 @ 002ec860] kb/s:472.20