Recherche avancée

Médias (91)

Autres articles (88)

  • Qu’est ce qu’un masque de formulaire

    13 juin 2013, par

    Un masque de formulaire consiste en la personnalisation du formulaire de mise en ligne des médias, rubriques, actualités, éditoriaux et liens vers des sites.
    Chaque formulaire de publication d’objet peut donc être personnalisé.
    Pour accéder à la personnalisation des champs de formulaires, il est nécessaire d’aller dans l’administration de votre MediaSPIP puis de sélectionner "Configuration des masques de formulaires".
    Sélectionnez ensuite le formulaire à modifier en cliquant sur sont type d’objet. (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP Player : les contrôles

    26 mai 2010, par

    Les contrôles à la souris du lecteur
    En plus des actions au click sur les boutons visibles de l’interface du lecteur, il est également possible d’effectuer d’autres actions grâce à la souris : Click : en cliquant sur la vidéo ou sur le logo du son, celui ci se mettra en lecture ou en pause en fonction de son état actuel ; Molette (roulement) : en plaçant la souris sur l’espace utilisé par le média (hover), la molette de la souris n’exerce plus l’effet habituel de scroll de la page, mais diminue ou (...)

Sur d’autres sites (7521)

  • ffmpeg libx264 non-existing PPS 0 referenced

    18 août 2014, par Damen Salvatore

    hello i have installed ffmpeg and libx264 based in the offical tutorial on ffmpeg installation here :
    https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

    i want to get an stream from mumudvb and pass it to ffmpeg for h264 encoding
    when i use

    ffserver -f /path/to/config -d

    i get this output :

    [h264 @ 0x1ab32c0] non-existing PPS 0 referenced
    [mpegts @ 0x2c7cca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [h264 @ 0x1ab32c0] non-existing SPS 0 referenced in buffering period
    [h264 @ 0x1ab32c0] non-existing PPS 0 referenced
    [h264 @ 0x1ab32c0] decode_slice_header error
    [h264 @ 0x1ab32c0] no frame!
    [mpegts @ 0x1aadca0]
    decoding for stream 0 failed
    [mpegts @ 0x1aadca0] decoding for stream 1 failed
    Input #0, mpegts, from 'http://127.0.0.1:9097':
     Duration: N/A, start: 45508.714822, bitrate: N/A
     Program 107
    [mpegts @ 0x1aadca0]     Stream #0:0[0x42e]: Video: h264 ([27][0][0][0] / 0x001B)[mpegts @ 0x30b0ca0] decoding for stream 1 failed
    , 50 fpsitech@itech-All-Series:~$ , 50 tbr, 90k tbn, 180k tbc
    [mpegts @ 0x1cd5ca0]     Stream #0:1Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [0x42f](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
    http://127.0.0.1:8888/tv7.ffm: Input/output error
    Input #0, mpegts, from 'http://127.0.0.1:9093':
     Duration: N/A, start: 25560.704144, bitrate: N/A
     Program 103
       Stream #0:0[0x406]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
       Stream #0:1[0x407](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
       Stream #0:2[0x40b](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Received signal 2: terminating.
    [mpegts @ 0x30b0ca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    http://127.0.0.1:8888/tv3.ffm: Input/output error
    [mpegts @ 0x1aadca0] Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpegts, from 'http://127.0.0.1:9094':
    Received signal 2: terminating.
    Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
     Duration: N/A, start: 43409.427056, bitrate: N/A
     Program 104
       Stream #0:0[0x410]Input #0, mpegts, from 'http://127.0.0.1:9098':
    : Video: h264 ([27][0][0][0] / 0x001B), 50 fps, 50 tbr, 90k tbn, 180k tbc
       Stream #0:1[0x411](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
       Stream #0:2[0x415](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    http://127.0.0.1:8888/tv4.ffm: Input/output error
    Received signal 2: terminating.
     Duration: N/A, start: 26351.744300, bitrate: N/A
     Program 108
       Stream #0:0[0x438]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
       Stream #0:1[0x439](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
       Stream #0:2[0x43d](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    http://127.0.0.1:8888/tv8.ffm: Input/output error
    Received signal 2: terminating.

    ffmpeg will gime me the output. but the prooblem is that the outputs bitrate is around 2000k to 3000k it should be 512k

    this is my ffserver config :

    Port 8888
    BindAddress 0.0.0.0
    MaxHTTPConnections 20000
    MaxClients 10000
    MaxBandwidth 1000000
    CustomLog -
    <feed>
    File /tmp/ch1.ffm
    FileMaxSize 100M
    ACL allow 127.0.0.1
    launch ffmpeg -i http://127.0.0.1:9094
    </feed>

    <stream ch1="ch1">
    Feed ch1.ffm
    Format mpegts
    AudioBitRate 64
    AudioChannels 2
    AudioSampleRate 44100
    #AVOptionAudio flags +global_header
    VideoBitRate 512
    VideoBufferSize 400
    VideoFrameRate 25
    VideoBitRateTolerance 100
    VideoSize 720x576
    VideoGopSize 12
    AudioCodec aac
    VideoCodec libx264
    AVOptionVideo bsf h264_mp4toannexb
    #AVOptionVideo threads 0
    AVOptionVideo threads_type frame
    AVOptionVideo coder 0
    AVOptionVideo bf 0
    AVOptionVideo flags +loop
    AVOptionVideo partitions +parti8x8+parti4x4+partp8x8+partb8x8
    AVOptionVideo me_method hex
    AVOptionVideo subq 7
    AVOptionVideo me_range 16
    AVOptionVideo g 250
    AVOptionVideo keyint_min 10
    AVOptionVideo sc_threshold 40
    AVOptionVideo i_qfactor 0.71
    AVOptionVideo b_strategy 1
    AVOptionVideo qcomp 0.6
    AVOptionVideo qmin 10
    AVOptionVideo qmax 51
    AVOptionVideo qdiff 4
    AVOptionVideo refs 3
    AVOptionVideo directpred 1
    AVOptionVideo trellis 1
    AVOptionVideo wpredp 0
    #AVOptionVideo flags +global_header

    StartSendOnKey
    </stream>
  • ffmpeg libx264 non-existing PPS 0 referenced

    18 août 2014, par k961

    hello i have installed ffmpeg and libx264 based in the offical tutorial on ffmpeg installation here :
    https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

    i want to get an stream from mumudvb and pass it to ffmpeg for h264 encoding
    when i use

    ffserver -f /path/to/config -d

    i get this output :

    [h264 @ 0x1ab32c0] non-existing PPS 0 referenced
    [mpegts @ 0x2c7cca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [h264 @ 0x1ab32c0] non-existing SPS 0 referenced in buffering period
    [h264 @ 0x1ab32c0] non-existing PPS 0 referenced
    [h264 @ 0x1ab32c0] decode_slice_header error
    [h264 @ 0x1ab32c0] no frame!
    [mpegts @ 0x1aadca0]
    decoding for stream 0 failed
    [mpegts @ 0x1aadca0] decoding for stream 1 failed
    Input #0, mpegts, from 'http://127.0.0.1:9097':
     Duration: N/A, start: 45508.714822, bitrate: N/A
     Program 107
    [mpegts @ 0x1aadca0]     Stream #0:0[0x42e]: Video: h264 ([27][0][0][0] / 0x001B)[mpegts @ 0x30b0ca0] decoding for stream 1 failed
    , 50 fpsitech@itech-All-Series:~$ , 50 tbr, 90k tbn, 180k tbc
    [mpegts @ 0x1cd5ca0]     Stream #0:1Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [0x42f](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp
    http://127.0.0.1:8888/tv7.ffm: Input/output error
    Input #0, mpegts, from 'http://127.0.0.1:9093':
     Duration: N/A, start: 25560.704144, bitrate: N/A
     Program 103
       Stream #0:0[0x406]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 16:11 DAR 20:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
       Stream #0:1[0x407](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
       Stream #0:2[0x40b](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Received signal 2: terminating.
    [mpegts @ 0x30b0ca0] Could not find codec parameters for stream 0 (Video: h264 ([27][0][0][0] / 0x001B)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    http://127.0.0.1:8888/tv3.ffm: Input/output error
    [mpegts @ 0x1aadca0] Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mpegts, from 'http://127.0.0.1:9094':
    Received signal 2: terminating.
    Could not find codec parameters for stream 1 (Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp): unspecified sample rate
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
     Duration: N/A, start: 43409.427056, bitrate: N/A
     Program 104
       Stream #0:0[0x410]Input #0, mpegts, from 'http://127.0.0.1:9098':
    : Video: h264 ([27][0][0][0] / 0x001B), 50 fps, 50 tbr, 90k tbn, 180k tbc
       Stream #0:1[0x411](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
       Stream #0:2[0x415](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    http://127.0.0.1:8888/tv4.ffm: Input/output error
    Received signal 2: terminating.
     Duration: N/A, start: 26351.744300, bitrate: N/A
     Program 108
       Stream #0:0[0x438]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt470bg), 720x576 [SAR 12:11 DAR 15:11], 25 fps, 50 tbr, 90k tbn, 50 tbc
       Stream #0:1[0x439](per): Audio: aac_latm ([17][0][0][0] / 0x0011), 0 channels, fltp
       Stream #0:2[0x43d](ara): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    http://127.0.0.1:8888/tv8.ffm: Input/output error
    Received signal 2: terminating.

    ffmpeg will gime me the output. but the prooblem is that the outputs bitrate is around 2000k to 3000k it should be 512k

    this is my ffserver config :

    Port 8888
    BindAddress 0.0.0.0
    MaxHTTPConnections 20000
    MaxClients 10000
    MaxBandwidth 1000000
    CustomLog -
    <feed>
    File /tmp/ch1.ffm
    FileMaxSize 100M
    ACL allow 127.0.0.1
    launch ffmpeg -i http://127.0.0.1:9094
    </feed>

    <stream ch1="ch1">
    Feed ch1.ffm
    Format mpegts
    AudioBitRate 64
    AudioChannels 2
    AudioSampleRate 44100
    #AVOptionAudio flags +global_header
    VideoBitRate 512
    VideoBufferSize 400
    VideoFrameRate 25
    VideoBitRateTolerance 100
    VideoSize 720x576
    VideoGopSize 12
    AudioCodec aac
    VideoCodec libx264
    AVOptionVideo bsf h264_mp4toannexb
    #AVOptionVideo threads 0
    AVOptionVideo threads_type frame
    AVOptionVideo coder 0
    AVOptionVideo bf 0
    AVOptionVideo flags +loop
    AVOptionVideo partitions +parti8x8+parti4x4+partp8x8+partb8x8
    AVOptionVideo me_method hex
    AVOptionVideo subq 7
    AVOptionVideo me_range 16
    AVOptionVideo g 250
    AVOptionVideo keyint_min 10
    AVOptionVideo sc_threshold 40
    AVOptionVideo i_qfactor 0.71
    AVOptionVideo b_strategy 1
    AVOptionVideo qcomp 0.6
    AVOptionVideo qmin 10
    AVOptionVideo qmax 51
    AVOptionVideo qdiff 4
    AVOptionVideo refs 3
    AVOptionVideo directpred 1
    AVOptionVideo trellis 1
    AVOptionVideo wpredp 0
    #AVOptionVideo flags +global_header

    StartSendOnKey
    </stream>
  • Problem : FFmpeg and C++ extract and save frame

    26 mai 2021, par Simba_cl25

    I am doing a project where I must do the following : extract frames (along with the associated metadata - KLV) from a video given a period (for the moment every 10 seconds).&#xA;I have followed codes found on internet but I get an error that I can find a solution to.

    &#xA;

    extern "C" {&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavdevice></libavdevice>avdevice.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include <libavfilter></libavfilter>avfilter.h>&#xA;#include <libswresample></libswresample>swresample.h>&#xA;#include <libavutil></libavutil>avutil.h>&#xA;#include <libavutil></libavutil>imgutils.h> &#xA;}&#xA;&#xA;static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame);&#xA;&#xA;&#xA;int main(int argc, const char * argv[])&#xA;{&#xA;    AVFormatContext *pFormatCtx;&#xA;    int             i, videoStream;&#xA;    AVCodecContext  *pCodecCtx = NULL;&#xA;    const AVCodec         *pCodec = NULL;&#xA;    AVFrame         *pFrame;&#xA;    AVFrame         *pFrameRGB;&#xA;    AVPacket        *packet = av_packet_alloc();&#xA;    AVStream        *pStream;&#xA;    int             numBytes;&#xA;    int64_t         Duration;&#xA;    uint8_t         *buffer;&#xA;    bool frameFinished = false;&#xA;&#xA;    // Open video file - check for errors&#xA;    pFormatCtx = 0;&#xA;    if (avformat_open_input(&amp;pFormatCtx, "00Video\\VideoR.ts", 0, 0) != 0)&#xA;        return -1; &#xA;&#xA;    if (avformat_find_stream_info(pFormatCtx, 0) &lt; 0)&#xA;        return -1;&#xA;&#xA;    if (av_find_best_stream(pFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, 0, 0) &lt;0)&#xA;        return -1;&#xA;&#xA;    av_dump_format(pFormatCtx, 0, "00Video\\VideoR.ts", false);&#xA;&#xA;&#xA;    // Find the first video stream&#xA;    videoStream = -1;&#xA;    for (i = 0; i &lt; pFormatCtx->nb_streams; i&#x2B;&#x2B;)&#xA;        if (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)&#xA;        {&#xA;            videoStream = i;&#xA;            break;&#xA;        }&#xA;    if (videoStream == -1)&#xA;        return -1; &#xA;    &#xA;&#xA;&#xA;    // Find the decoder for the video stream&#xA;    pCodec = avcodec_find_decoder(pFormatCtx->streams[videoStream]->codecpar->codec_id);&#xA;    pCodecCtx = avcodec_alloc_context3(pCodec);&#xA;&#xA;    if (pCodec == NULL)&#xA;    {&#xA;        fprintf(stderr, "Codec not found\n");&#xA;        return -1; &#xA;    }&#xA;&#xA;&#xA;    if (avcodec_open2(pCodecCtx, pCodec, NULL) &lt; 0)&#xA;    {&#xA;        fprintf(stderr, "Could not open codec\n");&#xA;        return -1; &#xA;    }&#xA;&#xA;    // Hack to correct wrong frame rates that seem to be generated by some codecs&#xA;    if (pCodecCtx->time_base.num > 1000 &amp;&amp; pCodecCtx->time_base.den == 1)&#xA;        pCodecCtx->time_base.den = 1000;&#xA;&#xA;&#xA;&#xA;&#xA;    // Allocate video frame - original frame &#xA;    pFrame = av_frame_alloc();&#xA;&#xA;    if (!pFrame) {&#xA;        fprintf(stderr, "Could not allocate video frame\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;&#xA;    // Allocate an AVFrame structure&#xA;    pFrameRGB = av_frame_alloc();&#xA;&#xA;    if (pFrameRGB == NULL)&#xA;    {&#xA;        fprintf(stderr, "Could not allocate video RGB frame\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    &#xA;    Duration = av_rescale_q(vstrm->duration, vstrm->time_base, { 1,1000 });&#xA;    &#xA;    numBytes = av_image_get_buffer_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, 0);&#xA;    buffer = (uint8_t*)av_malloc(numBytes * sizeof(uint8_t));&#xA;&#xA;&#xA;    av_image_fill_arrays(pFrameRGB->data, pFrameRGB->linesize, buffer, AV_PIX_FMT_RGB24, pCodecCtx->width, pCodecCtx->height, 1);&#xA;    &#xA;    &#xA;        &#xA;    &#xA;    i = 0;&#xA;    while (av_read_frame(pFormatCtx, packet) >= 0)&#xA;    {&#xA;        // Is this a packet from the video stream?&#xA;        if (packet->stream_index == videoStream)&#xA;        {&#xA;            int ret;&#xA;            ret = avcodec_send_packet(pCodecCtx, packet);&#xA;            if (ret &lt; 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {&#xA;                fprintf(stderr, "Error sending a packet for decoding\n");&#xA;                //break;&#xA;            }&#xA;            while (ret >= 0) {&#xA;                ret = avcodec_receive_frame(pCodecCtx, pFrame);&#xA;                if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;                    return -1;&#xA;                else if (ret &lt; 0) {&#xA;                    fprintf(stderr, "Error during decoding\n");&#xA;                    return -1;&#xA;                 frameFinished = true;&#xA;                }&#xA;&#xA;&#xA;                // Did we get a video frame?&#xA;                if (frameFinished)&#xA;                {&#xA;                    static struct SwsContext *img_convert_ctx;&#xA;&#xA;                    &#xA;                    if (img_convert_ctx == NULL) {&#xA;                        int w = pCodecCtx->width;&#xA;                        int h = pCodecCtx->height;&#xA;                        img_convert_ctx = sws_getContext(w, h,&#xA;                            pCodecCtx->pix_fmt,&#xA;                            w, h, AV_PIX_FMT_RGB24, SWS_FAST_BILINEAR,&#xA;                            NULL, NULL, NULL);&#xA;&#xA;                        if (img_convert_ctx == NULL) {&#xA;                            fprintf(stderr, "Cannot initialize the conversion context!\n");&#xA;                            exit(1);&#xA;                        }&#xA;                    }&#xA;&#xA;                    int ret = sws_scale(img_convert_ctx, pFrame->data, pFrame->linesize, 0,&#xA;                        pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);&#xA;&#xA;&#xA;                    // Save the frame to disk&#xA;                    if (i &lt;= Duration)&#xA;                    {&#xA;                        SaveFrame(pFrameRGB, pCodecCtx->width, pCodecCtx->height, i);&#xA;                        i &#x2B;= 10*1000;&#xA;                    }&#xA;                }&#xA;            }&#xA;&#xA;        &#xA;        }&#xA;&#xA;        // Free the packet that was allocated by av_read_frame&#xA;        av_packet_unref(packet);&#xA;    }&#xA;&#xA;    &#xA;&#xA;    // Free the RGB image&#xA;    free(buffer);&#xA;    av_free(pFrameRGB);&#xA;&#xA;    // Free the YUV frame&#xA;    av_free(pFrame);&#xA;&#xA;    // Close the codec&#xA;    avcodec_close(pCodecCtx);&#xA;&#xA;    // Close the video file&#xA;    avformat_close_input(&amp;pFormatCtx);&#xA;    return 0;&#xA;    &#xA;}&#xA;&#xA;&#xA;&#xA;&#xA;static void SaveFrame(AVFrame *pFrame, int width, int height, int iFrame)&#xA;{&#xA;    FILE *pFile;&#xA;    char szFilename[32];&#xA;    int  y;&#xA;&#xA;&#xA;    // Open file&#xA;    sprintf(szFilename, "Im\\frame%d.png", iFrame);&#xA;    pFile = fopen(szFilename, "wb");&#xA;    if (pFile == NULL)&#xA;        return;&#xA;&#xA;    // Write header&#xA;    fprintf(pFile, "P6\n%d %d\n255\n", width, height);&#xA;    // Write pixel data&#xA;    for (y = 0; y &lt; height; y&#x2B;&#x2B;)&#xA;        fwrite(pFrame->data[0] &#x2B; y * pFrame->linesize[0], 1, width*3, pFile);&#xA;&#xA;    // Close file&#xA;    fclose(pFile);&#xA;}&#xA;

    &#xA;

    The error I get is :

    &#xA;

    [swscaler @ 03055A80] bad dst image pointers&#xA;

    &#xA;

    I think is because

    &#xA;

    numBytes = av_image_get_buffer_size(pCodecCtx->pix_fmt, pCodecCtx->width, pCodecCtx->height, 0);&#xA;

    &#xA;

    Returns a negative value ( -22) but I don't know why.

    &#xA;

    Thanks,

    &#xA;