Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (50)

  • Librairies et logiciels spécifiques aux médias

    10 décembre 2010, par

    Pour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
    Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...)

  • 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

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

  • mpegts : pass MpegTSContext ptr explicitly

    8 juillet 2014, par Alexander V. Lukyanov
    mpegts : pass MpegTSContext ptr explicitly
    

    AVFormatContext->priv_data is not always a MpegTSContext, it can be
    RTSPState when decoding a RTP stream. So it is necessary to pass
    MpegTSContext pointer explicitly.

    Within libav, the write_section_data function doesn’t actually use
    the MpegTSContext at all, so this doesn’t change anything at the
    moment (no memory was corrupted before), but it reduces the risk of
    anybody trying to touch the MpegTSContext via AVFormatContext->priv_data
    in the future.

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavformat/mpegts.c
  • FFmpeg saturates memory + CPU usage drops to 0% during very basic conversion of PNG files to MP4 video

    7 août 2022, par mattze_frisch

    I have this Python function that runs ffmpeg with minimal options from the Windows command line :

    &#xA;

    def run_ffmpeg(frames_path, ffmpeg_path=notebook_directory):&#xA;    &#x27;&#x27;&#x27;&#xA;    This function runs ffmpeg.exe to convert PNG image files into a MP4 video.&#xA;    &#xA;    Parameters&#xA;    ----------&#xA;    frames_path : string&#xA;        Absolute path to the PNG files&#xA;    ffmpeg_path : string&#xA;        Absolute path to the FFmpeg executable (ffmpeg.exe)&#xA;    &#x27;&#x27;&#x27;&#xA;    &#xA;    from subprocess import check_call&#xA;    &#xA;    &#xA;    check_call(&#xA;        [&#xA;            os.path.join(ffmpeg_path, &#x27;ffmpeg&#x27;),&#xA;            &#x27;-y&#x27;,    # Overwrite output files without asking&#xA;            &#x27;-report&#x27;,    # Write logfile to current working directory&#xA;            &#x27;-framerate&#x27;, &#x27;60&#x27;,    # Input frame rate&#xA;            &#x27;-i&#x27;, os.path.join(frames_path, &#x27;frame%05d.png&#x27;),    # Path to input frames&#xA;            os.path.join(frames_path, &#x27;video.mp4&#x27;)    # Path to store output video&#xA;        ]&#xA;    )&#xA;

    &#xA;

    When running it from a Jupyter notebook over 2500 PNG files (RGBA, ca. 600-700 kB each, 9000 x 13934 pixels), CPU usage briefly peaks to 100% before dropping to 0%, while memory usage quickly saturates to 100% and stays there, slowing the system down almost to a freeze, so I need to terminate ffmpeg from the task manager :

    &#xA;

    Screenshot

    &#xA;

    The generated video file has a size of only 48 bytes and contains just a black frame when viewed in the VLC player.

    &#xA;

    This is the ffmpeg log output :

    &#xA;

    ffmpeg started on 2022-08-05 at 17:17:55&#xA;Report written to "ffmpeg-20220805-171755.log"&#xA;Log level: 48&#xA;Command line:&#xA;"C:\\Users\\Username\\Desktop\\folder\\ffmpeg" -y -report -framerate 60 -i "C:\\Users\\Username\\Desktop\\e\\frame%05d.png" "C:\\Users\\Username\\Desktop\\e\\video.mp4"&#xA;ffmpeg version 2022-07-14-git-882aac99d2-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers&#xA;  built with gcc 12.1.0 (Rev2, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libshaderc --enable-vulkan --enable-libplacebo --ena  libavutil      57. 29.100 / 57. 29.100&#xA;  libavcodec     59. 38.100 / 59. 38.100&#xA;  libavformat    59. 28.100 / 59. 28.100&#xA;  libavdevice    59.  8.100 / 59.  8.100&#xA;  libavfilter     8. 45.100 /  8. 45.100&#xA;  libswscale      6.  8.100 /  6.  8.100&#xA;  libswresample   4.  8.100 /  4.  8.100&#xA;  libpostproc    56.  7.100 / 56.  7.100&#xA;Splitting the commandline.&#xA;Reading option &#x27;-y&#x27; ... matched as option &#x27;y&#x27; (overwrite output files) with argument &#x27;1&#x27;.&#xA;Reading option &#x27;-report&#x27; ... matched as option &#x27;report&#x27; (generate a report) with argument &#x27;1&#x27;.&#xA;Reading option &#x27;-framerate&#x27; ... matched as AVOption &#x27;framerate&#x27; with argument &#x27;60&#x27;.&#xA;Reading option &#x27;-i&#x27; ... matched as input url with argument &#x27;C:\Users\Username\Desktop\e\frame%05d.png&#x27;.&#xA;Reading option &#x27;C:\Users\Username\Desktop\e\video.mp4&#x27; ... matched as output url.&#xA;Finished splitting the commandline.&#xA;Parsing a group of options: global .&#xA;Applying option y (overwrite output files) with argument 1.&#xA;Applying option report (generate a report) with argument 1.&#xA;Successfully parsed a group of options.&#xA;Parsing a group of options: input url C:\Users\Username\Desktop\e\frame%05d.png.&#xA;Successfully parsed a group of options.&#xA;Opening an input file: C:\Users\Username\Desktop\e\frame%05d.png.&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00000.png&#x27; for reading&#xA;[file @ 0000000000425680] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000042d800] Statistics: 668318 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00001.png&#x27; for reading&#xA;[file @ 000000000042dac0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000042d6c0] Statistics: 668371 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00002.png&#x27; for reading&#xA;[file @ 000000000042d6c0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000042dac0] Statistics: 669177 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00003.png&#x27; for reading&#xA;[file @ 000000000042dac0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 0000000000437a40] Statistics: 684594 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00004.png&#x27; for reading&#xA;[file @ 0000000000437a40] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 0000000000437c00] Statistics: 703014 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00005.png&#x27; for reading&#xA;[file @ 0000000000437c00] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 0000000000437d00] Statistics: 721604 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00006.png&#x27; for reading&#xA;[file @ 0000000000437cc0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 0000000000437f40] Statistics: 739761 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00007.png&#x27; for reading&#xA;[file @ 0000000000437f40] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 0000000000438040] Statistics: 757327 bytes read, 0 seeks&#xA;[image2 @ 000000000041ff80] Probe buffer size limit of 5000000 bytes reached&#xA;Input #0, image2, from &#x27;C:\Users\Username\Desktop\e\frame%05d.png&#x27;:&#xA;  Duration: 00:00:41.67, start: 0.000000, bitrate: N/A&#xA;  Stream #0:0, 8, 1/60: Video: png, rgba(pc), 9000x13934 [SAR 29528:29528 DAR 4500:6967], 60 fps, 60 tbr, 60 tbn&#xA;Successfully opened the file.&#xA;Parsing a group of options: output url C:\Users\Username\Desktop\e\video.mp4.&#xA;Successfully parsed a group of options.&#xA;Opening an output file: C:\Users\Username\Desktop\e\video.mp4.&#xA;[file @ 000000002081e3c0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;Successfully opened the file.&#xA;detected 12 logical cores&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))&#xA;Press [q] to stop, [?] for help&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00008.png&#x27; for reading&#xA;[file @ 00000000024ad980] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 00000000004379c0] Statistics: 767857 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00009.png&#x27; for reading&#xA;[file @ 000000000042d600] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 00000000004379c0] Statistics: 774848 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00010.png&#x27; for reading&#xA;[file @ 00000000004379c0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000042da00] Statistics: 787178 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00011.png&#x27; for reading&#xA;[file @ 00000000004379c0] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000042da00] Statistics: 797084 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00012.png&#x27; for reading&#xA;[file @ 0000000000437a80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000042da00] Statistics: 802870 bytes read, 0 seeks&#xA;[graph 0 input from stream 0:0 @ 00000000208bf800] Setting &#x27;video_size&#x27; to value &#x27;9000x13934&#x27;&#xA;[graph 0 input from stream 0:0 @ 00000000208bf800] Setting &#x27;pix_fmt&#x27; to value &#x27;26&#x27;&#xA;[graph 0 input from stream 0:0 @ 00000000208bf800] Setting &#x27;time_base&#x27; to value &#x27;1/60&#x27;&#xA;[graph 0 input from stream 0:0 @ 00000000208bf800] Setting &#x27;pixel_aspect&#x27; to value &#x27;29528/29528&#x27;&#xA;[graph 0 input from stream 0:0 @ 00000000208bf800] Setting &#x27;frame_rate&#x27; to value &#x27;60/1&#x27;&#xA;[graph 0 input from stream 0:0 @ 00000000208bf800] w:9000 h:13934 pixfmt:rgba tb:1/60 fr:60/1 sar:29528/29528&#xA;[format @ 00000000025ef840] Setting &#x27;pix_fmts&#x27; to value &#x27;yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|yuv422p10le|yuv444p10le|nv20le|gray|gray10le&#x27;&#xA;[auto_scale_0 @ 00000000025efe40] w:iw h:ih flags:&#x27;&#x27; interl:0&#xA;[format @ 00000000025ef840] auto-inserting filter &#x27;auto_scale_0&#x27; between the filter &#x27;Parsed_null_0&#x27; and the filter &#x27;format&#x27;&#xA;[AVFilterGraph @ 000000000042da00] query_formats: 4 queried, 3 merged, 1 already done, 0 delayed&#xA;[auto_scale_0 @ 00000000025efe40] picking yuv444p out of 13 ref:rgba alpha:1&#xA;[auto_scale_0 @ 00000000025efe40] w:9000 h:13934 fmt:rgba sar:29528/29528 -> w:9000 h:13934 fmt:yuv444p sar:1/1 flags:0x0&#xA;[auto_scale_0 @ 00000000025efe40] w:9000 h:13934 fmt:rgba sar:29528/29528 -> w:9000 h:13934 fmt:yuv444p sar:1/1 flags:0x0&#xA;[auto_scale_0 @ 00000000025efe40] w:9000 h:13934 fmt:rgba sar:29528/29528 -> w:9000 h:13934 fmt:yuv444p sar:1/1 flags:0x0&#xA;[auto_scale_0 @ 00000000025efe40] w:9000 h:13934 fmt:rgba sar:29528/29528 -> w:9000 h:13934 fmt:yuv444p sar:1/1 flags:0x0&#xA;[libx264 @ 000000002081d280] using mv_range_thread = 376&#xA;[libx264 @ 000000002081d280] using SAR=1/1&#xA;[libx264 @ 000000002081d280] frame MB size (563x871) > level limit (139264)&#xA;[libx264 @ 000000002081d280] DPB size (4 frames, 1961492 mbs) > level limit (1 frames, 696320 mbs)&#xA;[libx264 @ 000000002081d280] MB rate (29422380) > level limit (16711680)&#xA;[libx264 @ 000000002081d280] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX&#xA;[libx264 @ 000000002081d280] profile High 4:4:4 Predictive, level 6.2, 4:4:4, 8-bit&#xA;[libx264 @ 000000002081d280] 264 - core 164 r3095 baee400 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - 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=4 threads=18 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=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&#xA;Output #0, mp4, to &#x27;C:\Users\Username\Desktop\e\video.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf59.28.100&#xA;  Stream #0:0, 0, 1/15360: Video: h264 (avc1 / 0x31637661), yuv444p(tv, progressive), 9000x13934 [SAR 1:1 DAR 4500:6967], q=2-31, 60 fps, 15360 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc59.38.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A&#xA;Clipping frame in rate conversion by 0.000008&#xA;frame=    1 fps=0.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00013.png&#x27; for reading&#xA;[file @ 000000000a6a2180] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 810395 bytes read, 0 seeks&#xA;frame=    2 fps=0.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00014.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 818213 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00015.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 817936 bytes read, 0 seeks&#xA;frame=    4 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00016.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 817014 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00017.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 828088 bytes read, 0 seeks&#xA;frame=    6 fps=1.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00018.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 831007 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00019.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 845203 bytes read, 0 seeks&#xA;frame=    8 fps=1.7 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00020.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 851548 bytes read, 0 seeks&#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00021.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 847629 bytes read, 0 seeks&#xA;frame=   10 fps=1.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00022.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 860169 bytes read, 0 seeks&#xA;frame=   11 fps=1.4 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00023.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 857243 bytes read, 0 seeks&#xA;frame=   12 fps=1.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;cur_dts is invalid st:0 (0) [init:1 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)&#xA;[image2 @ 000000000041ff80] Opening &#x27;C:\Users\Username\Desktop\e\frame00024.png&#x27; for reading&#xA;[file @ 000000001ec86c80] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[AVIOContext @ 000000000b38de80] Statistics: 835155 bytes read, 0 seeks&#xA;

    &#xA;

    What is the problem ?

    &#xA;

    By the way, the color model of the image files was confirmed by doing

    &#xA;

    from PIL import Image&#xA;&#xA;&#xA;img = Image.open(&#x27;C:\\Users\\EPI-SMLM\\Desktop\\e\\frame00000.png&#x27;)&#xA;img.mode&#xA;-------------------------------------------------------------------&#xA;C:\Program Files\Python38\lib\site-packages\PIL\Image.py:3035: DecompressionBombWarning: Image size (125406000 pixels) exceeds limit of 89478485 pixels, could be decompression bomb DOS attack.&#xA;  warnings.warn(&#xA;&#xA;&#x27;RGBA&#x27;&#xA;

    &#xA;

    The "decompression bomb warning" appears to be a false alarm/bug.

    &#xA;

    UPDATE : I can confirm that this happens even when there are only 50 image files, i.e. 50 x 700 kB = 35 MB in total size. ffmpeg still gobbles up all available memory (almost 60 GB of private bytes !!!).

    &#xA;

    And it also happens if ffmpeg is run from the command line.

    &#xA;

    This must be a bug !

    &#xA;

  • Metadict in ffmpeg does not have rotate information

    14 juillet 2022, par Lucky Sunda

    My aim is to extract frames out of a video but many times the frames are inverted. This is happening because "VideoCapture" in cv2 does read the rotate flag data present in the video metadata. I am running it on mac and installed "ffmpeg" package (5.0.1) using brew package manager. This is my code to check rotation present in a video using ffmpeg.

    &#xA;

    import ffmpeg &#xA;import cv2   &#xA;import pprint &#xA;pp = pprint.PrettyPrinter(depth=4)&#xA;def check_rotation(path_video_file):&#xA;    # this returns meta-data of the video file in form of a dictionary&#xA;    meta_dict = ffmpeg.probe(path_video_file)&#xA;    pp.pprint(meta_dict)&#xA;&#xA;    # from the dictionary, meta_dict[&#x27;streams&#x27;][0][&#x27;tags&#x27;][&#x27;rotate&#x27;] is the key&#xA;    # we are looking for&#xA;    rotateCode = None&#xA;    if int(meta_dict[&#x27;streams&#x27;][0][&#x27;tags&#x27;][&#x27;rotate&#x27;]) == 90:&#xA;        rotateCode = cv2.ROTATE_90_CLOCKWISE&#xA;    elif int(meta_dict[&#x27;streams&#x27;][0][&#x27;tags&#x27;][&#x27;rotate&#x27;]) == 180:&#xA;        rotateCode = cv2.ROTATE_180&#xA;    elif int(meta_dict[&#x27;streams&#x27;][0][&#x27;tags&#x27;][&#x27;rotate&#x27;]) == 270:&#xA;        rotateCode = cv2.ROTATE_90_COUNTERCLOCKWISE&#xA;&#xA;    return rotateCode&#xA;&#xA;

    &#xA;

    Here the meta_dict is supposed to have information about the rotation but it is not there.&#xA;printing out meta_dict gives :

    &#xA;

    {&#x27;format&#x27;: {&#x27;bit_rate&#x27;: &#x27;18498544&#x27;,&#xA;            &#x27;duration&#x27;: &#x27;3.584000&#x27;,&#xA;            &#x27;filename&#x27;: &#x27;video.mp4&#x27;,&#xA;            &#x27;format_long_name&#x27;: &#x27;QuickTime / MOV&#x27;,&#xA;            &#x27;format_name&#x27;: &#x27;mov,mp4,m4a,3gp,3g2,mj2&#x27;,&#xA;            &#x27;nb_programs&#x27;: 0,&#xA;            &#x27;nb_streams&#x27;: 2,&#xA;            &#x27;probe_score&#x27;: 100,&#xA;            &#x27;size&#x27;: &#x27;8287348&#x27;,&#xA;            &#x27;start_time&#x27;: &#x27;0.000000&#x27;,&#xA;            &#x27;tags&#x27;: {&#x27;com.android.version&#x27;: &#x27;11&#x27;,&#xA;                     &#x27;compatible_brands&#x27;: &#x27;isommp42&#x27;,&#xA;                     &#x27;creation_time&#x27;: &#x27;2021-12-08T10:56:57.000000Z&#x27;,&#xA;                     &#x27;major_brand&#x27;: &#x27;mp42&#x27;,&#xA;                     &#x27;minor_version&#x27;: &#x27;0&#x27;}},&#xA; &#x27;streams&#x27;: [{&#x27;avg_frame_rate&#x27;: &#x27;990000/34997&#x27;,&#xA;              &#x27;bit_rate&#x27;: &#x27;18804651&#x27;,&#xA;              &#x27;bits_per_raw_sample&#x27;: &#x27;8&#x27;,&#xA;              &#x27;chroma_location&#x27;: &#x27;left&#x27;,&#xA;              &#x27;closed_captions&#x27;: 0,&#xA;              &#x27;codec_long_name&#x27;: &#x27;H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10&#x27;,&#xA;              &#x27;codec_name&#x27;: &#x27;h264&#x27;,&#xA;              &#x27;codec_tag&#x27;: &#x27;0x31637661&#x27;,&#xA;              &#x27;codec_tag_string&#x27;: &#x27;avc1&#x27;,&#xA;              &#x27;codec_type&#x27;: &#x27;video&#x27;,&#xA;              &#x27;coded_height&#x27;: 1080,&#xA;              &#x27;coded_width&#x27;: 1920,&#xA;              &#x27;color_primaries&#x27;: &#x27;bt470bg&#x27;,&#xA;              &#x27;color_range&#x27;: &#x27;pc&#x27;,&#xA;              &#x27;color_space&#x27;: &#x27;bt470bg&#x27;,&#xA;              &#x27;color_transfer&#x27;: &#x27;smpte170m&#x27;,&#xA;              &#x27;display_aspect_ratio&#x27;: &#x27;16:9&#x27;,&#xA;              &#x27;disposition&#x27;: {&#x27;attached_pic&#x27;: 0,&#xA;                              &#x27;captions&#x27;: 0,&#xA;                              &#x27;clean_effects&#x27;: 0,&#xA;                              &#x27;comment&#x27;: 0,&#xA;                              &#x27;default&#x27;: 1,&#xA;                              &#x27;dependent&#x27;: 0,&#xA;                              &#x27;descriptions&#x27;: 0,&#xA;                              &#x27;dub&#x27;: 0,&#xA;                              &#x27;forced&#x27;: 0,&#xA;                              &#x27;hearing_impaired&#x27;: 0,&#xA;                              &#x27;karaoke&#x27;: 0,&#xA;                              &#x27;lyrics&#x27;: 0,&#xA;                              &#x27;metadata&#x27;: 0,&#xA;                              &#x27;original&#x27;: 0,&#xA;                              &#x27;still_image&#x27;: 0,&#xA;                              &#x27;timed_thumbnails&#x27;: 0,&#xA;                              &#x27;visual_impaired&#x27;: 0},&#xA;              &#x27;duration&#x27;: &#x27;3.499700&#x27;,&#xA;              &#x27;duration_ts&#x27;: 314973,&#xA;              &#x27;extradata_size&#x27;: 35,&#xA;              &#x27;field_order&#x27;: &#x27;progressive&#x27;,&#xA;              &#x27;film_grain&#x27;: 0,&#xA;              &#x27;has_b_frames&#x27;: 0,&#xA;              &#x27;height&#x27;: 1080,&#xA;              &#x27;id&#x27;: &#x27;0x1&#x27;,&#xA;              &#x27;index&#x27;: 0,&#xA;              &#x27;is_avc&#x27;: &#x27;true&#x27;,&#xA;              &#x27;level&#x27;: 40,&#xA;              &#x27;nal_length_size&#x27;: &#x27;4&#x27;,&#xA;              &#x27;nb_frames&#x27;: &#x27;99&#x27;,&#xA;              &#x27;pix_fmt&#x27;: &#x27;yuvj420p&#x27;,&#xA;              &#x27;profile&#x27;: &#x27;High&#x27;,&#xA;              &#x27;r_frame_rate&#x27;: &#x27;120/1&#x27;,&#xA;              &#x27;refs&#x27;: 1,&#xA;              &#x27;sample_aspect_ratio&#x27;: &#x27;1:1&#x27;,&#xA;              &#x27;side_data_list&#x27;: [{...}],&#xA;              &#x27;start_pts&#x27;: 3168,&#xA;              &#x27;start_time&#x27;: &#x27;0.035200&#x27;,&#xA;              &#x27;tags&#x27;: {&#x27;creation_time&#x27;: &#x27;2021-12-08T10:56:57.000000Z&#x27;,&#xA;                       &#x27;handler_name&#x27;: &#x27;VideoHandle&#x27;,&#xA;                       &#x27;language&#x27;: &#x27;eng&#x27;,&#xA;                       &#x27;vendor_id&#x27;: &#x27;[0][0][0][0]&#x27;},&#xA;              &#x27;time_base&#x27;: &#x27;1/90000&#x27;,&#xA;              &#x27;width&#x27;: 1920},&#xA;             {&#x27;avg_frame_rate&#x27;: &#x27;0/0&#x27;,&#xA;              &#x27;bit_rate&#x27;: &#x27;128986&#x27;,&#xA;              &#x27;bits_per_sample&#x27;: 0,&#xA;              &#x27;channel_layout&#x27;: &#x27;stereo&#x27;,&#xA;              &#x27;channels&#x27;: 2,&#xA;              &#x27;codec_long_name&#x27;: &#x27;AAC (Advanced Audio Coding)&#x27;,&#xA;              &#x27;codec_name&#x27;: &#x27;aac&#x27;,&#xA;              &#x27;codec_tag&#x27;: &#x27;0x6134706d&#x27;,&#xA;              &#x27;codec_tag_string&#x27;: &#x27;mp4a&#x27;,&#xA;              &#x27;codec_type&#x27;: &#x27;audio&#x27;,&#xA;              &#x27;disposition&#x27;: {&#x27;attached_pic&#x27;: 0,&#xA;                              &#x27;captions&#x27;: 0,&#xA;                              &#x27;clean_effects&#x27;: 0,&#xA;                              &#x27;comment&#x27;: 0,&#xA;                              &#x27;default&#x27;: 1,&#xA;                              &#x27;dependent&#x27;: 0,&#xA;                              &#x27;descriptions&#x27;: 0,&#xA;                              &#x27;dub&#x27;: 0,&#xA;                              &#x27;forced&#x27;: 0,&#xA;                              &#x27;hearing_impaired&#x27;: 0,&#xA;                              &#x27;karaoke&#x27;: 0,&#xA;                              &#x27;lyrics&#x27;: 0,&#xA;                              &#x27;metadata&#x27;: 0,&#xA;                              &#x27;original&#x27;: 0,&#xA;                              &#x27;still_image&#x27;: 0,&#xA;                              &#x27;timed_thumbnails&#x27;: 0,&#xA;                              &#x27;visual_impaired&#x27;: 0},&#xA;              &#x27;duration&#x27;: &#x27;3.584000&#x27;,&#xA;              &#x27;duration_ts&#x27;: 172032,&#xA;              &#x27;extradata_size&#x27;: 2,&#xA;              &#x27;id&#x27;: &#x27;0x2&#x27;,&#xA;              &#x27;index&#x27;: 1,&#xA;              &#x27;nb_frames&#x27;: &#x27;168&#x27;,&#xA;              &#x27;profile&#x27;: &#x27;LC&#x27;,&#xA;              &#x27;r_frame_rate&#x27;: &#x27;0/0&#x27;,&#xA;              &#x27;sample_fmt&#x27;: &#x27;fltp&#x27;,&#xA;              &#x27;sample_rate&#x27;: &#x27;48000&#x27;,&#xA;              &#x27;start_pts&#x27;: 0,&#xA;              &#x27;start_time&#x27;: &#x27;0.000000&#x27;,&#xA;              &#x27;tags&#x27;: {&#x27;creation_time&#x27;: &#x27;2021-12-08T10:56:57.000000Z&#x27;,&#xA;                       &#x27;handler_name&#x27;: &#x27;SoundHandle&#x27;,&#xA;                       &#x27;language&#x27;: &#x27;eng&#x27;,&#xA;                       &#x27;vendor_id&#x27;: &#x27;[0][0][0][0]&#x27;},&#xA;              &#x27;time_base&#x27;: &#x27;1/48000&#x27;}]}&#xA;

    &#xA;

    Can someone please help me to find if rotation is present in a video ?

    &#xA;