Recherche avancée

Médias (0)

Mot : - Tags -/logo

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (43)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (7168)

  • ffmpeg error on decode

    25 octobre 2013, par ademar111190

    I'm developing an android app with the libav and I'm trying decode a 3gp with code below :

    #define simbiLog(...) __android_log_print(ANDROID_LOG_DEBUG, "simbiose", __VA_ARGS__)

    ...

    AVCodec *codec;
    AVCodecContext *c = NULL;
    int len;
    FILE *infile, *outfile;
    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
    AVPacket avpkt;
    AVFrame *decoded_frame = NULL;

    simbiLog("inbuf size: %d", sizeof(inbuf) / sizeof(inbuf[0]));

    av_register_all();
    av_init_packet(&avpkt);

    codec = avcodec_find_decoder(AV_CODEC_ID_AMR_NB);
    if (!codec) {
       simbiLog("codec not found");
       return ERROR;
    }

    c = avcodec_alloc_context3(codec);
    if (!c) {
       simbiLog("Could not allocate audio codec context");
       return ERROR;
    }

    int open = avcodec_open2(c, codec, NULL);
    if (open < 0) {
       simbiLog("could not open codec %d", open);
       return ERROR;
    }

    infile = fopen(inputPath, "rb");
    if (!infile) {
       simbiLog("could not open %s", inputPath);
       return ERROR;
    }

    outfile = fopen(outputPath, "wb");
    if (!outfile) {
       simbiLog("could not open %s", outputPath);
       return ERROR;
    }

    avpkt.data = inbuf;
    avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, infile);
    int iterations = 0;

    while (avpkt.size > 0) {
       simbiLog("iteration %d", (++iterations));
       simbiLog("avpkt.size %d avpkt.data %X", avpkt.size, avpkt.data);
       int got_frame = 0;

       if (!decoded_frame) {
           if (!(decoded_frame = avcodec_alloc_frame())) {
               simbiLog("out of memory");
               return ERROR;
           }
       } else {
           avcodec_get_frame_defaults(decoded_frame);
       }

       //below the error, but it isn't occur on first time, only in 4th loop interation
       len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
       if (len < 0) {
           simbiLog("Error while decoding error %d frame %d duration %d", len, got_frame, avpkt.duration);
           return ERROR;
       } else {
           simbiLog("Decoding length %d frame %d duration %d", len, got_frame, avpkt.duration);
       }

       if (got_frame) {
           int data_size = av_samples_get_buffer_size(NULL, c->channels, decoded_frame->nb_samples, c->sample_fmt, 1);
           size_t* fwrite_size = fwrite(decoded_frame->data[0], 1, data_size, outfile);
           simbiLog("fwrite returned %d", fwrite_size);
       }
       avpkt.size -= len;
       avpkt.data += len;
       if (avpkt.size < AUDIO_REFILL_THRESH) {
           memmove(inbuf, avpkt.data, avpkt.size);
           avpkt.data = inbuf;
           len = fread(avpkt.data + avpkt.size, 1, AUDIO_INBUF_SIZE - avpkt.size, infile);
           if (len > 0)
               avpkt.size += len;
           simbiLog("fread returned %d", len);
       }
    }

    fclose(outfile);
    fclose(infile);

    avcodec_close(c);
    av_free(c);
    av_free(decoded_frame);

    but I'm getting the follow log and error :

    inbuf size: 20488
    iteration 1
    avpkt.size 3305 avpkt.data BEEED40C
    Decoding length 13 frame 1 duration 0
    fwrite returned 640
    fread returned 0
    iteration 2
    avpkt.size 3292 avpkt.data BEEED40C
    Decoding length 13 frame 1 duration 0
    fwrite returned 640
    fread returned 0
    iteration 3
    avpkt.size 3279 avpkt.data BEEED40C
    Decoding length 14 frame 1 duration 0
    fwrite returned 640
    fread returned 0
    iteration 4
    avpkt.size 3265 avpkt.data BEEED40C
    Error while decoding error -1052488119 frame 0 duration 0

    the audio file I'm trying decode :

    $ avprobe blue.3gp
    avprobe version 0.8.6-6:0.8.6-1ubuntu2, Copyright (c) 2007-2013 the Libav developers
     built on Mar 30 2013 22:23:21 with gcc 4.7.2
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'blue.3gp':
     Metadata:
       major_brand     : 3gp4
       minor_version   : 0
       compatible_brands: isom3gp4
       creation_time   : 2013-09-19 18:53:38
     Duration: 00:00:01.52, start: 0.000000, bitrate: 17 kb/s
       Stream #0.0(eng): Audio: amrnb, 8000 Hz, 1 channels, flt, 12 kb/s
       Metadata:
         creation_time   : 2013-09-19 18:53:38

    thanks a lot !


    EDITED

    I read on ffmper documentation about the method avcodec_decode_audio4 the follow :

    @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE larger than the actual read bytes because some optimized bitstream readers read 32 or 64 bits at once and could read over the end.
    @note You might have to align the input buffer. The alignment requirements depend on the CPU and the decoder.

    and I see here a solution using posix_memalign, to android i founded a similar method called memalign, so i did the change :

    removed :

    uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];

    inserted :

    int inbufSize = sizeof(uint8_t) * (AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
    uint8_t *inbuf = memalign(FF_INPUT_BUFFER_PADDING_SIZE, inbufSize);
    simbiLog("inbuf size: %d", inbufSize);
    for (; inbufSize >= 0; inbufSize--)
       simbiLog("inbuf position: %d index: %p", inbufSize, &inbuf[inbufSize]);

    I'm getting the correct memory sequence position, but the error not changed.

    A piece of outpout :

    inbuf position: 37 index: 0x4e43d745
    inbuf position: 36 index: 0x4e43d744
    inbuf position: 35 index: 0x4e43d743
    inbuf position: 34 index: 0x4e43d742
    inbuf position: 33 index: 0x4e43d741
    inbuf position: 32 index: 0x4e43d740
    inbuf position: 31 index: 0x4e43d73f
    inbuf position: 30 index: 0x4e43d73e
    inbuf position: 29 index: 0x4e43d73d
    inbuf position: 28 index: 0x4e43d73c
    inbuf position: 27 index: 0x4e43d73b
    inbuf position: 26 index: 0x4e43d73a
    inbuf position: 25 index: 0x4e43d739
    inbuf position: 24 index: 0x4e43d738
    inbuf position: 23 index: 0x4e43d737
    inbuf position: 22 index: 0x4e43d736
    inbuf position: 21 index: 0x4e43d735
    inbuf position: 20 index: 0x4e43d734
    inbuf position: 19 index: 0x4e43d733
  • extracting h264 raw video stream from mp4 or flv with ffmpeg generate an invalid stream

    10 octobre 2013, par neo2006

    I'm trying to extract the video stream from an mp4 or flv h264 video (youtube video) using ffmpeg. The original video (test.flv) play without trouble with ffplay , ffprobe gives an error as follow :

    ffprobe version N-55515-gbbbd959 Copyright (c) 2007-2013 the FFmpeg developers
    built on Aug 13 2013 18:06:32 with gcc 4.7.3 (GCC)
    configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
    isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
    e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
    ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
    amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
    enable-libxvid --enable-zlib
     libavutil      52. 42.100 / 52. 42.100
     libavcodec     55. 27.100 / 55. 27.100
     libavformat    55. 13.102 / 55. 13.102
     libavdevice    55.  3.100 / 55.  3.100
     libavfilter     3. 82.100 /  3. 82.100
     libswscale      2.  4.100 /  2.  4.100
     libswresample   0. 17.103 /  0. 17.103
     libpostproc    52.  3.100 / 52.  3.100
    [flv @ 000000000031ea80] Stream discovered after head already parsed
    Input #0, flv, from 'test.flv':
     Metadata:
       starttime       : 0
       totalduration   : 142
       totaldatarate   : 692
       bytelength      : 12286492
       canseekontime   : true
       sourcedata      : B42B95507HH1381414522145462
       purl            :
       pmsg            :
     Duration: 00:02:22.02, start: 0.000000, bitrate: 692 kb/s
       Stream #0:0: Video: h264 (Main), yuv420p, 640x268, 568 kb/s, 23.98 tbr, 1k t
    bn, 47.95 tbc
       Stream #0:1: Audio: aac, 44100 Hz, stereo, fltp, 131 kb/s
       Stream #0:2: Data: none
    Unsupported codec with id 0 for input stream 2

    to get rid of the extra streams ( I only needs the video) I used the following ffmpeg command line :

    ffmpeg -i test.flv -map 0:0 -vcodec copy -an -f h264 test.h264

    The new stream is unreadable by any player including ffplay and gives an error with ffprobe :
    test.h264 : Invalid data found when processing inputq= 0B f=0/0

    Any body have an idea about what am I doing wrong ?

    I also tried simpler youtube command line :

    ffmpeg -i test.flv -vcodec copy -an test.h264

    if I use another format (avi for example) :

    ffmpeg -i test.flv -vcodec copy -an test.avi

    the output video is valid.

    If I transcode the video

    ffmpeg -i test.flv -an test.h264

    the output is also valid

    Any suggestions ?

  • How to get rotation attribute in metadata using FFMPEG [on hold]

    17 octobre 2013, par user2882101

    I am trying to figure out rotation attribute in metadata using FFMPEG.I use the following command
    FFMPEG -i D :\maxpayne3.mp4

    ffmpeg version N-57217-ga7e3006 Copyright (c) 2000-2013 the FFmpeg developers
    built on Oct 16 2013 22:04:43 with gcc 4.8.1 (GCC)
    configuration : —enable-gpl —enable-version3 —disable-w32threads —enable-av
    isynth —enable-bzlib —enable-fontconfig —enable-frei0r —enable-gnutls —enab
    le-iconv —enable-libass —enable-libbluray —enable-libcaca —enable-libfreetyp
    e —enable-libgsm —enable-libilbc —enable-libmodplug —enable-libmp3lame —ena
    ble-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-l
    ibopus —enable-librtmp —enable-libschroedinger —enable-libsoxr —enable-libsp
    eex —enable-libtheora —enable-libtwolame —enable-libvidstab —enable-libvo-aa
    cenc —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwavp
    ack —enable-libx264 —enable-libxavs —enable-libxvid —enable-zlib
    libavutil 52. 46.101 / 52. 46.101
    libavcodec 55. 37.100 / 55. 37.100
    libavformat 55. 19.102 / 55. 19.102
    libavdevice 55. 4.100 / 55. 4.100
    libavfilter 3. 88.101 / 3. 88.101
    libswscale 2. 5.101 / 2. 5.101
    libswresample 0. 17.103 / 0. 17.103
    libpostproc 52. 3.100 / 52. 3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D :\maxpayne3.mp4' :
    Metadata :
    major_brand : isom
    minor_version : 512
    compatible_brands : isomiso2avc1mp41
    encoder : Lavf54.3.100
    Duration : 00:01:42.42, start : 0.000000, bitrate : 2361 kb/s
    Stream #0:0(und) : Video : h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
    [SAR 1:1 DAR 16:9], 2289 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default
    )
    Metadata :
    handler_name : VideoHandler
    Stream #0:1(und) : Audio : aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 66
    kb/s (default)
    Metadata :
    handler_name : SoundHandler

    I have not seen rotation attribute in metadata ,can anyone pl help me....