Recherche avancée

Médias (0)

Mot : - Tags -/organisation

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

Autres articles (62)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

Sur d’autres sites (8190)

  • Evolution #3958 : Mise à jour de la liste des types mines

    12 juin 2017, par nico d_

    Hop, pour information ce sont les type MIME, pas mines :)
    Type mine c’est pour les voitures ^^
    https://fr.wikipedia.org/wiki/Type_MIME

    Et sinon, ils sont indiqués ici dans le tableau apparemment :
    https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format#Brands_and_MIME_types

  • Minimal sample of muxing two streams with no reencoding (av_interleaved_write_frame fails)

    19 juillet 2022, par Alvein

    What I'm trying to do : having two files, one is video-only and the other is audio-only, with identical durations, I want to "join" them in a single container.

    


    I previously made a routine which just copied all the streams inside a container to another one. No reencoding, etc. This works perfectly :

    


    while(true) {
    pkIn=av_packet_alloc();
    if(NULL==pkIn) {
        fprintf(stderr,"av_packet_alloc() failed");
        break;
    }
    iError=av_read_frame(fcIn,pkIn);
    if(0>iError)
        if(AVERROR_EOF==iError)
            break;
        else {
            fprintf(stderr,"av_read_frame() failed");
            break;
        }
    stIn=fcIn->streams[pkIn->stream_index];
    stOut=fcOut->streams[pkIn->stream_index];
    log_packet(fcIn,pkIn,"in");
    av_packet_rescale_ts(pkIn,stIn->time_base,stOut->time_base);
    pkIn->pos=-1;
    log_packet(fcOut,pkIn,"out");
    iError=av_interleaved_write_frame(fcOut,pkIn);
    if(0>iError) {
        fprintf(stderr,"av_interleaved_write_frame() failed");
        break;
    }
    av_packet_free(&pkIn);
}


    


    I just did the analogy and tried to do the same, but taking each stream from a distinct container, like this :

    


    while(true) {
    if(!bVideoInEOF) {
        pkVideoIn=av_packet_alloc();
        if(NULL==pkVideoIn) {
            fprintf(stderr,"av_packet_alloc(video in) failed");
            break;
        }
        iError=av_read_frame(fcVideoIn,pkVideoIn);
        if(0>iError)
            if(AVERROR_EOF==iError)
                bVideoInEOF=true;
            else {
                fprintf(stderr,"av_read_frame(video in) failed");
                break;
            }
        if(!bVideoInEOF) {
            log_packet(fcVideoIn,pkVideoIn,"video in");
            av_packet_rescale_ts(pkVideoIn,stVideoIn->time_base,stVideoOut->time_base);
            pkVideoIn->pos=-1;
            pkVideoIn->stream_index=stVideoOut->index; // Edit (2022-07-19)
            log_packet(fcVideoIn,pkVideoIn,"video out");
            iError=av_interleaved_write_frame(fcOut,pkVideoIn);
            if(0>iError) {
                fprintf(stderr,"av_interleaved_write_frame(video out) failed");
                break;
            }
        }
        av_packet_free(&pkVideoIn);
    }
    if(!bAudioInEOF) {
        pkAudioIn=av_packet_alloc();
        if(NULL==pkAudioIn) {
            fprintf(stderr,"av_packet_alloc(audio in) failed");
            break;
        }
        iError=av_read_frame(fcAudioIn,pkAudioIn);
        if(0>iError)
            if(AVERROR_EOF==iError)
                bAudioInEOF=true;
            else {
                fprintf(stderr,"av_read_frame(audio in) failed");
                break;
            }
        if(!bAudioInEOF) {
            log_packet(fcAudioIn,pkAudioIn,"audio in");
            av_packet_rescale_ts(pkAudioIn,stAudioIn->time_base,stAudioOut->time_base);
            pkAudioIn->pos=-1;
            pkAudioIn->stream_index=stAudioOut->index; // Edit (2022-07-19)
            log_packet(fcAudioIn,pkAudioIn,"audio out");
            iError=av_interleaved_write_frame(fcOut,pkAudioIn);
            if(0>iError) {
                fprintf(stderr,"av_interleaved_write_frame(audio out) failed");
                break;
            }
        }
        av_packet_free(&pkAudioIn);
    }
    if(bVideoInEOF&&bAudioInEOF)
        break;
}


    


    I know the previous code looks like redundant but I wanted to leave both streams "processing" separated the way you understand my plans.

    


    Anyway, that code ends quickly with "av_interleaved_write_frame(audio out) failed".

    


    The error detail is "Invalid argument", and the debugger shows this :

    


    


    Application provided invalid, non monotonically increasing dts to
muxer in stream 0.

    


    


    If I disable any of the main blocks "if(!bVideoInEOF)" / "if(!bAudioInEOF)", the file is written successfully, with the obvious lack of the disabled stream.

    


    I'm new into using this library so probably I'm doing something really stupid, or missing something obvious.

    


    Suggestions ?

    


    Edit (2022-07-19) :

    


    By checking the logs, I noticed I was writing every frame to the stream #0. Hence, the horrible jumps in PTS/DTS.

    


    Code edited by adding the corresponding "...->stream_index=" before each call to av_interleaved_write_frame().

    


    ...

    


    Though it works, I still think my code is far from perfect. Comments are welcome.

    


  • Encode Frames to Video with C Library

    31 juillet 2018, par NetherGranite

    For the sake of continuity, let us assume "RGB values" are the following :

    typedef struct RGB {
       uint8_t r, g, b;
    } rgb;

    However, if you feel that a different color space is more appropriate for this question, please use that instead.

    How might I go about writing 2D arrays of RGB values to a video in C given an output format and framerate ?

    Before I continue, I should specify that I wish to be able to do this all within one program. I am trying to add functionality to an application that would allow it to compile videos frame by frame without having to leave it.

    Additionally, my needs for this functionality are extremely basic ; I simply need to be able to set individual pixels to certain colors.

    The closest I have come to a solution so far is the C library FFmpeg. Allow me to describe what I was able to learn on my own :

    After looking through its documentation, I came across the function avcodec_send_frame(avctx, frame), whose parameters are of the types AVCodexContext* and const AVFrame* respectively. If these are not the right tools for what I am trying to do, please ignore the rest of the question and instead point me towards what I should be using.

    However, I do not know which fields of avctx and frame must be set manually and which do not. The reason I assume some do not is because both are extremely large structures, but correct me if I am wrong.

    Question 1 : What values of an AVCodecContext and AVFrame must be set ? Of these, what is/are the recommended value(s) for each of them ?

    Additionally, I was only able to find instructions on how to initialize an AVFrame (using av_frame_alloc() and av_frame_get_buffer()) but not for an AVCodexConstant.

    Question 2 : Is there a proper way to initialize an AVCodexConstant ? And just in case, is the method of initializing an AVFrame described above correct ? Do any of the fields of either have a proper method of initialization ?

    Also, I was not able to find official documentation on how to take this AVCodexConstant (which I assume contains the video information) and turn it into a video. I apologize if the documentation for this is easy to find and I just missed it.

    Question 3 : How do I turn an AVCodexConstant into a file of a given format ?

    And, given my limited knowledge :

    Question 4 : Are there any other parts to this process that I am missing, and do I have any of the above parts wrong ?


    Please keep in mind that I found out about FFmpeg for the first time very recently, and as a result, I am a complete beginner to this. Additionally, my experience with C is very limited, so I would greatly appreciate it if you could note which files need to be included with #include.

    Feel free to even go as far as recommending something other than FFmpeg, just as long as it is written in C. I do not need power-user options, but I would greatly prefer flexibility in what audio and video file types the library can handle.


    Addressing Potential Duplicates

    I appologize for how long this section is ; I just want to have my bases covered. I heavily apologize, however, if this is in fact a duplicate of a question that I was just unable to find.

    • ffmpeg C API documentation/tutorial [closed] — This question was too open-ended and received answers pointing the asker towards a tutorial at dranger.com, a tutorial that confusingly muddied the waters by focusing heavily on a graphics library of choice. Please do not take this as me saying it is bad ; I am just enough of a beginner that I could not wade through it all.
    • Encoding frames to video with ffmpeg — Although this question seems to have been asking the same thing, it is geared towards Unreal Engine 4, and the asker provided sample code, making it difficult for me to understand which of parts of the accepted answer were necessary for me and which were not.
    • How to write frames to a video file ? — While this also asked the same thing, the accepted answer simply provides a command instead of an explanation of code.
    • YUV Raw frames to video stream — While the accepted answer for this question is a command, the question states that it is looking for a way to encode frames generated by C++ code. Is there some way to run commands in code that I haven’t been able to find ?
    • Converting sequenced frames to video — Not only is the asker’s code written in Python, but it also seems to use already-existing image files as frames.
    • How to write bitmaps as frames to H.264 with x264 in C\C++ ? — The accepted answer seems to describe a process that would take multiple applications, but I could be wrong as I am enough of a beginner that I am not sure exactly what it means other than Step 3.
    • How to write bitmaps as frames to Ogg Theora in C\C++ ? — Although it isn’t a problem that the question specifies the ogg format, it is a problem that the accepted answer suggests libtheora, which appears to only work with ogg files.