Recherche avancée

Médias (0)

Mot : - Tags -/performance

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (57)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (7736)

  • ffmpeg screen blending mode makes transparent png pink

    28 janvier 2014, par gilad s

    I have a sequence of PNG files with transparency - I'd like screen-blend them on top of a video

    ffmpeg -i video.mp4 -i "Images/%03d.png" -filter_complex "blend=all_mode='screen':all_opacity=0.7" output.mp4

    the images are indeed merged on top of the video but with a pink overlay ?!

    I also tried to add "-vcodec png" and "-vcodec libx264" and to try a .mov video but got the same result.

    ffmpeg version N-58061-g5231eec Copyright (c) 2000-2013 the FFmpeg developers
    built on Nov 14 2013 05:35:15 with gcc 4.6 (Debian 4.6.3-1)
    configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-
    static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static'
    --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-
    ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-
    cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-
    libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --
    enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --
    enable-libvpx
    libavutil      52. 52.100 / 52. 52.100
    libavcodec     55. 41.101 / 55. 41.101
    libavformat    55. 21.100 / 55. 21.100
    libavdevice    55.  5.100 / 55.  5.100
    libavfilter     3. 91.100 /  3. 91.100
    libswscale      2.  5.101 /  2.  5.101
    libswresample   0. 17.104 /  0. 17.104
    libpostproc    52.  3.100 / 52.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
    Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.2.100
    Duration: 00:00:18.88, start: 0.000000, bitrate: 595 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x480, 461 kb/s,  
    25.16 fps, 25 tbr, 1000k tbn, 2000k tbc (default)
    Metadata:
    handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
    (default)
    Metadata:
    handler_name    : SoundHandler
    Input #1, image2, from 'Dots2/%03d.png':
    Duration: 00:00:10.00, start: 0.000000, bitrate: N/A
    Stream #1:0: Video: png, rgba, 640x480, 25 fps, 25 tbr, 25 tbn, 25 tbc
    [libx264 @ 0x292ad60] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
    [libx264 @ 0x292ad60] profile High, level 3.0
    [libx264 @ 0x292ad60] 264 - core 129 r2230 1cffe9f - H.264/MPEG-4 AVC codec - Copyleft
    2003-2012 - 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=6 lookahead_threads=1 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, mp4, to 'output_Dots.mp4':
    Metadata:
    major_brand     : isom
    Stream #0:1(und): Audio: aac (libvo_aacenc) ([64][0][0][0] / 0x0040), 44100 Hz, stereo,
    s16, 128 kb/s (default)
    Metadata:
    handler_name    : SoundHandler
    Stream mapping:
    Stream #0:0 (h264) -> blend:top (graph 0)
    Stream #1:0 (png) -> blend:bottom (graph 0)
    blend (graph 0) -> Stream #0:0 (libx264)
    Stream #0:1 -> #0:1 (aac -> libvo_aacenc)
    Press [q] to stop, [?] for help
    frame=  475 fps=105 q=-1.0 Lsize=    1660kB time=00:00:18.92 bitrate= 718.7kbits/s    
    video:1349kB audio:295kB subtitle:0 global headers:0kB muxing overhead 0.993598%
    [libx264 @ 0x292ad60] frame I:2     Avg QP:19.79  size: 33501
    [libx264 @ 0x292ad60] frame P:176   Avg QP:23.16  size:  5651
    [libx264 @ 0x292ad60] frame B:297   Avg QP:27.76  size:  1074
    [libx264 @ 0x292ad60] consecutive B-frames: 13.3%  8.8%  3.8% 74.1%
    [libx264 @ 0x292ad60] mb I  I16..4:  1.7% 69.9% 28.4%
    [libx264 @ 0x292ad60] mb P  I16..4:  3.3%  8.1%  1.0%  P16..4: 47.1% 14.7%  7.5%  0.0%  
    0.0%    skip:18.3%
    [libx264 @ 0x292ad60] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8: 44.4%  2.6%  0.8%  
    direct: 0.9%  skip:51.2%  L0:46.0% L1:50.5% BI: 3.5%
    [libx264 @ 0x292ad60] 8x8 transform intra:64.9% inter:74.0%
    [libx264 @ 0x292ad60] coded y,uvDC,uvAC intra: 47.0% 50.4% 13.1% inter: 11.8% 12.7% 0.5%
    [libx264 @ 0x292ad60] i16 v,h,dc,p: 50% 18%  9% 23%
    [libx264 @ 0x292ad60] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 15% 22%  4%  6%  6%  7%  5%  5%
    [libx264 @ 0x292ad60] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 19% 19%  4%  6%  6%  6%  4%  4%
    [libx264 @ 0x292ad60] i8c dc,h,v,p: 55% 17% 25%  2%
    [libx264 @ 0x292ad60] Weighted P-Frames: Y:29.0% UV:23.9%
    [libx264 @ 0x292ad60] ref P L0: 63.5% 20.9% 13.2%  2.3%  0.2%
    [libx264 @ 0x292ad60] ref B L0: 96.8%  2.8%  0.4%
    [libx264 @ 0x292ad60] ref B L1: 98.4%  1.6%
    [libx264 @ 0x292ad60] kb/s:581.24
  • FFMPEG does not add images to audio

    20 février 2018, par Googlebot

    I want to create a slideshow with a background music by ffmpeg, and use the command

    ffmpeg -f concat -safe 0 -i map.txt -i audio.flac -vsync vfr -pix_fmt yuv420p -strict -2 video.mp4

    and map.txt is like

    file '1.jpg'
    duration 15
    file '2.jpg'
    duration 60

    The result is a video with the audio and blank background. If I run the above command without audio as

    ffmpeg -f concat -safe 0 -i map.txt -pix_fmt yuv420p -strict -2 video.mp4

    a perfect video of the images (the intended slideshow) is generated (but obviously without audio).

    I reckon the problem is related to synchronising the audio and images.

    This is the terminal output for the first command

    ffmpeg -f concat -safe 0 -i map.txt -i audio.flac -vsync vfr -pix_fmt yuv420p -strict -2 video.mp4
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     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
    [mjpeg @ 0x1cc8d40] Changeing bps to 8
    Input #0, concat, from 'map.txt':
     Duration: 00:05:48.00, start: 0.000000, bitrate: 0 kb/s
       Stream #0:0: Video: mjpeg, gray(bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    Input #1, flac, from 'audio.flac':
     Metadata:
       TITLE           : Speak to Me
       ARTIST          : Creator
       ALBUM           : Acoustic Hits
       track           : 14
       GENRE           : Pop
       DATE            : 2011
     Duration: 00:03:31.02, start: 0.000000, bitrate: 1026 kb/s
       Stream #1:0: Audio: flac, 44100 Hz, stereo, s16
    [libx264 @ 0x1ccdf80] using SAR=1/1
    [libx264 @ 0x1ccdf80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x1ccdf80] profile High, level 4.0
    [libx264 @ 0x1ccdf80] 264 - core 148 r2643 5c65704 - 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, mp4, to 'video.mp4':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp (16 bit), 128 kb/s
       Metadata:
         encoder         : Lavc56.60.100 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
     Stream #1:0 -> #0:1 (flac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [mjpeg @ 0x7fe688001ba0] Changeing bps to 8
    frame=    2 fps=0.7 q=-1.0 Lsize=    3593kB time=00:03:31.02 bitrate= 139.5kbits/s    
    video:147kB audio:3410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.036417%
    [libx264 @ 0x1ccdf80] frame I:1     Avg QP: 2.55  size: 33683
    [libx264 @ 0x1ccdf80] frame P:1     Avg QP:19.33  size:116022
    [libx264 @ 0x1ccdf80] mb I  I16..4: 89.7%  1.1%  9.3%
    [libx264 @ 0x1ccdf80] mb P  I16..4:  0.9%  1.8% 30.1%  P16..4:  1.4%  1.5%  0.9%  0.0%  0.0%    skip:63.4%
    [libx264 @ 0x1ccdf80] 8x8 transform intra:2.1% inter:15.2%
    [libx264 @ 0x1ccdf80] coded y,uvDC,uvAC intra: 19.7% 0.0% 0.0% inter: 2.8% 0.0% 0.0%
    [libx264 @ 0x1ccdf80] i16 v,h,dc,p: 97%  2%  2%  0%
    [libx264 @ 0x1ccdf80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 12% 39%  1%  1%  2%  1%  2%  4%
    [libx264 @ 0x1ccdf80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 16% 16%  3%  4%  6%  5%  5%  4%
    [libx264 @ 0x1ccdf80] i8c dc,h,v,p: 100%  0%  0%  0%
    [libx264 @ 0x1ccdf80] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1ccdf80] kb/s:20.65

    UPDATE (following the comment suggestion)

    ffmpeg -f concat -safe 0 -i map.txt -i audio.flac -vsync vfr -r 5 -pix_fmt yuv420p -strict -2 video.mp4
    ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
     configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
     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
    [mjpeg @ 0x1fe9d80] Changeing bps to 8
    Input #0, concat, from 'map.txt':
     Duration: 00:02:28.00, start: 0.000000, bitrate: 0 kb/s
       Stream #0:0: Video: mjpeg, gray(bt470bg/unknown/unknown), 1920x1080 [SAR 72:72 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
    Input #1, flac, from 'audio.flac':
     Metadata:
       TITLE           : Speak to Me
       ARTIST          : Creator
       ALBUM           : Acoustic Hits
       track           : 14
       GENRE           : Pop
       DATE            : 2011
     Duration: 00:03:31.02, start: 0.000000, bitrate: 1026 kb/s
       Stream #1:0: Audio: flac, 44100 Hz, stereo, s16
    [libx264 @ 0x1feefc0] using SAR=1/1
    [libx264 @ 0x1feefc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x1feefc0] profile High, level 4.0
    [libx264 @ 0x1feefc0] 264 - core 148 r2643 5c65704 - 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=5 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, mp4, to 'video.mp4':
     Metadata:
       encoder         : Lavf56.40.101
       Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5 fps, 10240 tbn, 5 tbc
       Metadata:
         encoder         : Lavc56.60.100 libx264
       Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo, fltp (16 bit), 128 kb/s
       Metadata:
         encoder         : Lavc56.60.100 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
     Stream #1:0 -> #0:1 (flac (native) -> aac (native))
    Press [q] to stop, [?] for help
    [mjpeg @ 0x7f74cc001ba0] Changeing bps to 8
    frame=    2 fps=0.7 q=-1.0 Lsize=    3593kB time=00:03:31.02 bitrate= 139.5kbits/s    
    video:147kB audio:3410kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.036417%
    [libx264 @ 0x1feefc0] frame I:1     Avg QP: 2.55  size: 33683
    [libx264 @ 0x1feefc0] frame P:1     Avg QP:19.33  size:116022
    [libx264 @ 0x1feefc0] mb I  I16..4: 89.7%  1.1%  9.3%
    [libx264 @ 0x1feefc0] mb P  I16..4:  0.9%  1.8% 30.1%  P16..4:  1.4%  1.5%  0.9%  0.0%  0.0%    skip:63.4%
    [libx264 @ 0x1feefc0] 8x8 transform intra:2.1% inter:15.2%
    [libx264 @ 0x1feefc0] coded y,uvDC,uvAC intra: 19.7% 0.0% 0.0% inter: 2.8% 0.0% 0.0%
    [libx264 @ 0x1feefc0] i16 v,h,dc,p: 97%  2%  2%  0%
    [libx264 @ 0x1feefc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 12% 39%  1%  1%  2%  1%  2%  4%
    [libx264 @ 0x1feefc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 16% 16%  3%  4%  6%  5%  5%  4%
    [libx264 @ 0x1feefc0] i8c dc,h,v,p: 100%  0%  0%  0%
    [libx264 @ 0x1feefc0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1feefc0] kb/s:20.65
  • FFmpeg audio doesnt work in converted videos but in pc it does

    28 octobre 2013, par Dirk Swarz

    I use :

    if($ext == "avi" && $convert_avi == true)
                       {
                           $convert_source = _VIDEOS_DIR_PATH.$new_name;
                           $conv_name = substr(md5($file['name'].rand(1,888)), 2, 10).".mp4";
                           $converted_file  = _VIDEOS_DIR_PATH.$conv_name;
                           $ffmpeg_command = 'ffmpeg -i '.$convert_source.' -acodec libmp3lame -vcodec libx264 -s 1280x720 -ar 44100 -async 44100 -r 29.970 -ac 2 -qscale 5 '.$converted_file;
                           echo exec($ffmpeg_command);
                           $sql = "UPDATE pm_temp SET url = '".$conv_name."' WHERE url = '".$new_name."' LIMIT 1";
                           $result = @mysql_query($sql);
                           unlink($convert_source);    
                       }

    This code to convert avi to mp4
    ffmpeg concole output :

    root@1tb:~# ffmpeg -i sample.avi -acodec libmp3lame -vcodec libx264 -s 1280x720 -ar 44100 -async 44100 -r 29.970 -ac 2 -qscale 5 goodsample.mp4
    ffmpeg version 0.7.15, Copyright (c) 2000-2013 the FFmpeg developers
     built on Feb 22 2013 07:18:58 with gcc 4.4.5
     configuration: --enable-libdc1394 --prefix=/usr --extra-cflags='-Wall -g ' --cc='ccache cc' --enable-shared --enable-libmp3lame --enable-gpl --enable-libvorbis --enable-pthreads --enable-libfaac --enable-libxvid --enable-postproc --enable-x11grab --enable-libgsm --enable-libtheora --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libspeex --enable-nonfree --disable-stripping --enable-avfilter --enable-libdirac --disable-decoder=libdirac --enable-libfreetype --enable-libschroedinger --disable-encoder=libschroedinger -                                                                                                                                                             s
     libavutil    50. 43. 0 / 50. 43. 0
     libavcodec   52.123. 0 / 52.123. 0
     libavformat  52.111. 0 / 52.111. 0
     libavdevice  52.  5. 0 / 52.  5. 0
     libavfilter   1. 80. 0 /  1. 80. 0
     libswscale    0. 14. 1 /  0. 14. 1
     libpostproc  51.  2. 0 / 51.  2. 0
    [mp3 @ 0x191d4100] Header missing
    [mpeg4 @ 0x191d1dc0] Invalid and inefficient vfw-avi packed B frames detected
    Input #0, avi, from 'sample.avi':
     Metadata:
       encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
     Duration: 00:01:01.81, start: 0.000000, bitrate: 1194 kb/s
       Stream #0.0: Video: mpeg4, yuv420p, 640x352 [PAR 1:1 DAR 20:11], 23.98 tbr,
       Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
    [buffer @ 0x191d1c80] w:640 h:352 pixfmt:yuv420p tb:1/1000000 sar:1/1 sws_param:
    [scale @ 0x191d6880] w:640 h:352 fmt:yuv420p -> w:1280 h:720 fmt:yuv420p flags:0
    [libx264 @ 0x191ce5a0] Default settings detected, using medium profile
    [libx264 @ 0x191ce5a0] using SAR=45/44
    [libx264 @ 0x191ce5a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle S
    [libx264 @ 0x191ce5a0] profile High, level 3.1
    [libx264 @ 0x191ce5a0] 264 - core 118 - H.264/MPEG-4 AVC codec - Copyleft 2003-2                                                                                                                                                             6 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_off                                                                                                                                                             1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_l
    Output #0, mp4, to 'goodsample.mp4':
     Metadata:
       encoder         : Lavf52.111.0
       Stream #0.0: Video: libx264, yuv420p, 1280x720 [PAR 45:44 DAR 20:11], q=2-31
       Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
    Stream mapping:
     Stream #0.0 -> #0.0
     Stream #0.1 -> #0.1
    Press [q] to stop, [?] for help
    [mp3 @ 0x191d4100] Header missing
    Error while decoding stream #0.1
    [mpeg4 @ 0x191d1dc0] Invalid and inefficient vfw-avi packed B frames detected
    [mp3 @ 0x191d4100] incomplete frame 9467kB time=00:01:00.32 bitrate=1285.5kbits/
    Error while decoding stream #0.1
    frame= 1852 fps= 20 q=29.0 Lsize=    9652kB time=00:01:01.72 bitrate=1280.9kbits
    video:9121kB audio:483kB global headers:0kB muxing overhead 0.499688%
    frame I:11    Avg QP:16.78  size: 51456
    [libx264 @ 0x191ce5a0] frame P:784   Avg QP:20.81  size:  8954
    [libx264 @ 0x191ce5a0] frame B:1057  Avg QP:26.06  size:  1659
    [libx264 @ 0x191ce5a0] consecutive B-frames: 22.0%  3.1%  7.5% 67.4%
    [libx264 @ 0x191ce5a0] mb I  I16..4: 31.1% 59.8%  9.1%
    [libx264 @ 0x191ce5a0] mb P  I16..4:  1.8%  2.6%  0.2%  P16..4: 24.3%  7.0%  4.0
    [libx264 @ 0x191ce5a0] mb B  I16..4:  0.1%  0.1%  0.0%  B16..8: 22.7%  0.8%  0.2
    [libx264 @ 0x191ce5a0] 8x8 transform intra:57.0% inter:72.6%
    [libx264 @ 0x191ce5a0] coded y,uvDC,uvAC intra: 44.4% 33.3% 10.3% inter: 7.6% 5.
    [libx264 @ 0x191ce5a0] i16 v,h,dc,p: 68% 14%  8% 10%
    [libx264 @ 0x191ce5a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 14% 27%  5%  7%  7%  6
    [libx264 @ 0x191ce5a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 14% 14%  6% 10%  9%  7
    [libx264 @ 0x191ce5a0] i8c dc,h,v,p: 67% 13% 17%  3%
    [libx264 @ 0x191ce5a0] Weighted P-Frames: Y:1.9% UV:0.4%
    [libx264 @ 0x191ce5a0] ref P L0: 62.2% 12.8% 10.3% 14.5%  0.2%
    [libx264 @ 0x191ce5a0] ref B L0: 88.1%  5.5%  6.4%
    [libx264 @ 0x191ce5a0] ref B L1: 95.7%  4.3%
    [libx264 @ 0x191ce5a0] kb/s:1209.03

    I know there is couple errors tough, but i dont know hot to fix it. Also i would be very thankfull if someone can help reduce video size but is not main problem video weights as original avi but sill.