Recherche avancée

Médias (0)

Mot : - Tags -/interaction

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

Autres articles (39)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

Sur d’autres sites (6168)

  • libavcodec : ffprobe on file encoded with FFV1 codec reports "read_quant_table error"

    20 novembre 2016, par Ali Alidoust

    I’m using the following code to encode a series of frames into an mkv or avi file with FFV1 encoding :

      HRESULT Session::createContext(LPCSTR filename, UINT width, UINT height, UINT fps_num, UINT fps_den) {
       LOG("Exporting to file: ", filename);

       AVCodecID codecId = AV_CODEC_ID_FFV1;
       this->pixelFormat = AV_PIX_FMT_YUV420P;

       this->codec = avcodec_find_encoder(codecId);
       RET_IF_NULL(this->codec, "Could not create codec", E_FAIL);

       this->oformat = av_guess_format(NULL, filename, NULL);
       RET_IF_NULL(this->oformat, "Could not create format", E_FAIL);
       this->oformat->video_codec = codecId;
       this->width = width;
       this->height = height;
       this->codecContext = avcodec_alloc_context3(this->codec);
       RET_IF_NULL(this->codecContext, "Could not allocate context for the codec", E_FAIL);

       this->codecContext->codec = this->codec;
       this->codecContext->codec_id = codecId;

       this->codecContext->pix_fmt = pixelFormat;
       this->codecContext->width = this->width;
       this->codecContext->height = this->height;
       this->codecContext->time_base.num = fps_den;
       this->codecContext->time_base.den = fps_num;

       this->codecContext->gop_size = 1;


       RET_IF_FAILED_AV(avformat_alloc_output_context2(&fmtContext, this->oformat, NULL, NULL), "Could not allocate format context", E_FAIL);
       RET_IF_NULL(this->fmtContext, "Could not allocate format context", E_FAIL);

       this->fmtContext->oformat = this->oformat;
       this->fmtContext->video_codec_id = codecId;

       this->stream = avformat_new_stream(this->fmtContext, this->codec);
       RET_IF_NULL(this->stream, "Could not create new stream", E_FAIL);
       this->stream->time_base = this->codecContext->time_base;
       RET_IF_FAILED_AV(avcodec_parameters_from_context(this->stream->codecpar, this->codecContext), "Could not convert AVCodecContext to AVParameters", E_FAIL);

       if (this->fmtContext->oformat->flags & AVFMT_GLOBALHEADER)
       {
           this->codecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;
       }

       av_opt_set_int(this->codecContext->priv_data, "coder", 0, 0);
       av_opt_set_int(this->codecContext->priv_data, "context", 1, 0);
       av_opt_set_int(this->codecContext->priv_data, "slicecrc", 1, 0);
       //av_opt_set_int(this->codecContext->priv_data, "slicecrc", 1, 0);
       //av_opt_set_int(this->codecContext->priv_data, "pix_fmt", pixelFormat, 0);

       RET_IF_FAILED_AV(avcodec_open2(this->codecContext, this->codec, NULL), "Could not open codec", E_FAIL);
       RET_IF_FAILED_AV(avio_open(&this->fmtContext->pb, filename, AVIO_FLAG_WRITE), "Could not open output file", E_FAIL);
       RET_IF_NULL(this->fmtContext->pb, "Could not open output file", E_FAIL);
       RET_IF_FAILED_AV(avformat_write_header(this->fmtContext, NULL), "Could not write header", E_FAIL);

       frame = av_frame_alloc();
       RET_IF_NULL(frame, "Could not allocate frame", E_FAIL);
       frame->format = this->codecContext->pix_fmt;
       frame->width = width;
       frame->height = height;
       return S_OK;
    }

    HRESULT Session::writeFrame(IMFSample * pSample) {
       IMFMediaBuffer *mediaBuffer = NULL;
       BYTE *pDataNV12 = NULL;
       DWORD length;

       RET_IF_FAILED(pSample->ConvertToContiguousBuffer(&mediaBuffer), "Could not convert IMFSample to contagiuous buffer", E_FAIL);
       RET_IF_FAILED(mediaBuffer->GetCurrentLength(&length), "Could not get buffer length", E_FAIL);
       RET_IF_FAILED(mediaBuffer->Lock(&pDataNV12, NULL, NULL), "Could not lock the buffer", E_FAIL);
       BYTE *pDataYUV420P = new BYTE[length];
       this->convertNV12toYUV420P(pDataNV12, pDataYUV420P, this->width, this->height);
       RET_IF_FAILED(av_image_fill_arrays(frame->data, frame->linesize, pDataYUV420P, pixelFormat, this->width, this->height, 1), "Could not fill the frame with data from the buffer", E_FAIL);
       LOG_IF_FAILED(mediaBuffer->Unlock(), "Could not unlock the buffer");

       frame->pts = av_rescale_q(this->pts++, this->codecContext->time_base, this->stream->time_base);

       AVPacket pkt;

       av_init_packet(&pkt);
       pkt.data = NULL;
       pkt.size = 0;

       RET_IF_FAILED_AV(avcodec_send_frame(this->codecContext, frame), "Could not send the frame to the encoder", E_FAIL);
       delete[] pDataYUV420P;
       if (SUCCEEDED(avcodec_receive_packet(this->codecContext, &pkt))) {
           RET_IF_FAILED_AV(av_interleaved_write_frame(this->fmtContext, &pkt), "Could not write the received packet.", E_FAIL);
       }

       av_packet_unref(&pkt);

       return S_OK;
    }

    HRESULT Session::endSession() {
       LOG("Ending session...");

       LOG("Closing files...")
       LOG_IF_FAILED_AV(av_write_trailer(this->fmtContext), "Could not finalize the output file.");
       LOG_IF_FAILED_AV(avio_close(this->fmtContext->pb), "Could not close the output file.");
       LOG_IF_FAILED_AV(avcodec_close(this->codecContext), "Could not close the codec.");
       av_free(this->codecContext);
       LOG("Done.")
       return S_OK;
    }

    The problem is that the generated file is not playable in either VLC or MPC-HC. However, MPC-HC reports following info in file properties :

    General
    Unique ID                      : 202978442142665779317960161865934977227 (0x98B439D9BE859109BD5EC00A62A238CB)
    Complete name                  : T:\Test.mkv
    Format                         : Matroska
    Format version                 : Version 4 / Version 2
    File size                      : 24.6 MiB
    Duration                       : 147ms
    Overall bit rate               : 1 401 Mbps
    Writing application            : Lavf57.57.100
    Writing library                : Lavf57.57.100

    Video
    ID                             : 1
    Format                         : FFV1
    Format version                 : Version 0
    Codec ID                       : V_MS/VFW/FOURCC / FFV1
    Duration                       : 147ms
    Width                          : 1 280 pixels
    Height                         : 720 pixels
    Display aspect ratio           : 16:9
    Frame rate mode                : Constant
    Frame rate                     : 1 000.000 fps
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Compression mode               : Lossless
    Default                        : Yes
    Forced                         : No
    DURATION                       : 00:00:00.147000000
    coder_type                     : Golomb Rice

    Something to note is that it reports 1000 FPS which is weird since I’ve set AVCodecContext::time_base in the code.

    UPDATE 1 :

    I managed to set the correct fps by setting time_base property of the stream :

    this->stream->time_base.den = fps_num;
    this->stream->time_base.num = fps_den;

    VLC plays the output file but it shows VLC logo instead of the video, as if there is no video stream in the file.

    UPDATE 2 :

    Cleaned up the code. Now if I set codecId = AV_CODEC_ID_MPEG2VIDEO the output file is valid and is played in both VLC and MPC-HC. Using ffprobe on the file with FFV1 encoding yields the following result :

    C:\root\apps\ffmpeg>ffprobe.exe t:\test.avi
    ffprobe version 3.2 Copyright (c) 2007-2016 the FFmpeg developers
     built with gcc 5.4.0 (GCC)
     configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
     libavutil      55. 34.100 / 55. 34.100
     libavcodec     57. 64.100 / 57. 64.100
     libavformat    57. 56.100 / 57. 56.100
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    [ffv1 @ 00000000006b83a0] read_quant_table error
    Input #0, avi, from 't:\test.avi':
     Metadata:
       encoder         : Lavf57.56.100
     Duration: 00:00:04.94, start: 0.000000, bitrate: 107005 kb/s
       Stream #0:0: Video: ffv1 (FFV1 / 0x31564646), yuv420p, 1280x720, 107717 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc
  • Does the "live=1" on ffmpeg rtmp urls mean that the stream is live and you cannot rewind or pause it ?

    23 octobre 2014, par user306517

    Or does it have some other meaning ? I have searched all over the internet, and the documentation is very thin on it... If someone could point me to something that explains exactly what it is, I would appreciate it.

    I am talking about this :

    ffmpeg "rtmp ://...... live=1" .....

    tia.

  • Revert "rtpenc_chain : Don’t copy the time_base back to the caller"

    29 mai 2014, par Martin Storsjö
    Revert "rtpenc_chain : Don’t copy the time_base back to the caller"
    

    While it strictly isn’t necessary to copy the time base (since
    any use of it is scaled in ff_write_chained), it still is better
    to signal the actual time base to the caller, avoiding one
    unnecessary rescaling. This also lets the caller know what the
    actual internal time base is, in case that is useful info
    for some caller.

    This reverts commit 397ffde115f4e0482a007b672f40457596cebfc4.

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

    • [DBH] libavformat/rtpenc_chain.c