Recherche avancée

Médias (1)

Mot : - Tags -/getid3

Autres articles (111)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

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

Sur d’autres sites (11137)

  • Why does the official LibAV 12 video example not work properly ?

    11 avril 2021, par TheNeuronalCoder

    I would say the title is quite self-explanatory, but I nearly completely copied the example given by LibAV right here and yet the output video it produced was not playable. Why is it not playable ? Am I using the wrong file extension ? I do not understand what I could have possibly done wrong here and there's little to no documentation I could find for how to encode mp4 video in C++.

    


    #include &#xA;#include &#xA;#include &#xA;#include "libavcodec/avcodec.h"&#xA;#include "libavutil/frame.h"&#xA;#include "libavutil/imgutils.h"&#xA;&#xA;static void encode(AVCodecContext *enc_ctx, AVFrame *frame, AVPacket *pkt, FILE *outfile) {&#xA;    int ret;&#xA;    ret = avcodec_send_frame(enc_ctx, frame);&#xA;    if (ret &lt; 0) {&#xA;        fprintf(stderr, "error sending a frame for encoding\n");&#xA;        exit(1);&#xA;    }&#xA;    while (ret >= 0) {&#xA;        ret = avcodec_receive_packet(enc_ctx, pkt);&#xA;        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;            return;&#xA;        else if (ret &lt; 0) {&#xA;            fprintf(stderr, "error during encoding\n");&#xA;            exit(1);&#xA;        }&#xA;        printf("encoded frame %3"PRId64" (size=%5d)\n", pkt->pts, pkt->size);&#xA;        fwrite(pkt->data, 1, pkt->size, outfile);&#xA;        av_packet_unref(pkt);&#xA;    }&#xA;}&#xA;&#xA;int main() {&#xA;    const char *filename = "animation.mp4";&#xA;    const AVCodec *codec;&#xA;    AVCodecContext *c = NULL;&#xA;    int i, ret, x, y;&#xA;    FILE *f;&#xA;    AVFrame *picture;&#xA;    AVPacket *pkt;&#xA;    uint8_t endcode[] = { 0, 0, 1, 0xb7 };&#xA;    if (argc &lt;= 1) {&#xA;        fprintf(stderr, "Usage: %s <output file="file">\n", argv[0]);&#xA;        exit(0);&#xA;    }&#xA;    avcodec_register_all();&#xA;    codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);&#xA;    if (!codec) {&#xA;        fprintf(stderr, "codec not found\n");&#xA;        exit(1);&#xA;    }&#xA;    c = avcodec_alloc_context3(codec);&#xA;    picture = av_frame_alloc();&#xA;    pkt = av_packet_alloc();&#xA;    if (!pkt)&#xA;        exit(1);&#xA;    c->bit_rate = 400000;&#xA;    c->width = 352;&#xA;    c->height = 288;&#xA;    c->time_base = (AVRational){1, 25};&#xA;    c->framerate = (AVRational){25, 1};&#xA;    c->gop_size = 10;&#xA;    c->max_b_frames=1;&#xA;    c->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;    if (avcodec_open2(c, codec, NULL) &lt; 0) {&#xA;        fprintf(stderr, "could not open codec\n");&#xA;        exit(1);&#xA;    }&#xA;    f = fopen(filename, "wb");&#xA;    if (!f) {&#xA;        fprintf(stderr, "could not open %s\n", filename);&#xA;        exit(1);&#xA;    }&#xA;    picture->format = c->pix_fmt;&#xA;    picture->width  = c->width;&#xA;    picture->height = c->height;&#xA;    ret = av_frame_get_buffer(picture, 32);&#xA;    if (ret &lt; 0) {&#xA;        fprintf(stderr, "could not alloc the frame data\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    for(i=0;i&lt;25;i&#x2B;&#x2B;) {&#xA;        fflush(stdout);&#xA;        ret = av_frame_make_writable(picture);&#xA;        if (ret &lt; 0)&#xA;            exit(1);&#xA;&#xA;        for(y=0;yheight;y&#x2B;&#x2B;) {&#xA;            for(x=0;xwidth;x&#x2B;&#x2B;) {&#xA;                picture->data[0][y * picture->linesize[0] &#x2B; x] = x &#x2B; y &#x2B; i * 3;&#xA;            }&#xA;        }&#xA;&#xA;        for(y=0;yheight/2;y&#x2B;&#x2B;) {&#xA;            for(x=0;xwidth/2;x&#x2B;&#x2B;) {&#xA;                picture->data[1][y * picture->linesize[1] &#x2B; x] = 128 &#x2B; y &#x2B; i * 2;&#xA;                picture->data[2][y * picture->linesize[2] &#x2B; x] = 64 &#x2B; x &#x2B; i * 5;&#xA;            }&#xA;        }&#xA;&#xA;        picture->pts = i;&#xA;        encode(c, picture, pkt, f);&#xA;    }&#xA;&#xA;    encode(c, NULL, pkt, f);&#xA;&#xA;    fwrite(endcode, 1, sizeof(endcode), f);&#xA;    fclose(f);&#xA;    avcodec_free_context(&amp;c);&#xA;    av_frame_free(&amp;picture);&#xA;    av_packet_free(&amp;pkt);&#xA;    return 0;&#xA;}&#xA;</output>

    &#xA;

  • FPS from RTSP stream info does not match actual framerate

    17 mai 2021, par Krapow

    I have a 25FPS RTSP stream coming from an IP-camera. I can successfully display the video stream. But when analyzing the stream with ffmpeg (ffprobe actually), I observe fewer frames per second rate :

    &#xA;

    $ ffprobe -rtsp_transport tcp -i rtsp://camera_ip:554/stream -select_streams v:0 -show_frames -show_entries frame=coded_picture_number,pkt_pts_time -of csv=p=0&#xA;Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 640x480, 25 fps, 25 tbr, 90k tbn, 50 tbc&#xA;0.400000,0&#xA;0.080000,1&#xA;0.120000,2&#xA;0.200000,3&#xA;0.240000,4&#xA;0.320000,5&#xA;0.360000,6&#xA;0.440000,7&#xA;0.480000,8&#xA;0.560000,9&#xA;0.600000,10&#xA;0.680000,11&#xA;0.720000,12&#xA;0.800000,13&#xA;0.840000,14&#xA;0.920000,15&#xA;0.960000,16&#xA;1.040000,17&#xA;1.080000,18&#xA;1.160000,19&#xA;1.200000,20&#xA;1.280000,21&#xA;1.320000,22&#xA;1.400000,23&#xA;1.440000,24&#xA;1.520000,25&#xA;1.560000,26&#xA;1.640000,27&#xA;1.680000,28&#xA;1.760000,29&#xA;1.800000,30&#xA;1.880000,31&#xA;1.920000,32&#xA;2.000000,33&#xA;

    &#xA;

    We can clearly see the 80ms gap between some of the frames, resulting in a 16fps stream.

    &#xA;

    I have observed the same framerate issue with GStreamer (printing information in the rtpjitterbuffer indicates the frame gap is sometimes 80ms and sometimes 40ms). But the weird thing is, I encountered the same issue with an HDMI-RJ45 decoder, and I doubt the same issue comes from 2 different devices.&#xA;I didn't get much more informations using -loglevel debug or trace.&#xA;Does anybody have an idea about what is going wrong in the stream ?

    &#xA;

    (I used ffprobe 4.2.3 and the last "2021-05-09-git-8649f5dca6-full_build-www.gyan.dev" with the same results, and GStreamer 1.16.2 with a pipeline like "urisourcebin ! h264depay ! h264parse ! fakesink")

    &#xA;

    EDIT : The camera skipping of frames was caused by the activation of a third stream in the options. I find it really weird that it skips exactly the same frames every seconds. However, I still haven't found the cause of the downrate on my RTSP encoder.&#xA;Anyway, this was actually hardware related and not software related.

    &#xA;

  • Timestamp not printed on thumbnails with FFMPEG

    26 août 2021, par mlatelcom

    I have a script using FFMPEG to generate an image with tiled thumbnails every 45 seconds for several videos on a given folder. The images are named with the name of the video it was generated from. It generates the thumbnails for each video but it does not print the time stamps on them. The path to the font file is correct ; so I don't know where the issue is. I'm using the script in Fedora Linux.

    &#xA;

    Here is the FFMPEG command line code on the script :

    &#xA;

     ffmpeg -ss 00:00:05 -i test.mp4 -loglevel 40 -frames 1 -bt 20M -vf "drawtext=fontfile=/usr/share/fonts/open-sans/OpenSans-Light.ttf:timecode=&#x27;00\\:00\\:00\\:00&#x27;:r=30:fontcolor=white:x=220:y=220:box=1:boxcolor=black@0.5,select=not(mod(n\,1350)),scale=200:150,tile=15x48" -n "${name}.png"&#xA;

    &#xA;

    and this is the console output

    &#xA;

    ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 11 (GCC)&#xA;  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=&#x27;-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection&#x27; --extra-ldflags=&#x27;-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld &#x27; --extra-cflags=&#x27; -I/usr/include/rav1e&#x27; --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-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-libsmbclient --enable-version3 --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;[h264 @ 0x56051b4b3cc0] Reinit context to 1280x720, pix_fmt: yuv420p&#xA;[mpegts @ 0x56051b4acc80] max_analyze_duration 5000000 reached at 5000000 microseconds st:0&#xA;Input #0, mpegts, from &#x27;test.mp4&#x27;:&#xA;  Duration: 00:04:57.02, start: 1.400000, bitrate: 2853 kb/s&#xA;  Program 1 &#xA;    Metadata:&#xA;      service_name    : Service01&#xA;      service_provider: FFmpeg&#xA;  Stream #0:0[0x100]: Video: h264 (Main), 1 reference frame ([27][0][0][0] / 0x001B), yuv420p(progressive, left), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc&#xA;  Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 96 kb/s&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> png (native))&#xA;Press [q] to stop, [?] for help&#xA;[h264 @ 0x56051ba69e00] Reinit context to 1280x720, pix_fmt: yuv420p&#xA;[Parsed_scale_2 @ 0x56051b5953c0] w:200 h:150 flags:&#x27;bicubic&#x27; interl:0&#xA;[graph 0 input from stream 0:0 @ 0x56051b725ac0] w:1280 h:720 pixfmt:yuv420p tb:1/90000 fr:30/1 sar:1/1&#xA;[Parsed_scale_2 @ 0x56051b5953c0] w:1280 h:720 fmt:yuv420p sar:1/1 -> w:200 h:150 fmt:rgb24 sar:4/3 flags:0x4&#xA;Output #0, image2, to &#x27;.png&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf58.76.100&#xA;  Stream #0:0: Video: png, 1 reference frame, rgb24(pc, progressive, left), 3000x7200 (0x0) [SAR 4:3 DAR 5:9], q=2-31, 200 kb/s, 0.04 fps, 0.04 tbn&#xA;    Metadata:&#xA;      encoder         : Lavc58.134.100 png&#xA;No more output streams to write to, finishing.00.00 bitrate=N/A speed=   0x    &#xA;[AVIOContext @ 0x56051b84c8c0] Statistics: 0 seeks, 2 writeouts&#xA;frame=    1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:24.00 bitrate=N/A speed=0.47x    &#xA;video:465kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown&#xA;Input file #0 (test.mp4):&#xA;  Input stream #0:0 (video): 8761 packets read (96159422 bytes); 8760 frames decoded; &#xA;  Input stream #0:1 (audio): 0 packets read (0 bytes); &#xA;  Total: 8761 packets (96159422 bytes) demuxed&#xA;Output file #0 (.png):&#xA;  Output stream #0:0 (video): 1 frames encoded; 1 packets muxed (476224 bytes); &#xA;  Total: 1 packets (476224 bytes) muxed&#xA;[AVIOContext @ 0x56051b4b5d00] Statistics: 107090352 bytes read, 18 seeks&#xA;

    &#xA;