Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (51)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (9790)

  • Ffmpeg creates a picture and prompts "End of file"

    15 décembre 2022, par SunnyWu

    When I use ffmpeg to generate video screenshots, it prompts me "End of file". I don't know where this problem occurs.

    


    My video source can be played normally in the VLC player.

    


    I tried to use the same ffmpeg command to replace other video sources. It can generate video screenshots normally.

    



    


    OS:Centon 7

    


    ffmpeg version:4.8.5

    


    Video source address protocol:HTTP-FLV

    



    


    The following is the command I executed to generate screenshots :

    


    ffmpeg  -i http://172.20.32.33:2000/live -ss 00:00:05 -vframes 1 -f image2 /root/project/img/tttt.jpeg && echo succeeded ||echo failed

ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  configuration: --enable-libx265 --enable-libx264 --enable-gpl
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100

http://172.20.32.33:2000/live: End of file
failed


    


    enter image description here

    


  • avcodec/wmalosslessdec : Check channels after setting them

    31 mars 2022, par Michael Niedermayer
    avcodec/wmalosslessdec : Check channels after setting them
    

    Fixes : 46194/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-580292873827123
    Fixes : stack-buffer-overflow on address 0x7ffc0ce69b30 at pc 0x00000062fb03 bp 0x7ffc0ce69af0 sp 0x7ffc0ce69ae8
    Fixes : 46205/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5354894996930560
    Fixes : 47861/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-4817404984688640

    Found-by : continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/wmalosslessdec.c
  • `free() : invalid next size (normal)` after loading some frames of some videos using ffmpeg libs

    17 septembre 2024, par rakivo

    here is the function :

    &#xA;

    uint8_t *load_first_frame(const char *file_path, AVFrame **frame)&#xA;{&#xA;    int ret;&#xA;    AVFormatContext *format_ctx = NULL;&#xA;    if ((ret = avformat_open_input(&amp;format_ctx, file_path, NULL, NULL)) &lt; 0) {&#xA;        eprintf("could not open input file\n");&#xA;        return NULL;&#xA;    }&#xA;&#xA;    if ((ret = avformat_find_stream_info(format_ctx, NULL)) &lt; 0) {&#xA;        eprintf("could not find stream info\n");&#xA;        avformat_close_input(&amp;format_ctx);&#xA;        return NULL;&#xA;    }&#xA;&#xA;    int stream_idx = -1;&#xA;    for (unsigned int i = 0; i &lt; format_ctx->nb_streams; i&#x2B;&#x2B;) {&#xA;        if (format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            stream_idx = i;&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    if (stream_idx == -1) {&#xA;        eprintf("could not find video stream\n");&#xA;        avformat_close_input(&amp;format_ctx);&#xA;        return NULL;&#xA;    }&#xA;&#xA;    AVCodecParameters *codec_par = format_ctx->streams[stream_idx]->codecpar;&#xA;    const AVCodec *codec = avcodec_find_decoder(codec_par->codec_id);&#xA;    if (!codec) {&#xA;        eprintf("could not find decoder\n");&#xA;        avformat_close_input(&amp;format_ctx);&#xA;        return NULL;&#xA;    }&#xA;&#xA;    AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);&#xA;    if ((ret = avcodec_parameters_to_context(codec_ctx, codec_par)) &lt; 0) {&#xA;        eprintf("could not copy codec parameters to context\n");&#xA;        avformat_close_input(&amp;format_ctx);&#xA;        avcodec_free_context(&amp;codec_ctx);&#xA;        return NULL;&#xA;    }&#xA;&#xA;    if ((ret = avcodec_open2(codec_ctx, codec, NULL)) &lt; 0) {&#xA;        eprintf("could not open codec\n");&#xA;        avformat_close_input(&amp;format_ctx);&#xA;        avcodec_free_context(&amp;codec_ctx);&#xA;        return NULL;&#xA;    }&#xA;&#xA;    AVPacket *packet = av_packet_alloc();&#xA;    uint8_t *rgb_buffer = NULL;&#xA;    while (av_read_frame(format_ctx, packet) >= 0) {&#xA;        if (packet->stream_index != stream_idx) {&#xA;            av_packet_unref(packet);&#xA;            continue;&#xA;        }&#xA;&#xA;        if (avcodec_send_packet(codec_ctx, packet) != 0) {&#xA;            av_packet_unref(packet);&#xA;            continue;&#xA;        }&#xA;&#xA;        ret = avcodec_receive_frame(codec_ctx, *frame);&#xA;        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;            av_packet_unref(packet);&#xA;            continue;&#xA;        } else if (ret &lt; 0) {&#xA;            eprintf("error receiving frame: %d\n", ret);&#xA;            av_packet_unref(packet);&#xA;            av_packet_free(&amp;packet);&#xA;            avformat_close_input(&amp;format_ctx);&#xA;            avcodec_free_context(&amp;codec_ctx);&#xA;            return NULL;&#xA;        }&#xA;&#xA;        struct SwsContext *sws_ctx = sws_getContext(&#xA;            (*frame)->width, (*frame)->height, codec_ctx->pix_fmt,&#xA;            (*frame)->width, (*frame)->height, AV_PIX_FMT_RGB24,&#xA;            SWS_BILINEAR, NULL, NULL, NULL&#xA;        );&#xA;&#xA;        if (!sws_ctx) {&#xA;            eprintf("failed to create SwsContext\n");&#xA;            av_packet_unref(packet);&#xA;            av_packet_free(&amp;packet);&#xA;            av_frame_free(frame);&#xA;            avformat_close_input(&amp;format_ctx);&#xA;            avcodec_free_context(&amp;codec_ctx);&#xA;            return NULL;&#xA;        }&#xA;&#xA;        int rgb_buffer_size = av_image_get_buffer_size(AV_PIX_FMT_RGB24, (*frame)->width, (*frame)->height, 1);&#xA;        if (rgb_buffer_size &lt; 0) {&#xA;            eprintf("could not get buffer size\n");&#xA;            sws_freeContext(sws_ctx);&#xA;            av_packet_unref(packet);&#xA;            av_packet_free(&amp;packet);&#xA;            av_frame_free(frame);&#xA;            avformat_close_input(&amp;format_ctx);&#xA;            avcodec_free_context(&amp;codec_ctx);&#xA;            return NULL;&#xA;        }&#xA;&#xA;        rgb_buffer = (uint8_t *) malloc(rgb_buffer_size);&#xA;        if (rgb_buffer == NULL) {&#xA;            eprintf("failed to allocate RGB buffer\n");&#xA;            sws_freeContext(sws_ctx);&#xA;            av_packet_unref(packet);&#xA;            av_packet_free(&amp;packet);&#xA;            avformat_close_input(&amp;format_ctx);&#xA;            av_frame_free(frame);&#xA;            avcodec_free_context(&amp;codec_ctx);&#xA;            return NULL;&#xA;        }&#xA;&#xA;        uint8_t *dst[4] = {rgb_buffer, NULL, NULL, NULL};&#xA;        int dst_linesize[4] = {0};&#xA;        av_image_fill_linesizes(dst_linesize, AV_PIX_FMT_RGB24, (*frame)->width);&#xA;&#xA;        sws_scale(sws_ctx,&#xA;                            (const uint8_t *const *)(*frame)->data,&#xA;                            (*frame)->linesize,&#xA;                            0,&#xA;                            (*frame)->height,&#xA;                            dst,&#xA;                            dst_linesize);&#xA;&#xA;        sws_freeContext(sws_ctx);&#xA;        av_packet_unref(packet);&#xA;        break;&#xA;    }&#xA;&#xA;    av_packet_unref(packet);&#xA;    av_packet_free(&amp;packet);&#xA;    avformat_close_input(&amp;format_ctx);&#xA;    avcodec_free_context(&amp;codec_ctx);&#xA;&#xA;    return rgb_buffer;&#xA;}&#xA;

    &#xA;

    It loads up first frames of mp4s. The problem is that it works only first 7 times, and then, on 8th call of the showed function malloc(): corrupted top size happens. Specifically when call avcodec_send_packet in the while loop. Executing program using valgrind outputs that :

    &#xA;

    ==21777== Invalid write of size 8&#xA;==21777==    at 0x7426956: ??? (in /usr/lib/libswscale.so.8.1.100)&#xA;==21777==    by 0x18497CBF: ???&#xA;==21777==    by 0x35E3AD3F: ???&#xA;==21777==  Address 0x37f563f0 is 0 bytes after a block of size 2,194,560 alloc&#x27;d&#xA;==21777==    at 0x48447A8: malloc (vg_replace_malloc.c:446)&#xA;==21777==    by 0x1113CB: load_first_frame (main.c:503)&#xA;==21777==    by 0x111995: draw_preview (main.c:605)&#xA;==21777==    by 0x111E7F: render_files (main.c:672)&#xA;==21777==    by 0x11209E: main (main.c:704)&#xA;==21777==&#xA;==21777== Invalid write of size 8&#xA;==21777==    at 0x742695B: ??? (in /usr/lib/libswscale.so.8.1.100)&#xA;==21777==    by 0x18497CBF: ???&#xA;==21777==    by 0x35E3AD3F: ???&#xA;==21777==  Address 0x37f563f8 is 8 bytes after a block of size 2,194,560 alloc&#x27;d&#xA;==21777==    at 0x48447A8: malloc (vg_replace_malloc.c:446)&#xA;==21777==    by 0x1113CB: load_first_frame (main.c:503)&#xA;==21777==    by 0x111995: draw_preview (main.c:605)&#xA;==21777==    by 0x111E7F: render_files (main.c:672)&#xA;==21777==    by 0x11209E: main (main.c:704)&#xA;==21777==&#xA;==21777== Invalid write of size 8&#xA;==21777==    at 0x7426956: ??? (in /usr/lib/libswscale.so.8.1.100)&#xA;==21777==    by 0x183FE37F: ???&#xA;==21777==    by 0x185D16FF: ???&#xA;==21777==  Address 0x389b94e0 is 0 bytes after a block of size 943,200 alloc&#x27;d&#xA;==21777==    at 0x48447A8: malloc (vg_replace_malloc.c:446)&#xA;==21777==    by 0x1113CB: load_first_frame (main.c:503)&#xA;==21777==    by 0x111995: draw_preview (main.c:605)&#xA;==21777==    by 0x111E7F: render_files (main.c:672)&#xA;==21777==    by 0x11209E: main (main.c:704)&#xA;

    &#xA;

    The 503th line is : rgb_buffer = (uint8_t *) malloc(rgb_buffer_size);.

    &#xA;

    Apparently, I double freed something somewhere, but I can't see where exactly. AVFrame **frame that is passed to the function is allocated and freed properly every time using av_frame_alloc and av_frame_free. The mp4 file from file_path is always just a normal video, and it always exists.

    &#xA;

    I've tried loading up different mp4 files, the crash happens every time exactly on 8th call of the function

    &#xA;