Recherche avancée

Médias (91)

Autres articles (76)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (9336)

  • ffmpeg command for faster encoding at a decent bitrate with smaller file size

    14 septembre 2016, par Blair Holmes

    I’m currently using an implementation of ffmpeg on my android app. I’m allowing users to take short videos within my app and then when they upload them to the server, I’m crunching them down with ffmpeg to decrease file size so they’re not passing huge amounts of data over the wire.

    the problem is, it’s taking forever to encode the videos on the android device. These videos usually aren’t longer than 45 seconds and can take 20 minutes to encode. I’ve done some playing around with different switches / parameters on the ffmpeg command line and I now have it at a more comfortable time, but the file sizes are significantly bigger. I’m just not sure what codec I should use (fastest encoding but with decent quality output), how ffmpeg handles changing size (aspect ratio) in terms of speed of encoding etc.

    Here are the two commands I’ve been using. This first one outputs the file size / quality that I want, but it just takes way too long to encode, not to mention it makes my device get really hot while it’s encoding for so long :

    ffmpeg -i input.mp4 -b:v 1024k -c:a copy -vf scale=960:540 output.mp4

    I’ve tweaked the bitrate some on that as well as changed the scale to a smaller size, but I don’t want to have to make the videos really small (in terms of scale) to accomplish a faster encoding. this second command goes a lot faster but makes the file size significantly bigger :

    ffmpeg -i input.mp4 -vcodec libx264 -preset fast -c:a copy -s 960x540 output.mp4

    I’d like to find a happy medium (smaller file size but faster encoding) keeping the video scale size close to the original. ffmpeg just has so many different parameters / switches that it’s difficult to wrap my head around what I should be doing.

    EDIT : adding ffmpeg output.

    ffmpeg -i input.mp4 -vcodec libx264 -crf 30 -preset veryfast -c:a copy -s 960x540 output.mp4

       09-13 11:06:28.330 10881-10881/someapp D/home: ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
    09-13 11:06:28.330 10881-10881/someapp D/home:   built with gcc 4.8 (GCC)
    09-13 11:06:28.331 10881-10881/someapp D/home:   configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
    09-13 11:06:28.331 10881-10881/someapp D/home:   libavutil      55. 17.103 / 55. 17.103
    09-13 11:06:28.331 10881-10881/someapp D/home:   libavcodec     57. 24.102 / 57. 24.102
    09-13 11:06:28.331 10881-10881/someapp D/home:   libavformat    57. 25.100 / 57. 25.100
    09-13 11:06:28.331 10881-10881/someapp D/home:   libavdevice    57.  0.101 / 57.  0.101
    09-13 11:06:28.331 10881-10881/someapp D/home:   libavfilter     6. 31.100 /  6. 31.100
    09-13 11:06:28.331 10881-10881/someapp D/home:   libswscale      4.  0.100 /  4.  0.100
    09-13 11:06:28.331 10881-10881/someapp D/home:   libswresample   2.  0.101 /  2.  0.101
    09-13 11:06:28.331 10881-10881/someapp D/home:   libpostproc    54.  0.100 / 54.  0.100
    09-13 11:06:28.430 10881-10881/someapp D/home: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/ExpeditionSpot/Videos/20160913110411.mp4':
    09-13 11:06:28.430 10881-10881/someapp D/home:   Metadata:
    09-13 11:06:28.430 10881-10881/someapp D/home:     major_brand     : mp42
    09-13 11:06:28.430 10881-10881/someapp D/home:     minor_version   : 0
    09-13 11:06:28.430 10881-10881/someapp D/home:     compatible_brands: isommp42
    09-13 11:06:28.430 10881-10881/someapp D/home:     creation_time   : 2016-09-13 17:04:33
    09-13 11:06:28.430 10881-10881/someapp D/home:     com.android.version: 6.0.1
    09-13 11:06:28.430 10881-10881/someapp D/home:   Duration: 00:00:19.41, start: 0.000000, bitrate: 20222 kb/s
    09-13 11:06:28.430 10881-10881/someapp D/home:     Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 19963 kb/s, SAR 1:1 DAR 16:9, 30.03 fps, 30 tbr, 90k tbn, 180k tbc (default)
    09-13 11:06:28.430 10881-10881/someapp D/home:     Metadata:
    09-13 11:06:28.430 10881-10881/someapp D/home:       creation_time   : 2016-09-13 17:04:33
    09-13 11:06:28.430 10881-10881/someapp D/home:       handler_name    : VideoHandle
    09-13 11:06:28.431 10881-10881/someapp D/home:     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    09-13 11:06:28.431 10881-10881/someapp D/home:     Metadata:
    09-13 11:06:28.431 10881-10881/someapp D/home:       creation_time   : 2016-09-13 17:04:33
    09-13 11:06:28.431 10881-10881/someapp D/home:       handler_name    : SoundHandle
    09-13 11:06:28.448 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] using SAR=1/1
    09-13 11:06:28.448 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] using cpu capabilities: none!
    09-13 11:06:28.516 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] profile High, level 3.1
    09-13 11:06:28.516 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 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=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf mbtree=1 crf=27.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    09-13 11:06:28.532 10881-10881/someapp D/home: Output #0, mp4, to '/storage/emulated/0/ExpeditionSpot/.tmp/small-20160913110411.mp4':
    09-13 11:06:28.532 10881-10881/someapp D/home:   Metadata:
    09-13 11:06:28.532 10881-10881/someapp D/home:     major_brand     : mp42
    09-13 11:06:28.533 10881-10881/someapp D/home:     minor_version   : 0
    09-13 11:06:28.533 10881-10881/someapp D/home:     compatible_brands: isommp42
    09-13 11:06:28.533 10881-10881/someapp D/home:     com.android.version: 6.0.1
    09-13 11:06:28.533 10881-10881/someapp D/home:     encoder         : Lavf57.25.100
    09-13 11:06:28.533 10881-10881/someapp D/home:     Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 960x540 [SAR 1:1 DAR 16:9], q=-1--1, 30 fps, 15360 tbn, 30 tbc (default)
    09-13 11:06:28.533 10881-10881/someapp D/home:     Metadata:
    09-13 11:06:28.533 10881-10881/someapp D/home:       creation_time   : 2016-09-13 17:04:33
    09-13 11:06:28.533 10881-10881/someapp D/home:       handler_name    : VideoHandle
    09-13 11:06:28.533 10881-10881/someapp D/home:       encoder         : Lavc57.24.102 libx264
    09-13 11:06:28.533 10881-10881/someapp D/home:     Side data:
    09-13 11:06:28.533 10881-10881/someapp D/home:       unknown side data type 10 (24 bytes)
    09-13 11:06:28.533 10881-10881/someapp D/home:     Stream #0:1(eng): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 96 kb/s (default)
    09-13 11:06:28.533 10881-10881/someapp D/home:     Metadata:
    09-13 11:06:28.533 10881-10881/someapp D/home:       creation_time   : 2016-09-13 17:04:33
    09-13 11:06:28.533 10881-10881/someapp D/home:       handler_name    : SoundHandle
    09-13 11:06:28.533 10881-10881/someapp D/home: Stream mapping:
    09-13 11:06:28.533 10881-10881/someapp D/home:   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
    09-13 11:06:28.533 10881-10881/someapp D/home:   Stream #0:1 -> #0:1 (copy)
    09-13 11:06:28.533 10881-10881/someapp D/home: Press [q] to stop, [?] for help
    09-13 11:06:29.102 10881-10881/someapp D/home: frame=    7 fps=0.0 q=0.0 size=       0kB time=00:00:01.04 bitrate=   0.4kbits/s speed=2.08x    
    09-13 11:06:29.699 10881-10881/someapp D/home: frame=   16 fps= 15 q=0.0 size=       0kB time=00:00:01.04 bitrate=   0.4kbits/s speed=0.998x    
    ....
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] frame I:3     Avg QP:26.83  size: 21896
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] frame P:279   Avg QP:28.76  size:  5859
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] frame B:296   Avg QP:29.93  size:   863
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] consecutive B-frames: 18.3% 32.2% 23.9% 25.6%
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] mb I  I16..4: 16.9% 54.2% 28.9%
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] mb P  I16..4:  7.7%  9.1%  0.4%  P16..4: 27.5% 11.1%  4.0%  0.0%  0.0%    skip:40.1%
    09-13 11:07:12.674 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] mb B  I16..4:  0.8%  0.6%  0.0%  B16..8: 10.9%  2.4%  0.1%  direct: 1.8%  skip:83.5%  L0:35.8% L1:54.2% BI:10.0%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] 8x8 transform intra:52.0% inter:41.3%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] coded y,uvDC,uvAC intra: 28.9% 26.0% 2.1% inter: 6.4% 5.0% 0.0%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i16 v,h,dc,p: 57% 20% 17%  6%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 23% 34%  1%  2%  1%  3%  2%  2%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 21% 17%  2%  7%  4%  6%  4%  4%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] i8c dc,h,v,p: 59% 16% 23%  2%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] Weighted P-Frames: Y:16.8% UV:4.7%
    09-13 11:07:12.675 10881-10881/someapp D/home: [libx264 @ 0xf71c4400] kb/s:812.09
  • Use opencv to encode into flv, playable by flash player

    13 février 2012, par Hemang Shah

    I've compiled ffmpeg with libx264 using configure options given at 1.

    This results in the following codecs being available in ffmpeg :

    $ ffmpeg -codecs | grep "264\|flv"
    ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers
    built on Feb 10 2012 13:54:15 with gcc 4.6.1
    configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
    libavutil      51. 34.101 / 51. 34.101
    libavcodec     53. 60.100 / 53. 60.100
    libavformat    53. 31.100 / 53. 31.100
    libavdevice    53.  4.100 / 53.  4.100
    libavfilter     2. 60.100 /  2. 60.100
    libswscale      2.  1.100 /  2.  1.100
    libswresample   0.  6.100 /  0.  6.100
    libpostproc    52.  0.100 / 52.  0.100
    DEVSD  flv             Flash Video (FLV) / Sorenson Spark / Sorenson H.263
    D V D  h264            H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    D V D  h264_vdpau      H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)
    EV    libx264         libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    EV    libx264rgb      libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB

    After this, I compiled opencv. Here is partial cmake result :

    --   Video I/O:
    --     DC1394 1.x:                 NO
    --     DC1394 2.x:                 NO
    --     FFMPEG:                     YES
    --       codec:                    YES
    --       format:                   YES
    --       util:                     YES
    --       swscale:                  YES
    --       gentoo-style:             YES
    --     GStreamer:                  YES
    --     UniCap:                     NO
    --     PvAPI:                      NO
    --     V4L/V4L2:                   /1
    --     Xine:                       NO

    Now, using opencv's VideoWriter, I tried to encode into flv with the following FOURCC codes :
    FLV1, X264

    While the FLV1 results in a video file not playable by flash player, but playabe by vlc ; X264 produces no results at all.
    Here is the console output for X264, resulting in a 0 byte file.

    Output #0, flv, to 'd.flv' :
    Stream #0.0 : Video : [0][0][0][0] / 0x0000, yuv420p, 320x240, q=2-31, 4915 kb/s, 90k tbn, 24 tbc

    Do you see anything amiss or incorrect ?
    thanks,

  • FFMPEG wmv conversion to flv

    25 novembre 2012, par Brandon Grossutti

    anyone using ffmpeg

    I have a fairly simple wmv exported by a user from movie maker with standard output and want to convert to .flv using

    C :>ffmpeg -i "E :\Jab Core 4 Recounters.wmv" -vcodec flv "C :\Net Projects\SVN\IntegratedAlgorithmics\src\MediaAdmin\MediaAdmin\bin\Debug\Movies\Jab Core 4 Recounters.flv" -ar 44100

    the output / error i receive is

    FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
     configuration: --enable-gpl --enable-postproc --enable-swscale --enable-avfilt
    er --enable-avfilter-lavf --enable-pthreads --enable-avisynth --enable-libfaac -
    -enable-libfaad --enable-libmp3lame --enable-libspeex --enable-libtheora --enabl
    e-libvorbis --enable-libxvid --enable-libx264 --enable-memalign-hack
     libavutil     49.15. 0 / 49.15. 0
     libavcodec    52.20. 0 / 52.20. 0
     libavformat   52.31. 0 / 52.31. 0
     libavdevice   52. 1. 0 / 52. 1. 0
     libavfilter    0. 4. 0 /  0. 4. 0
     libswscale     0. 7. 1 /  0. 7. 1
     libpostproc   51. 2. 0 / 51. 2. 0
     built on Mar 16 2009 16:09:18, gcc: 4.2.4 [Sherpya]
    [wmv3 @ 0x1c0d490]Extra data: 8 bits left, value: 0

    Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000
    /1) -> 30.00 (30/1)
    Input #0, asf, from 'E:\Jab Core 4 Recounters.wmv':
     Duration: 00:01:55.99, start: 5.000000, bitrate: 813 kb/s
       Stream #0.0: Audio: wmav2, 48000 Hz, stereo, s16, 192 kb/s
       Stream #0.1: Video: wmv3, yuv420p, 640x480, 586 kb/s, 30 tbr, 1k tbn, 1k tbc

    Output #0, flv, to 'C:\Net Projects\SVN\IntegratedAlgorithmics\src\MediaAdmin\Me
    diaAdmin\bin\Debug\Movies\Jab Core 4 Recounters.flv':
       Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 200 kb/s, 90k tbn, 30 tbc

       Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, s16, 64 kb/s
    Stream mapping:
     Stream #0.1 -> #0.0
     Stream #0.0 -> #0.1
    [wmv3 @ 0x1c0d490]Extra data: 8 bits left, value: 0
    [libmp3lame @ 0x1c0d8d0]flv does not support that sample rate, choose from (4410
    0, 22050, 11025).
    Could not write header for output file #0 (incorrect codec parameters ?)

    i added th -ar switch when i got the error the first time

    the codec info i have on the file is as follows

    General
    Complete name                    : E:\Jab Core 4 Recounters.wmv
    Format                           : Windows Media
    File size                        : 11.3 MiB
    Duration                         : 2mn 0s
    Overall bit rate mode            : Variable
    Overall bit rate                 : 780 Kbps
    Maximum Overall bit rate         : 949 Kbps
    Encoded date                     : UTC 2009-03-07 07:02:41.121
    Writing application              :  6.0.6000.16386 / Windows Movie Maker
    Application                      : Windows Movie Maker 6.0.6000.16386

    Video
    ID                               : 2
    Format                           : VC-1
    Format profile                   : MP@ML
    Codec ID                         : WMV3
    Codec ID/Info                    : Windows Media Video 9
    Codec ID/Hint                    : WMV3
    Duration                         : 2mn 0s
    Bit rate mode                    : Variable
    Bit rate                         : 587 Kbps
    Width                            : 640 pixels
    Height                           : 480 pixels
    Display aspect ratio             : 4/3
    Frame rate                       : 30.000 fps
    Resolution                       : 24 bits
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.064
    Stream size                      : 8.46 MiB (75%)
    Language                         : en-us

    Audio
    ID                               : 1
    Format                           : WMA2
    Format profile                   : L3
    Codec ID                         : 161
    Codec ID/Info                    : Windows Media Audio 2
    Description of the codec         : Windows Media Audio 9.2 - VBR Quality 90, 48 kHz, stereo 1-pass VBR
    Duration                         : 2mn 0s
    Bit rate mode                    : Variable
    Bit rate                         : 186 Kbps
    Channel(s)                       : 2 channels
    Sampling rate                    : 48.0 KHz
    Resolution                       : 16 bits
    Stream size                      : 2.68 MiB (24%)
    Language                         : en-us

    i see alot of people with this issue with so solution or cause

    any ideas would be helpful
    thanks in advance