Recherche avancée

Médias (91)

Autres articles (110)

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

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

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

  • Publish RTMP stream to Red5 Server form iOS camera

    7 septembre 2015, par Mohammad Asif

    Please look at following code, I have transformed CMSampleBufferRef into AV_CODEC_ID_H264 but I don’t know how to transmit it to Red5 server.

    Thanks,

    - (void)  captureOutput:(AVCaptureOutput *)captureOutput
     didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
        fromConnection:(AVCaptureConnection *)connection {

    //NSLog(@"This is working ....");

     // [connection setVideoOrientation: [self deviceOrientation] ];

    if( !CMSampleBufferDataIsReady(sampleBuffer) )
    {
       NSLog( @"sample buffer is not ready. Skipping sample" );
       return;
    } else {

       if (captureOutput == videoOutput) {


           CVPixelBufferRef pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
           CVPixelBufferLockBaseAddress(pixelBuffer, 0);

           // access the data
           float width = CVPixelBufferGetWidth(pixelBuffer);
           float height = CVPixelBufferGetHeight(pixelBuffer);

           //float bytesPerRow = CVPixelBufferGetBytesPerRowOfPlane(pixelBuffer, 0);
           unsigned char *rawPixelBase = (unsigned char *)CVPixelBufferGetBaseAddressOfPlane(pixelBuffer, 0);


           // Convert the raw pixel base to h.264 format

           if (codec == nil) {

               codec = 0;
               context = 0;
               frame = 0;

               fmt = avformat_alloc_context();
               //avformat_write_header(fmt, NULL);

               codec = avcodec_find_encoder(AV_CODEC_ID_H264);

               if (codec == 0) {
                   NSLog(@"Codec not found!!");
                   return;
               }

               context = avcodec_alloc_context3(codec);

               if (!context) {
                   NSLog(@"Context no bueno.");
                   return;
               }

               // Bit rate
               context->bit_rate = 400000; // HARD CODE
               context->bit_rate_tolerance = 10;
               // Resolution

               // Frames Per Second
               context->time_base = (AVRational) {1,25};
               context->gop_size = 1;
               //context->max_b_frames = 1;
               context->width = width;
               context->height = height;
               context->pix_fmt = PIX_FMT_YUV420P;

               // Open the codec
               if (avcodec_open2(context, codec, 0) < 0) {
                   NSLog(@"Unable to open codec");
                   return;
               }

               // Create the frame
               frame = av_frame_alloc();
               if (!frame) {
                   NSLog(@"Unable to alloc frame");
                   return;
               }
           }

           context->width = width;
           context->height = height;

           frame->format = context->pix_fmt;
           frame->width = context->width;
           frame->height = context->height;

           //int nbytes = avpicture_get_size(context->pix_fmt, context->width, context->height);
           //uint8_t* outbuffer = (uint8_t*)av_malloc(nbytes);
    //            AVFrame *pFrameDecoded = avcodec_alloc_frame();
    //            int num_bytes2 = avpicture_get_size(context->pix_fmt, frame->width, frame->height);
    //            uint8_t* frame2_buffer2 = (uint8_t *)av_malloc(num_bytes2 * sizeof(uint8_t));
    //            avpicture_fill((AVPicture*)pFrameDecoded, frame2_buffer2, PIX_FMT_YUVJ422P, 320, 240);

           frame->pts = (1.0 / 30) * 60 * count;
           avpicture_fill((AVPicture *) frame, rawPixelBase, context->pix_fmt, frame->width, frame->height);

           int got_output = 0;
           av_init_packet(&packet);
           //avcodec_encode_video2(context, &packet, frame, &got_output);

           do {
               avcodec_encode_video2(context, &packet, frame, &got_output);
               //avcodec_decode_video2(context, &packet, NULL, &got_output);
               //*... handle received packet*/

               if (isFirstPacket) {
                   [rtmp sendCreateStreamPacket];
                   isFirstPacket = false;
                   //av_dump_format(fmt, 0, [kRtmpEP UTF8String], 1);
                   avformat_alloc_output_context2(&ofmt_ctx, NULL, "flv", [kRtmpEP UTF8String]); //RTMP
               }

               packet.stream_index = ofmt_ctx->nb_streams;
               av_interleaved_write_frame(ofmt_ctx, &packet);
               count ++;

               //[rtmp write:[NSData dataWithBytes:packet.data length:packet.size]];


           } while(got_output);

           // Unlock the pixel data
           CVPixelBufferUnlockBaseAddress(pixelBuffer, 0);

           //[rtmp write:[NSData dataWithBytes:packet.data length:packet.size]];

       } else {

       }
    }   }  
  • Don't throw an error when attached picture isn't recognized.

    10 avril 2023, par Dale Curtis
    Don't throw an error when attached picture isn't recognized.
    

    The MIME type field is required per the FLAC standard, but it's
    not an error just because ffmpeg doesn't recognize it.

    Signed-off-by : Dale Curtis <dalecurtis@chromium.org>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavformat/flac_picture.c
  • torchaudio.io.StreamReader doesn't throw error when seeking to time stamp more than the duration of audio file

    27 mars 2023, par lokesh

    I am trying to get the audio chunk of audio file between specific start time and end time

    &#xA;

    Consider a audio of duration 10 seconds. Now i need to get chunk from 4 sec to 7 sec

    &#xA;

    torchaudio.info doesn't give correct num_frames for io.BytesIO flac audio file. So there is no way to find the total number of frames in the given audio to check for out of bounds start offset&#xA;Ref : https://github.com/pytorch/audio/issues/2524

    &#xA;

    What I did to get the chunk of audio with start and end offsets.

    &#xA;

    def read_audio(audio_file, start, end):&#xA;    audio_file.seek(0)&#xA;    reader = StreamReader(audio_file)&#xA;    sample_rate = int(reader.get_src_stream_info(reader.default_audio_stream).sample_rate)&#xA;&#xA;    reader.seek(start * sample_rate)&#xA;    reader.add_basic_audio_stream(frames_per_chunk=(end - start) * sample_rate)&#xA;&#xA;    return list(reader.stream())[0].pop()&#xA;

    &#xA;

    This is working as intended for start time less than the duration of audio file. But when we give the start time more than the duration of audio file, It doesn't throw error or return empty tensor.&#xA;Is there any way to know the given offsets are out of bounds.

    &#xA;