Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (9)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • 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

Sur d’autres sites (3500)

  • LIVE555 RTSP H.264 Raw Video File Stream - ffplay Errors

    22 octobre 2015, par Chris.

    I am streaming a raw .h264 video file via RTSP using LIVE555.

    To receive the stream I am using ffplay. However, when watching the video I notice bad video quality and a bunch of errors in the ffplay-console :

    Input #0, rtsp, from 'rtsp://xx.xx.xxx.x/stream': sq=    0B f=0/0
     Metadata:
       title           : stream
       comment         : stream
    Duration: N/A, start: 0.099989, bitrate: N/A
       Stream #0:0: Video: h264 (High), yuv420p(tv, smpte170m/smpte170m/bt470m), 16
    80x1050 [SAR 1:1 DAR 8:5], 60 fps, 60 tbr, 90k tbn, 120 tbc
    [h264 @ 03f92100] RTP: missed 46 packetsq=   28KB sq=    0B f=1/1
    [h264 @ 03f92100] RTP: missed 74 packetsq=   23KB sq=    0B f=1/1
    [h264 @ 03f92100] RTP: missed 43 packets
    [h264 @ 03f92100] RTP: missed 35 packetsq=  179KB sq=    0B f=1/1
    [h264 @ 05710640] left block unavailable for requested intra4x4 mode -1 at 0 38
    [h264 @ 05710640] error while decoding MB 0 38, bytestream 48108
    [h264 @ 05710640] Cannot use next picture in error concealment
    [h264 @ 05710640] concealing 2989 DC, 2989 AC, 2989 MV errors in P frame
    [h264 @ 051043c0] left block unavailable for requested intra4x4 mode -1 at 0 26
    [h264 @ 051043c0] error while decoding MB 0 26, bytestream 5894
    [h264 @ 051043c0] concealing 4249 DC, 4249 AC, 4249 MV errors in I frame
    [h264 @ 03f92100] RTP: missed 68 packetsq=   28KB sq=    0B f=1/1
    [h264 @ 03f92100] RTP: missed 31 packetsq=  153KB sq=    0B f=1/1
    [h264 @ 052a0020] concealing 3292 DC, 3292 AC, 3292 MV errors in I frame
    [h264 @ 052a0020] Cannot use next picture in error concealment1/1
    [h264 @ 052a0020] concealing 2190 DC, 2190 AC, 2190 MV errors in P frame
    [h264 @ 03f92100] RTP: missed 69 packetsq=   27KB sq=    0B f=1/1
    [h264 @ 052a0020] concealing 3732 DC, 3732 AC, 3732 MV errors in I frame
    [h264 @ 03f92100] RTP: missed 26 packetsq=   30KB sq=    0B f=1/1
    ...

    How can I determine what’s wrong here ? Either with the stream or the file ?

  • FFMPEG and DirectX Capture in C++

    13 décembre 2016, par tankyx

    I have a system that allows me to capture a window and save it as a mp4, using ffmpeg. I use gdigrab to capture the frame, but it is fairly slow (60ms per av_read_frame calls)

    I know I can capture a game using the DirectX API, but I don’t know how to convert the resulting BMP to an AVFrame.

    The following code is the DirectX code I use to capture the frame

    extern void* pBits;
    extern IDirect3DDevice9* g_pd3dDevice;
    IDirect3DSurface9* pSurface;
    g_pd3dDevice->CreateOffscreenPlainSurface(ScreenWidth, ScreenHeight,
                                         D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH,
                                         &pSurface, NULL);
    g_pd3dDevice->GetFrontBufferData(0, pSurface);
    D3DLOCKED_RECT lockedRect;
    pSurface->LockRect(&lockedRect,NULL,
                  D3DLOCK_NO_DIRTY_UPDATE|
                  D3DLOCK_NOSYSLOCK|D3DLOCK_READONLY)));
    for( int i=0 ; i < ScreenHeight ; i++)
    {
       memcpy( (BYTE*) pBits + i * ScreenWidth * BITSPERPIXEL / 8 ,
            (BYTE*) lockedRect.pBits + i* lockedRect.Pitch ,
            ScreenWidth * BITSPERPIXEL / 8);
    }
    g_pSurface->UnlockRect();
    pSurface->Release();

    And here is my read loop :

    {
       while (1) {
       if (av_read_frame(pFormatCtx, &packet) < 0 || exit)
           break;
       if (packet.stream_index == videoindex) {
           // Decode video frame
           av_packet_rescale_ts(&packet, { 1, std::stoi(pParser->GetVal("video-fps")) }, pCodecCtx->time_base);
           avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);

           if (frameFinished) {
               pFrame->pts = i;
               i++;
               sws_scale(sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
               pFrameRGB->pts = pFrame->pts;
               enc.encodeFrame(pFrameRGB);

       }
       // Free the packet that was allocated by av_read_frame
       av_free_packet(&packet);
    }

    How can I create an AVFrame using the bmp I have, without using the av_read_frame ?

  • FFmpeg : Decoding AVPackets received from UDP socket

    8 août 2022, par strong_kobayashi

    I am trying to stream video frames encoded with FFmpeg from an Unity game to a client UI via UDP. To be specific, I am sending AVPackets (which contain the compressed frames, as far as I understand) from the server, which are then, on the client side, extracted as follows :

    



    inline UDPpacket* SDLGameClient::receiveData()
{
    if(SDLNet_UDP_Recv(socket, packet))
        return packet;
    else
        return NULL;
}

int main()
{
    ...
    // Initialize UDP
    ...
    UDPpacket *udpPacket;

    int i = 0;

    for(;;)
    {
        udpPacket = client->receiveData();

        if(udpPacket != nullptr)
        {
            i++;
            std::cout << "Packet " << i << " received!" << std::endl;

            AVPacket packet;
            av_init_packet(&packet);

            packet.data = new uint8_t[udpPacket->len];
            memcpy(packet.data, udpPacket->data, udpPacket->len);
            packet.size = udpPacket->len;

            ...


    



    To realize networking, I use the SDL_net library. Fragmenting, sending and receiving the packets seem to work without any problem. My question is, how do I decode the incoming AVPackets and stream the frames recorded in Unity to the client ?
I am aware that I need to use avcodec_send_packet and avcodec_receive_frame for decoding (since avcodec_decode_video2, that is used in many example decoding code, is deprecated), but when I do something like this :

    



    int ret = avcodec_send_packet(codecContext, &packet);
if(ret < 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
    std::cout << "avcodec_send_packet: " << ret << std::endl;
else
{
    while(ret >= 0)
    {
        ret = avcodec_receive_frame(codecContext, frame);
        if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
            std::cout << "avcodec_receive_frame: " << ret << std::endl;

        std::cout << "Frame: " << codecContext->frame_number << std::endl;
    }
}

av_packet_unref(packet);


    



    ret always returns a negative value (-22), so perhaps something is wrong with the AVPackets, or I'm sending the frames way too fast, I really have no clue :/

    



    Thanks in advance for any help !