Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (42)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • 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

  • Taille des images et des logos définissables

    9 février 2011, par

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

Sur d’autres sites (7943)

  • Piping stdout from child process directly to google cloud storage. Node.js

    2 octobre 2018, par glenn

    anyone here with expertise on piping to google cloud storage ?

    i am using FFmpeg on a server, and want to pipe to my storage bucket.

    I can get it working when I save FFmpeg output to a file, then createReadableStream from the file, and then pipe that to createWriteStream()

    however, I dont want to generate a static file, and then go through that process every time

    Why can I not just simply pipe FFmpeg.stdout.pipe(file.createWriteStream()) ?

    FYI : I am running FFmpeg as a child process

         spawnFFMPEG = () => {
    this.ffmpeg = child_process.spawn('ffmpeg',
     [
       '-f', 'lavfi', '-i', 'anullsrc',
       '-thread_queue_size', '512',
       '-i', '-',
       '-shortest', '-vcodec', 'copy',
       '-f', 'avi',
       'pipe:1'
     ]
    )

    this.ffmpeg.stdout.pipe(myWritableStream)
  • ffmpeg multiple pipes with different filters and outputs

    3 janvier 2024, par diegoddox

    I'm trying to pipe multiple outputs to an s3 but so far it's only working if I tried with only one pipe as soon as I add more I get Could not write header (incorrect codec parameters ?): Broken pipe error.

    


    aws s3 cp s3://bucket-name/original.mp4 - | \
  ffmpeg -f mp4 -i pipe:0 \
  -vf "scale=1280x720:flags=lanczos" -c:a aac -b:a 96k -movflags frag_keyframe+empty_moov -f mp4 pipe:1 | aws s3 cp - s3://bucket-name/720.mp4 --region my-region \
  -vf "scale=854x480:flags=lanczos" -c:a aac -b:a 96k -movflags frag_keyframe+empty_moov -f mp4 pipe:2 | aws s3 cp - s3://bucket-name/480.mp4 --region my-region \
  -vf "scale=640x360:flags=lanczos" -c:a aac -b:a 96k -movflags frag_keyframe+empty_moov -f mp4 pipe:3 | aws s3 cp - s3://bucket-name/360.mp4 --region my-region \
  -ss 00:00:00 -t 3 -vf "fps=10,scale=720:-1" -movflags frag_keyframe+empty_moov -f gif pipe:4 | aws s3 cp - s3://bucket-name/thumbnail.gif --region my-region


    


    Thanks in advance

    


  • Getting jibberish while using ffmpeg in android

    27 février 2013, par StackOverflowed

    I'm trying decode an audio file into PCM to use with AudioTrack. The audio is squeeky, squelchy, and just plain jibberish and for a random second sounds like it should but mainly is completely muddled. I'm not sure where my mistake is, is it in how the array is passed back to playSound ?

    Thank you in advance, I would really appreciate help on this matter as it's been kicking my ass for a while.

    This is my java code :

    public void init() {
    int bufSize = AudioTrack.getMinBufferSize(44100,
                   AudioFormat.CHANNEL_OUT_STEREO,  
                   AudioFormat.ENCODING_PCM_16BIT);


           track = new AudioTrack(AudioManager.STREAM_MUSIC,  
           44100,  
           AudioFormat.CHANNEL_OUT_STEREO,  
           AudioFormat.ENCODING_PCM_16BIT,  
           bufSize,
           AudioTrack.MODE_STREAM);
           log("STARTING!!! _________________________ <--");

           byte[] array = new byte[bufSize];

           try {

               fos  = new FileOutputStream("/sdcard/acdc.bin");

           } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
           }

           decoder("/sdcard/acdc.ogg", array);
    }

    void playSound(byte[] buf, int size) {  

       try {
           fos.write(buf, 0, size);
       } catch (IOException e) {
           e.printStackTrace();
       }
       if(track.getPlayState()!=AudioTrack.PLAYSTATE_PLAYING) {  
           track.play();                      
       }
       int wrote =  track.write(buf, 0, size);
       if (wrote != size)
           log("WRITING: " + wrote  + " but size was: " + size);
    }

    This is my c function :

    void Java_com_example_ffmpegsample_MainActivity_decoder(JNIEnv* env, jobject obj,jstring file,jbyteArray array)
       {
           jboolean            isfilenameCopy;
           const char *        filename = (*env)->GetStringUTFChars(env, file, &isfilenameCopy);
           AVCodec *codec;
           AVCodecContext *c= NULL;
           AVFormatContext *pFormatCtx;
           AVCodecContext *pCodecCtx;

           int out_size, len;
           FILE *f, *outfile;
           uint8_t *outbuf;
           uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
           AVPacket avpkt;
           LOGI("HERE");
           jclass              cls = (*env)->GetObjectClass(env, obj);
           LOGI(cls);
           jmethodID           play = (*env)->GetMethodID(env, cls, "playSound", "([BI)V");//At the begining of your main function

           av_init_packet(&avpkt);



           av_register_all();
           LOGI("AUDIO DECODER");
           printf("Audio decoding\n");
           int err;
           err = av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL);
           if (err!=0) {
               LOGI("COULD NOT AV_OPEN file");
               return;
           }
           if(av_find_stream_info(pFormatCtx)<0) {
                   LOGE("Unable to get stream info");
                   return;
           }
           int audioStream = -1;
           int i;

           for (i=0; inb_streams; i++) {
                   if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_AUDIO) {
                       audioStream = i;
                       break;
                   }
               }
               if(audioStream==-1) {
                   LOGE("Unable to find audio stream");
                   return;
               }
           LOGI("Audio stream is [%d]", audioStream);

           pCodecCtx=pFormatCtx->streams[audioStream]->codec;
           codec = avcodec_find_decoder(pCodecCtx->codec_id);
           /* find the mpeg audio decoder */
          // codec = avcodec_find_decoder(CODEC_ID_AAC);
           if (!codec) {
               LOGI("NO CODEC");
               fprintf(stderr, "codec not found\n");
               return;
           }

           //c= avcodec_alloc_context();
           c = pCodecCtx;

           /* open it */
           if (avcodec_open(c, codec) < 0) {
               fprintf(stderr, "could not open codec\n");
               LOGI("NOT LOADING CODEC");
               return;
           }

           outbuf = malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE);

           f = fopen(filename, "rb");
           if (!f) {
               fprintf(stderr, "could not open %s\n", filename);
               LOGI("COULD NOT OPEN FILE");
               return;
           }

           /* decode until eof */
           avpkt.data = inbuf;
           avpkt.size = fread(inbuf, 1, AUDIO_INBUF_SIZE, f);

           while (avpkt.size > 0) {
               LOGI("............................." + avpkt.size);
               out_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
               len = avcodec_decode_audio3(c, (short *)outbuf, &out_size, &avpkt);
               if (len < 0) {
                   fprintf(stderr, "Error while decoding\n");
                   LOGI("ERROR DECODING, error: %d", len);
                   return;
               }
               if (out_size > 0) {
                   /* if a frame has been decoded, output it */
                   jbyte *bytes = (*env)->GetByteArrayElements(env, array, NULL);
                   memcpy(bytes, outbuf, out_size); //
                   (*env)->ReleaseByteArrayElements(env, array, bytes, 0);
                   (*env)->CallVoidMethod(env, obj, play, array, out_size);

               }
               avpkt.size -= len;
               avpkt.data += len;
               if (avpkt.size < AUDIO_REFILL_THRESH) {
                   /* Refill the input buffer, to avoid trying to decode
                    * incomplete frames. Instead of this, one could also use
                    * a parser, or use a proper container format through
                    * libavformat. */
                   memmove(inbuf, avpkt.data, avpkt.size);
                   avpkt.data = inbuf;
                   len = fread(avpkt.data + avpkt.size, 1,
                               AUDIO_INBUF_SIZE - avpkt.size, f);
                   if (len > 0)
                       avpkt.size += len;
               }
           }

           fclose(f);
           free(outbuf);

           avcodec_close(c);
           av_free(c);
       }