Recherche avancée

Médias (1)

Mot : - Tags -/ogg

Autres articles (11)

  • 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" ;

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

Sur d’autres sites (3408)

  • Error to encode audio though out the video in FFmpegFrameRecorder

    28 mars 2016, par Ragghwendra Suryawanshi

    Hello Stack World,

    I am trying to crate video from images in android using FFMpeg and
    javacv. I am able to crate video from images with out audio, when i try
    the same thing with audio video is crated but audio is just for 1
    sec of the video

           FFmpegFrameRecorder myFFmpegFrameRecorder = new FFmpegFrameRecorder(new StringBuilder(String.valueOf(strPath)).append("/").append(this.FileName).toString(), 640, 480, frameGrabber.getAudioChannels());
           myFFmpegFrameRecorder.setVideoCodec(13);
           myFFmpegFrameRecorder.setFormat("mp4");
           myFFmpegFrameRecorder.setPixelFormat(0);
           myFFmpegFrameRecorder.setSampleFormat(frameGrabber.getSampleFormat());
           myFFmpegFrameRecorder.setSampleRate(44100);
           myFFmpegFrameRecorder.setFrameRate(1.0d);
           myFFmpegFrameRecorder.setVideoBitrate(AccessibilityEventCompat.TYPE_TOUCH_INTERACTION_START);
           myFFmpegFrameRecorder.setAudioCodec(avcodec.AV_CODEC_ID_MP3);
           boolean isAudioFinish = false;
           try {
               frameGrabber.start();
               IplImage iplimage = new IplImage();
               myFFmpegFrameRecorder.start();
               for (int i = 0; i <= imgname - 1; i++) {
                   for (int j = 0; j <= 6; j++) {
                       Frame frame = frameGrabber.grabFrame();
                       if (frame != null) {
                           myFFmpegFrameRecorder.record(frame);
                       }
                       long l1 = 1000L * (System.currentTimeMillis() - l);
                       if (l1 < myFFmpegFrameRecorder.getTimestamp()) {
                           l1 = 1000L + myFFmpegFrameRecorder.getTimestamp();
                       }
                       myFFmpegFrameRecorder.setTimestamp(l1);
                   }

                   iplimage = opencv_highgui.cvLoadImage(myObjects.get(i).toString());
                   myFFmpegFrameRecorder.record(iplimage);
                   opencv_core.cvReleaseImage(iplimage);
               }
               myFFmpegFrameRecorder.stop();
               frameGrabber.stop();
           } catch (Exception e) {
               e.printStackTrace();
           }

    Please help me to solve it. I am missing something due to which it not working out here. I have read doc of the FFmpegFrameRecorder but unable to find my error.

  • How can I get start time of rtsp-sesson via ffmpeg (C++) ? start_time_realtime always equal -9223372036854775808

    5 août 2019, par chuchuchu

    I’m trying to get a frame by rtsp and calculate its real-world timestamp. I previously used Live555 for this (presentationTime).

    As far as I understand, ffmpeg does not provide such functionality, but provides the ability to read the relative time of each frame and the start time of the stream. In my case, the frame timestamps (pts) works correctly, but the stream start time (start_time_realtime) is always -9223372036854775808.

    I’m trying to use simple example from this Q : https://stackoverflow.com/a/11054652/5355846

    Value does not change. regardless of the position in the code

    int main(int argc, char** argv) {
       // Open the initial context variables that are needed
       SwsContext *img_convert_ctx;
       AVFormatContext* format_ctx = avformat_alloc_context();
       AVCodecContext* codec_ctx = NULL;
       int video_stream_index;

       // Register everything
       av_register_all();
       avformat_network_init();

       //open RTSP
       if (avformat_open_input(&format_ctx, "path_to_rtsp_stream",
                               NULL, NULL) != 0) {
           return EXIT_FAILURE;
       }
       ...
    }
    while (av_read_frame(format_ctx, &packet) >= 0 && cnt < 1000) { //read ~ 1000 frames

           //// here!
           std::cout<< " ***** "
           << std::to_string(format_ctx->start_time_realtime)
           << " | "<start_time
           << " | "<best_effort_timestamp;

    ...
    }

    ***** -9223372036854775808 | 0 | 4120 | 40801 Frame : 103

    What am I doing wrong ?

  • How to write a text in a frame using ffmpeg

    21 février 2024, par Jorge Augusto Wilchen

    I need to write a text in every frame before write in the video file, this text will be passed as a argument (std::string or char, whatever you want to best solution). For example, write "Hello World" 24px, color yellow, position 30x30.

    


    How can i do this ?

    


    This is my function that read frames to a AVPacket and write in the video file :

    


    bool VideoRecorder::record_video()
{
    if (recording) {
        AVPacket packet;

        while (recording && av_read_frame(inputFormatContext, &packet) >= 0) {
            AVStream* in_stream = inputFormatContext->streams[packet.stream_index];
            AVStream* out_stream = outputFormatContext->streams[0];

            // Adjustment of DTS and PTS to ensure increasing monoticity
            if (packet.pts != AV_NOPTS_VALUE) {
                packet.pts = av_rescale_q_rnd(packet.pts, in_stream->time_base, out_stream->time_base, AVRounding(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
            }

            if (packet.dts != AV_NOPTS_VALUE) {
                packet.dts = av_rescale_q_rnd(packet.dts, in_stream->time_base, out_stream->time_base, AVRounding(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));
            }

            packet.duration = av_rescale_q(packet.duration, in_stream->time_base, out_stream->time_base);

            packet.stream_index = 0;

            av_interleaved_write_frame(outputFormatContext, &packet);

            av_packet_unref(&packet);
        }


        return true;
    }

    std::cerr << "Error recording video. Recording not started or already stopped." << std::endl;
    return false;
}