Recherche avancée

Médias (0)

Mot : - Tags -/flash

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

Autres articles (36)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

Sur d’autres sites (4458)

  • Covert opengl framebuffer into ffmpeg encoded mp4 c++ [closed]

    14 mai 2022, par user19068953

    I want to make a program that takes an mp4 file as an input and draws something on top of it then gives the new video as an output. So far I have a program that takes a file name, have ffmpeg decode it and draw whatever i want with opengl (I have followed this tutorial that draws on top of the video separately : https://gist.github.com/hradec/a8b8ae0bf82891a5d853b06619839d9d) and have an opengl framebuffer. My question is how do put opengl's framebuffer on top of ffmpeg frames and generate a new video with it then give a new file as an output ? The framebuffer is allocated in fbo, so i want to encode it to ffmpeg, something like

    


     av_write_frame(state->fmt_ctx, &fbo) 


    


    is there a function like this that allows me to write frame data into a newly created video ?

    


    Here is my encoder :

    


        int VideoDecoder::write_frame()
{
    // Find a way to write OpenGL Frames here.
    av_packet_rescale_ts(&state->packet, VideoSt.Ctx->time_base, VideoSt.Stream->time_base);
    state->packet.stream_index = VideoSt.Stream->index;
    return av_interleaved_write_frame(state->fmt_ctx, &state->packet);
}


bool VideoDecoder::encode_video()
{

    // TODO: This is horrible fix this function.

    state->packet = { nullptr };
    av_init_packet(&state->packet);

    fflush(stdout);

    IMG_Buffer.SetNum(ColorBuffer.Num() * 4);
    uint8* DestPtr = nullptr;
    for (auto i = 0; i < ColorBuffer.Num(); i++)
    {
        DestPtr = &IMG_Buffer[i * 4];
        auto SrcPtr = ColorBuffer[i];
        *DestPtr++ = SrcPtr.R;
        *DestPtr++ = SrcPtr.G;
        *DestPtr++ = SrcPtr.B;
        *DestPtr++ = SrcPtr.A;
    }

    uint8* inData[1] = { IMG_Buffer.GetData() };


    sws_scale(SwsCtx, inData, InLineSize, 0, VideoSt.Ctx->height, VideoSt.Frame->data, VideoSt.Frame->linesize);

    VideoSt.Frame->pts = VideoSt.NextPts++;
    if (FFmpegEncode(VideoSt.Frame) < 0)
        return false;

    auto ret = WriteFrame();

    if (ret < 0)
    {
        auto errstr = FString(av_err2str(ret));
    }
    av_packet_unref(&state->packet);


    GotOutput = 0;
    auto ret = avcodec_send_frame(VideoSt.Ctx, frame);
    if (ret < 0 && ret != AVERROR_EOF) {
        auto errstr = FString(av_err2str(ret));
        return -1;
    }

    ret = avcodec_receive_packet(VideoSt.Ctx, &Pkt);
    if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
        return 0;

    if (ret < 0)
    {
        auto errstr = FString(av_make_error_string(ret).c_str());
        av_packet_unref(&Pkt);
        return -1;
    }

    GotOutput = 1;
    return 0;


    for (GotOutput = 1; GotOutput; count++)
    {
        fflush(stdout);

        FFmpegEncode(nullptr);

        if (GotOutput)
        {
            auto ret = WriteFrame(false);
            if (ret < 0)
            {
                auto errstr = FString(av_err2str(ret));
            }
            av_packet_unref(&Pkt);
        }
    }

    auto ret = av_write_trailer(FmtCtx);
    if (ret < 0)
    {
        auto errstr = FString(av_err2str(ret));
    }
}


    


    and here is my simple frame buffer :

    


    bool OpenGLRenderer::alloc_frame_buffer()
{
    unsigned int fbo;
    glGenFramebuffers(1, &fbo);

    if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) return false;

    glBindFramebuffer(GL_FRAMEBUFFER, fbo);

    unsigned int texture;
    glGenTextures(1, &texture);
    glBindTexture(GL_TEXTURE_2D, texture);

    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 800, 600, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);

    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
}


    


  • Using Windows named pipes with ffmpeg pipes (Doesnt work)

    25 octobre 2019, par Estr

    I’m trying to send audio and video RAW through c# pipes to FFMPEG, I’ve been reading and trying to follow what’s shown here : https://docs.microsoft.com/en-us/dotnet/api/system.io.pipes.namedpipeserverstream?view=netframework-4.8

    This a fragment of the code...

           NamedPipeServerStream p_1;
           NamedPipeServerStream p_2;
           p_1 = new NamedPipeServerStream("p_1", PipeDirection.Out, 1, PipeTransmissionMode.Byte);
           p_2 = new NamedPipeServerStream("p_2", PipeDirection.Out, 1, PipeTransmissionMode.Byte);

           p_1.WaitForConnection();

           p_2.WaitForConnection();

    .......

    I run this command in FFMPEG : ffmpeg.exe -i \.\pipe\p_1 -vcodec hevc -r 8 -f alaw -ar:a 16000 -ac:a 1 -i \.\pipe\p_2 o.mp4

    But the program stays on the line : p_2.WaitForConnection() ;

    How can I solve it ?

  • Encode h264 automatically on nginx server

    18 février 2017, par Thinh Pham

    I have installed and configured my own streaming server using Nginx with rtmp module base on this tutorial https://www.vultr.com/docs/setup-nginx-on-ubuntu-to-stream-live-hls-video. I only use live application and record stream into flv file. And now I want to encode any new flv files in my VOD directory automatically to play it on my website. Is it possible to config it in my nginx.conf ? I have tried set record_suffix .mp4; in order to play it without encode but failed.
    Additional, exec ffmpeg -i is not work for me when I want to restream into mobile application.