Recherche avancée

Médias (91)

Autres articles (76)

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

  • Submit bugs and patches

    13 avril 2011

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

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

Sur d’autres sites (11492)

  • Generate mp4 from m3u8 with EXT-X-START (FFMPEG)

    26 février 2019, par KPS1994

    I’m trying to generate a MP4 from a m3u8 playlist file using FFMPEG. The format of the file is as follows :

    #EXTM3U
    #EXT-X-VERSION:7
    #EXT-X-TARGETDURATION:607.0
    #EXT-X-MEDIA-SEQUENCE:0
    #EXT-X-MAP:URI=/path_to_mp4/2019-02-25_09-55-07.mp4
    #EXT-X-START:TIME-OFFSET=100
    #EXTINF:600.0,
    /path_to_m4s/2019-02-25_11-35-18.m4s
    #EXTINF:597.64,
    /path_to_m4s/2019-02-25_11-45-18.m4s
    #EXTINF:600.0,
    /path_to_m4s/2019-02-25_11-55-18.m4s
    #EXT-X-ENDLIST

    In the example above, each m4s chunk is 10 minutes long, but FFMPEG completely ignores the #EXT-X-START:TIME-OFFSET flag. Hence generating a video that is 30 minutes long as opposed to 29 minutes and 20 seconds.

    Any help on how to directly convert the m3u8 file would be most appreciated. (if there is a better tool than FFMEPG, then I am willing to try.)

  • Unable to playback hardware encoded H.264 to RED5 server using FFmpeg

    26 février 2019, par Les

    I have a USB camera that is capable of H.264 on-board compression. I use the following FFmpeg command line to grab the encoded H.264 from the camera and put it in a ’flv’ container :

    ffmpeg -y -f dshow -vcodec h264 -i video="USB Camera" -vcodec copy -copyinkf -f flv c:\temp\test.flv

    This works as expected and I can view the video using VLC no problem. Following this principle I then attempt to stream to a RED5 server using the following command :

    ffmpeg -y -f dshow -vcodec h264 -i video="USB Camera" -vcodec copy -copyinkf -f flv rtmp://192.168.75.34/live/livestream

    The RED5 server detects the stream but I am unable to connect to it and view it using my basic Python program.

    If I do the same thing but use FFmpeg to carry out H.264 encoding of the default capture pin (MJPEG), it will stream correctly.

    I’m not sure if there is some flag in the command line that I might be missing ? Any help with this issue would be much appreciated.

    Here is the log output from the second FFmpeg command :

    C :\ffmpeg-latest-20190219\ffmpeg-static\bin>ffmpeg -y -f dshow -vcodec h264 -i video="USB Camera" -vcodec copy -copyinkf -f flv rtmp ://192.168.75.176/live/livestream"

    ffmpeg version N-93151-gff03418348 Copyright (c) 2000-2019 the FFmpeg developers
    built with gcc 8.2.1 (GCC) 20190212
    configuration : —enable-gpl —enable-version3 —enable-sdl2 —enable-fontconfig —enable-gnutls —enable-iconv —enable-libass —enable-libdav1d —enable-libbluray —enable-libfreetype —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libtheora —enable-libtwolame —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxml2 —enable-libzimg —enable-lzma —enable-zlib —enable-gmp —enable-libvidstab —enable-libvorbis —enable-libvo-amrwbenc —enable-libmysofa —enable-libspeex —enable-libxvid —enable-libaom —enable-libmfx —enable-amf —enable-ffnvcodec —enable-cuvid —enable-d3d11va —enable-nvenc —enable-nvdec —enable-dxva2 —enable-avisynth —enable-libopenmpt
    libavutil 56. 26.100 / 56. 26.100
    libavcodec 58. 47.102 / 58. 47.102
    libavformat 58. 26.101 / 58. 26.101
    libavdevice 58. 6.101 / 58. 6.101
    libavfilter 7. 48.100 / 7. 48.100
    libswscale 5. 4.100 / 5. 4.100
    libswresample 3. 4.100 / 3. 4.100
    libpostproc 55. 4.100 / 55. 4.100

    Input #0, dshow, from ’video=USB Camera’ :
    Duration : N/A, start : 1834145.825000, bitrate : N/A
    Stream #0:0 : Video : h264 (Main) (H264 / 0x34363248), yuv420p, 1920x1080, 30 fps, 30 tbr, 10000k tbn, 20000k tbc

    Output #0, flv, to ’rtmp ://192.168.75.176/live/livestream’ :
    Metadata :
    encoder : Lavf58.26.101
    Stream #0:0 : Video : h264 (Main) ([7][0][0][0] / 0x0007), yuv420p, 1920x1080, q=2-31, 30 fps, 30 tbr, 1k tbn, 10000k tbc

    Stream mapping :
    Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    frame= 39 fps=3.2 q=-1.0 Lsize= 976kB time=00:00:07.10 bitrate=1124.8kbits/s speed=0.59x
    video:975kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : 0.106110%

  • How can I increase the performance of this video watermarking call which seems to be only using 6% of my system's CPU ? Currently using ffmpeg

    24 août 2023, par Codemonkey

    I have a php script to add a watermark to an uploaded video, using ffmpeg

    


    shell_exec("ffmpeg -y -i input.mp4 -i watermark.png -filter_complex $filter output.mp4")


    


    The video is 36 seconds long, 33MB and 1080x1920, 24fps. The output video comes in at 8MB, scaled down to 540x960 with a PNG overlaid as a watermark.

    


    The script takes about 3 seconds, averaging 320fps or so. For a one-off this would be ok, but I'm going to be processing hundreds/thousands of these at a time.

    


    I have 128GB of ram and an EPYC 7502p (32cores/64threads), and both input and output files are on NVMe drives.

    


    If I monitor top showing all my cores/threads in another window, with refresh delay set to a variety of things from 0.1 to 2 seconds, I'd guesstimate that this hits about 1/4 of my available threads, at about 25% utilisation each.

    


    So it kind of feels like I COULD see a 16x speed increase if it hit all of them at 100%. That actually wouldn't be ideal, locking up the server of course, but when my CPU is sat at 99% idle 99% of the time, I feel it could do better - it'd be nice to see it hitting at least half the cores or utilising at least 50% of them when it does...

    


    So, is there anything I can change with ffmpeg's config/build or the way I call it ? If this is as good as ffmpeg can do, are there better tools for the job ?

    


    Thank you

    



    


    EDIT :

    


    A few things I've learnt since posting :

    


      

    • -c:v libx264 -preset ultrafast - marginal help
    • 


    • nice -n -10 - marginal help (changing to -20 is makes negligible difference)
    • 


    • -c:a copy - significant help, which I found surprising
    • 


    


    FPS up from 320 to 540 using those 3 combined. I still feel there should be significantly more gains somewhere though...

    



    


    Here's the output from the original script, if it helps :

    


    ffmpeg version 4.2.9 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg --enable-libzvbi --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: isomavc1mp42
    creation_time   : 2023-07-03T14:55:37.000000Z
  Duration: 00:00:36.50, start: 0.000000, bitrate: 7315 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/unknown), 1080x1920 [SAR 1:1 DAR 9:16], 7213 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
    Metadata:
      creation_time   : 2023-07-03T14:55:37.000000Z
      handler_name    : ETI ISO Video Media Handler
      encoder         : Elemental H.264
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      creation_time   : 2023-07-03T14:55:37.000000Z
      handler_name    : ETI ISO Audio Media Handler
Input #1, png_pipe, from 'watermark.png':
  Duration: N/A, bitrate: N/A
    Stream #1:0: Video: png, rgba(pc), 1232x804 [SAR 11811:11811 DAR 308:201], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
  Stream #0:0 (h264) -> scale (graph 0)
  Stream #1:0 (png) -> scale (graph 0)
  overlay (graph 0) -> Stream #0:0 (libx264)
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x56510d488e00] using SAR=1/1
[libx264 @ 0x56510d488e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x56510d488e00] profile High, level 3.1, 4:2:0, 8-bit
[libx264 @ 0x56510d488e00] 264 - core 157 r2980 34c06d1 - H.264/MPEG-4 AVC codec - Copyleft 2003-2019 - 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=30 lookahead_threads=5 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=24 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.mp4':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: isomavc1mp42
    encoder         : Lavf58.29.100
    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 540x960 [SAR 1:1 DAR 9:16], q=-1--1, 24 fps, 12288 tbn, 24 tbc (default)
    Metadata:
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2023-07-03T14:55:37.000000Z
      handler_name    : ETI ISO Audio Media Handler
      encoder         : Lavc58.54.100 aac
frame=  876 fps=324 q=-1.0 Lsize=    7768kB time=00:00:36.45 bitrate=1745.5kbits/s speed=13.5x
video:7177kB audio:566kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.336181%
[libx264 @ 0x56510d488e00] frame I:9     Avg QP:21.46  size: 37765
[libx264 @ 0x56510d488e00] frame P:237   Avg QP:23.78  size: 17862
[libx264 @ 0x56510d488e00] frame B:630   Avg QP:28.03  size:  4405
[libx264 @ 0x56510d488e00] consecutive B-frames:  2.9%  2.5%  3.8% 90.9%
[libx264 @ 0x56510d488e00] mb I  I16..4: 13.6% 65.9% 20.5%
[libx264 @ 0x56510d488e00] mb P  I16..4:  5.2% 16.6%  4.1%  P16..4: 32.8% 18.0% 12.5%  0.0%  0.0%    skip:10.8%
[libx264 @ 0x56510d488e00] mb B  I16..4:  1.1%  2.7%  0.2%  B16..8: 35.3%  7.2%  2.5%  direct: 3.3%  skip:47.7%  L0:37.0% L1:52.2% BI:10.8%
[libx264 @ 0x56510d488e00] 8x8 transform intra:65.0% inter:71.5%
[libx264 @ 0x56510d488e00] coded y,uvDC,uvAC intra: 54.7% 62.1% 11.5% inter: 17.9% 12.9% 0.5%
[libx264 @ 0x56510d488e00] i16 v,h,dc,p: 16% 28%  8% 47%
[libx264 @ 0x56510d488e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 23% 18%  6%  6%  7%  7%  7%  7%
[libx264 @ 0x56510d488e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 16% 11%  7%  9% 10%  8%  8%  8%
[libx264 @ 0x56510d488e00] i8c dc,h,v,p: 55% 20% 20%  5%
[libx264 @ 0x56510d488e00] Weighted P-Frames: Y:5.5% UV:3.4%
[libx264 @ 0x56510d488e00] ref P L0: 65.0% 18.8% 13.0%  3.0%  0.2%
[libx264 @ 0x56510d488e00] ref B L0: 95.0%  4.0%  1.1%
[libx264 @ 0x56510d488e00] ref B L1: 98.2%  1.8%
[libx264 @ 0x56510d488e00] kb/s:1610.57
[aac @ 0x56510d4865c0] Qavg: 22331.562