Recherche avancée

Médias (10)

Mot : - Tags -/wav

Autres articles (54)

  • 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 (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

Sur d’autres sites (9778)

  • FFMPEG : Recording a video stream to disk real-time

    31 mars 2022, par Евгений Федоров

    I made a video recording with ffmpeg

    


     var inputArgs = string.Format(CultureInfo.InvariantCulture, "-framerate {0} -f rawvideo -pix_fmt {3} -video_size {1}x{2} -i -", VideoFPS, VideoXRes, VideoYRes, VideoPXLFormat);

 var outputArgs = string.Format(CultureInfo.InvariantCulture, "-vcodec mpeg4 -crf {2} -pix_fmt yuv420p -preset {3} -shortest -r {1} \"{0}\"", outputPath, VideoFPS, VideoCRFValue, CompressionRate);

 var ffmpegProcess = new Process
        {
            StartInfo =
            {
                FileName = ffmpegPath,
                Arguments = $"{inputArgs} {outputArgs}",
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardInput = true
            }
        };

        ffmpegProcess .Start();
        var VideoRecordingFFmpegInput = VideoRecordingFFmpegProcces.StandardInput.BaseStream;


    


    Now I write data bytes from the image into the stream from time to time

    


    VideoRecordingFFmpegInput.Write(framesByteArray, 0, sizeOfpack);


    


    When I finished recording the frames :

    


      VideoRecordingFFmpegInput.Flush();
  VideoRecordingFFmpegInput.Close();
  ffmpegProcess.WaitForExit();


    


    Everything works fine, and it creates the file I want.

    


    When the process starts, it creates a file that has a very small size
enter image description here

    


    And during the recording of image bytes in the video stream - this size does not change (Probably it is written to RAM ?)

    


    But as soon as the ffmpeg process finishes - flush / close
the file size becomes normal.

    


    enter image description here

    


    The problem is that if I record for several hours it can cause an OutOfMemory exception

    


    Is there any way to have the frames record and immediately increase the file size ? (Without infinitely filling RAM ?)

    


  • Is it real connect subtitles when streaming video (HLS, M3U8)

    12 avril 2019, par Mikhail Petrov

    I am trying to create a stream in which the tracks from the convertible file (in my case .mkv to .m3u8) will be played through m3u8. At the moment, it turns out to switch between multiple resolutions, and even select the audio track, but does not see the subtitles at all.

    Video works, audio tracks are switched, but no subtitles are visible at all

    ffprobe source file :
    https://paste2.org/czUePDPj

    Next, perform coding and splitting into tracks :

    ffmpeg -i '/home/mishkapetran/Загрузки/Rick.mkv' \
    -map 0:v:0 -c:v libx264 -profile:v baseline -preset:v superfast -strict -2 -s 426x240   -f hls -hls_time 10 -hls_list_size 0 -segment_list rick240p -hls_segment_filename '/home/mishkapetran/Загрузки/test/Rick240p_%d.ts'      '/home/mishkapetran/Загрузки/test/Rick240p.m3u8' \
    -map 0:a:0 -c:a aac                             -f hls -hls_time 10 -hls_list_size 0 -segment_list rick_ru -hls_segment_filename '/home/mishkapetran/Загрузки/test/RickTrack_ru_%d.aac'        '/home/mishkapetran/Загрузки/test/RickTrack_ru.m3u8' \
    -map 0:a:1 -c:a aac                             -f hls -hls_time 10 -hls_list_size 0 -segment_list rick_en -hls_segment_filename '/home/mishkapetran/Загрузки/test/RickTrack_en_%d.aac'        '/home/mishkapetran/Загрузки/test/RickTrack_en.m3u8' \
    -map 0:s:0 suben.vtt                          -f hls -hls_time 10 -hls_list_size 0 -segment_list en -hls_segment_filename '/home/mishkapetran/Загрузки/test/sub_en_%d.vtt'  '/home/mishkapetran/Загрузки/test/sub_en.m3u8' \
    -map 0:s:1 subru.vtt                          -f hls -hls_time 10 -hls_list_size 0 -segment_list ru -hls_segment_filename '/home/mishkapetran/Загрузки/test/sub_ru_%d.vtt'  '/home/mishkapetran/Загрузки/test/sub_ru.m3u8'

    Then in the same folder I create the m3u8 master :

    #EXTM3U
    #EXT-X-VERSION:5
    #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="Russian",LANGUAGE="ru",AUTOSELECT=YES,URI="RickTrack_ru.m3u8"
    #EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="audio",NAME="English",LANGUAGE="en",AUTOSELECT=NO,URI="RickTrack_en.m3u8"

    #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="Russian",DEFAULT=YES,FORCED=NO,AUTOSELECT=YES,LANGUAGE="ru",URI="sub_ru.m3u8"
    #EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,AUTOSELECT=YES,LANGUAGE="en",URI="sub_en.m3u8"

    #EXT-X-STREAM-INF:BANDWIDTH=928000,CODECS="avc1.42c00d,mp4a.40.2",RESOLUTION=480x270,AUDIO="audio",SUBTITLES="subs"
    Rick240p.m3u8
  • How to mention real image instead of dummy image in ffmpeg api-example.c

    2 mars 2013, par Mohan

    I am using video_encode_example function from api-example.c of FFmpeg,
    which basically creates 25 dummy images and encodes into a one second video.
    How ever i am unable to mention real images instead of dummy ones.
    If any one know how to do this for xcode objective C, pl submit a reply.
    Below is the function

    /*
    * Video encoding example
    */
    static void video_encode_example(const char *filename)
    {
       AVCodec *codec;
       AVCodecContext *c= NULL;
       int i, out_size, size, x, y, outbuf_size;
       FILE *f;
       AVFrame *picture;
       uint8_t *outbuf, *picture_buf;

       printf("Video encoding\n");

       /* find the mpeg1 video encoder */
       codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
       if (!codec) {
           fprintf(stderr, "codec not found\n");
           exit(1);
       }

       c= avcodec_alloc_context();
       picture= avcodec_alloc_frame();

       /* put sample parameters */
       c->bit_rate = 400000;
       /* resolution must be a multiple of two */
       c->width = 352;
       c->height = 288;
       /* frames per second */
       c->time_base= (AVRational){1,25};
       c->gop_size = 10; /* emit one intra frame every ten frames */
       c->max_b_frames=1;
       c->pix_fmt = PIX_FMT_YUV420P;

       /* open it */
       if (avcodec_open(c, codec) < 0) {
           fprintf(stderr, "could not open codec\n");
           exit(1);
       }

       f = fopen(filename, "wb");
       if (!f) {
           fprintf(stderr, "could not open %s\n", filename);
           exit(1);
       }

       /* alloc image and output buffer */
       outbuf_size = 100000;
       outbuf = malloc(outbuf_size);
       size = c->width * c->height;
       picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */

       picture->data[0] = picture_buf;
       picture->data[1] = picture->data[0] + size;
       picture->data[2] = picture->data[1] + size / 4;
       picture->linesize[0] = c->width;
       picture->linesize[1] = c->width / 2;
       picture->linesize[2] = c->width / 2;

       /* encode 1 second of video */
       for(i=0;i<25;i++) {
           fflush(stdout);
           /* prepare a dummy image */
           /* Y */
           for(y=0;yheight;y++) {
               for(x=0;xwidth;x++) {
                   picture->data[0][y * picture->linesize[0] + x] = x + y + i * 3;
               }
           }

           /* Cb and Cr */
           for(y=0;yheight/2;y++) {
               for(x=0;xwidth/2;x++) {
                   picture->data[1][y * picture->linesize[1] + x] = 128 + y + i * 2;
                   picture->data[2][y * picture->linesize[2] + x] = 64 + x + i * 5;
               }
           }

           /* encode the image */
           out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
           printf("encoding frame %3d (size=%5d)\n", i, out_size);
           fwrite(outbuf, 1, out_size, f);
       }

       /* get the delayed frames */
       for(; out_size; i++) {
           fflush(stdout);

           out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
           printf("write frame %3d (size=%5d)\n", i, out_size);
           fwrite(outbuf, 1, out_size, f);
       }

       /* add sequence end code to have a real mpeg file */
       outbuf[0] = 0x00;
       outbuf[1] = 0x00;
       outbuf[2] = 0x01;
       outbuf[3] = 0xb7;
       fwrite(outbuf, 1, 4, f);
       fclose(f);
       free(picture_buf);
       free(outbuf);

       avcodec_close(c);
       av_free(c);
       av_free(picture);
       printf("\n");
    }