Recherche avancée

Médias (91)

Autres articles (29)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

Sur d’autres sites (6107)

  • How to using every 5 sec generate video output File Path to Encode with RTMP Formate write data in ios ? [on hold]

    16 juillet 2015, par Sandeep Joshi
    (void) segmentRecording:(NSTimer*)timer {
    if (!shouldBeRecording) {
       [timer invalidate];
    }
    AVAssetWriter *tempAssetWriter = self.assetWriter;
    AVAssetWriterInput *tempAudioEncoder = self.audioEncoder;
    AVAssetWriterInput *tempVideoEncoder = self.videoEncoder;
    self.assetWriter = queuedAssetWriter;
    self.audioEncoder = queuedAudioEncoder;
    self.videoEncoder = queuedVideoEncoder;
    NSLog(@"Switching encoders");

    dispatch_async(segmentingQueue, ^{
       if (tempAssetWriter.status == AVAssetWriterStatusWriting) {
           @try {
               [tempAudioEncoder markAsFinished];
               [tempVideoEncoder markAsFinished];
               [tempAssetWriter finishWritingWithCompletionHandler:^{
                   if (tempAssetWriter.status == AVAssetWriterStatusFailed) {
                       [self showError:tempAssetWriter.error];
                   } else {
                       [self uploadLocalURL:tempAssetWriter.outputURL];
                   }
               }];
           }
           @catch (NSException *exception) {
               NSLog(@"Caught exception: %@", [exception description]);
               //[BugSenseController logException:exception withExtraData:nil];
           }
       }
       self.segmentCount++;
       if (self.readyToRecordAudio && self.readyToRecordVideo) {
           NSError *error = nil;
           self.queuedAssetWriter = [[AVAssetWriter alloc] initWithURL:[OWUtilities urlForRecordingSegmentCount:segmentCount basePath:self.basePath] fileType:(NSString *)kUTTypeMPEG4 error:&error];
           if (error) {
               [self showError:error];
           }
           self.queuedVideoEncoder = [self setupVideoEncoderWithAssetWriter:self.queuedAssetWriter formatDescription:videoFormatDescription bitsPerSecond:videoBPS];
           self.queuedAudioEncoder = [self setupAudioEncoderWithAssetWriter:self.queuedAssetWriter formatDescription:audioFormatDescription bitsPerSecond:audioBPS];
           //NSLog(@"Encoder switch finished");
       }
    });}



    (void) uploadLocalURL:(NSURL*)url {
    NSLog(@"upload local url: %@", url);
    NSString *inputPath = [url path];
    NSString *outputPath = [inputPath stringByReplacingOccurrencesOfString:@".mp4" withString:@".ts"];
    NSString *outputFileName = [outputPath lastPathComponent];
    NSDictionary *options = @{kFFmpegOutputFormatKey: @"mpegts"};
    NSLog(@"%@ conversion...", outputFileName);
    [ffmpegWrapper convertInputPath:[url path] outputPath:outputPath options:options progressBlock:nil completionBlock:^(BOOL success, NSError *error) {
       if (success) {
           if (!isRtmpConnected) {
               isRtmpConnected = [rtmp openWithURL:HOST_URL enableWrite:YES];
           }
           isRtmpConnected = [rtmp isConnected];

           if (isRtmpConnected) {

               NSData *video = [NSData dataWithContentsOfURL:[NSURL URLWithString:outputPath]];
               NSUInteger length = [video length];
               NSUInteger chunkSize = 1024 * 5;;
               NSUInteger offset = 0;
               NSLog(@"original video length: %lu \n chunkSize : %lu", length,chunkSize);
             // Let's split video to small chunks to publish to media server
               do {
                   NSUInteger thisChunkSize = length - offset > chunkSize ? chunkSize : length - offset;
                   NSData* chunk = [NSData dataWithBytesNoCopy:(char *)[video bytes] + offset
                                                        length:thisChunkSize
                                                  freeWhenDone:NO];
                   offset += thisChunkSize;

                   // Write new chunk to rtmp server
                   NSLog(@"%lu", (unsigned long)[rtmp write:chunk]);
                   sleep(1);
               } while (offset < length);
           }else{
               [rtmp close];
           }


       } else {
           NSLog(@"conversion error: %@", error.userInfo);
       }
    }];}

    This code use for live streaming for send data using RTMP Wrapper.
    Not write in Socket properly because every 5 second to generate different file output file.

    This is proper way ?

    I have no idea how to get NSData in proper way.

    Please help me .

  • commande ffmpeg not working from php [on hold]

    29 août 2016, par Elmehdi Alloul

    I have a PHP file which executes a command :

    echo shell_exec ( 'ffmpeg -i "http://ip:8000/play/a02o" -b:v 1000k  -vb 1000k  -minrate 1000k -maxrate 1000k -aspect 16:9 -s 720x480 -vprofile main  -r 25 -threads 4  -bufsize 1500k -c:v libx264  -preset veryfast -g 60    -acodec libmp3lame -ar 44100 -ab 64k -strict experimental  -f flv "rtmp://127.0.0.1:708/live/test"  > /dev/null 2>/dev/null &  ' ) ;

    Everything is okay now, but when I restart nginx service, I’m forced to rerun the command again. Is there any way to start this command every time it is stopped ? Also, how can I know the status of the streaming, i.e., whether it is started or not ?

  • How to encode BGRA sequence to H.264 video stream using FFmpeg [on hold]

    31 octobre 2016, par Galaxy

    Now I have a frame of BGRA data stored in an array, which is kept being updated under a certain frame rate. Can I use FFmpeg to encode it to a H.264 video stream ? Is there any API I can leverage ?

    This is used as a live H.264 video stream, so I need to write the header at the beginning and send the stream to my server through RTMP. I’m not sure if FFmpeg is suitable for this task. I also heard about GSteamer, I don’t know which one is better to me.

    I’m developing on OS X using C++.