Recherche avancée

Médias (0)

Mot : - Tags -/flash

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (38)

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Selection of projects using MediaSPIP

    2 mai 2011, par

    The examples below are representative elements of MediaSPIP specific uses for specific projects.
    MediaSPIP farm @ Infini
    The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (7955)

  • How to optimize FFMPEG/ Editing video ?

    6 mars 2016, par user6964

    I have the next commands for editing video but all the process take a long time. But with the same quality of the original video.

    //First cut original video
    exec("ffmpeg -i $video_path_main -ss $first_time1 -t $first_time2 -s 476x268 -r 10 -b 2000k -r 30 -g 100 -ar 22050 -ab 48000 -ac 1 -strict -2 $name_first");
    exec("ffmpeg -i $video_path_main -ss $second_time1 -t $second_time2 -s 476x268 -r 10 -b 2000k -r 30 -g 100 -ar 22050 -ab 48000 -ac 1 -strict -2 $name_second");

    $name_edit_second = uniqid() . '.mp4'; //Then editing the second video
    exec("ffmpeg -i $name_second -s 476x268 -r 10 -b 2000k -r 30 -g 100 -ar 22050 -ab 48000 -ac 1 -strict -2 -vf movie='" . $image_name . " [watermark]; [in] [watermark] overlay=308:43"."' $name_edit_second");

    //Then merge video file mp4 with Mencoder
    $name_total_1 = uniqid() . '.mp4';
    exec("mencoder -oac pcm -ovc xvid -vf scale -xvidencopts bitrate=460 -o $name_total_1 ".$name_first.' '.$name_edit_second);

    //Then convert the video to 3 formats that is necessary in my Player.
    $name_total = uniqid();

    //Of MP4 a FLV
    exec("ffmpeg -i $name_partial -f flv -s 476x268 -r 10 -b 2000k -r 30 -g 100 -ar 22050 -ab 48000 -ac 1 $name_total.flv");

    //Of MP4-Mencoder a MP4-FFMPEG
    exec("ffmpeg -i $name_partial -s 476x268 -r 10 -b 2000k -r 30 -g 100 -ar 22050 -ab 48000 -ac 1 -strict -2 $name_total.mp4"));

    //Of MP4 a WEBM
    exec("ffmpeg -i $name_partial -acodec libvorbis -s 476x268 -r 10 -b 2000k -r 30 -g 100 -ar 22050 -ab 48000 -ac 2 -f webm $name_total.webm");

    I don’t know if some of parameters take much time for all the process. Or if one of this command take much time.

    Note : Some videos have more than 2 parts of their original videos.


    UPDATE

    Maybe the parameter -theards 1 help me in NO take a lot of resources of the CPU. Also, I need to optimize the re-encoding because with only 8 users take the 100% of resources.

    I run FFMPEG in a other server that return the video edited to other server where stay my application.

    Sorry for my english.

  • Convert .m4a to PCM using libavcodec

    17 décembre 2013, par gmcc051

    I'm trying to convert a .m4a file to raw PCM file so that I can play it back in Audacity.

    According to the AVCodecContext it is a 44100 Hz track using the sample format AV_SAMPLE_FMT_FLTP which, to my understanding, when decodeded using avcodec_decode_audio4, I should get two arrays of floating point values (one for each channel).

    I'm unsure of the significance of the AVCodecContext's bits_per_coded_sample = 16

    Unfortunately Audacity plays the result back as if I have the original track is mixed in with some white noise.

    Here is some sample code of what I've been done. Note that I've also added a case for a track that uses signed 16bit non-interleaved data (sample_format = AC_SAMPLE_FMT_S16P), which Audacity plays back fine.

    int AudioDecoder::decode(std::string path)
    {
     const char* input_filename=path.c_str();

     av_register_all();

     AVFormatContext* container=avformat_alloc_context();
     if(avformat_open_input(&container,input_filename,NULL,NULL)<0){
       printf("Could not open file");
     }

     if(avformat_find_stream_info(container, NULL)<0){
         printf("Could not find file info");
     }
     av_dump_format(container,0,input_filename,false);

     int stream_id=-1;
     int i;
     for(i=0;inb_streams;i++){
       if(container->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO){
           stream_id=i;
           break;
       }
     }
     if(stream_id==-1){
       printf("Could not find Audio Stream");
     }

     AVDictionary *metadata=container->metadata;
     AVCodecContext *ctx=container->streams[stream_id]->codec;
     AVCodec *codec=avcodec_find_decoder(ctx->codec_id);

     if(codec==NULL){
       printf("cannot find codec!");
     }

     if(avcodec_open2(ctx,codec,NULL)<0){
        printf("Codec cannot be found");
     }

     AVSampleFormat sfmt = ctx->sample_fmt;

     AVPacket packet;
     av_init_packet(&packet);
     AVFrame *frame = avcodec_alloc_frame();

     int buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE+ FF_INPUT_BUFFER_PADDING_SIZE;;
     uint8_t buffer[buffer_size];
     packet.data=buffer;
     packet.size =buffer_size;

     FILE *outfile = fopen("test.raw", "wb");

     int len;
     int frameFinished=0;

     while(av_read_frame(container,&packet) >= 0)
     {
         if(packet.stream_index==stream_id)
         {
           //printf("Audio Frame read \n");
           int len=avcodec_decode_audio4(ctx, frame, &frameFinished, &packet);

           if(frameFinished)
           {      
             if (sfmt==AV_SAMPLE_FMT_S16P)
             { // Audacity: 16bit PCM little endian stereo
               int16_t* ptr_l = (int16_t*)frame->extended_data[0];
               int16_t* ptr_r = (int16_t*)frame->extended_data[1];
               for (int i=0; inb_samples; i++)
               {
                 fwrite(ptr_l++, sizeof(int16_t), 1, outfile);
                 fwrite(ptr_r++, sizeof(int16_t), 1, outfile);
               }
             }
             else if (sfmt==AV_SAMPLE_FMT_FLTP)
             { //Audacity: big endian 32bit stereo start offset 7 (but has noise)
               float* ptr_l = (float*)frame->extended_data[0];
               float* ptr_r = (float*)frame->extended_data[1];
               for (int i=0; inb_samples; i++)
               {
                   fwrite(ptr_l++, sizeof(float), 1, outfile);
                   fwrite(ptr_r++, sizeof(float), 1, outfile);
                }
              }            
           }
       }
    }
    fclose(outfile);
    av_close_input_file(container);
    return 0;  

    }

    I'm hoping I've just done a naive conversion (most/less significant bit issues), but at present I've been unable to figure it out. Note that Audacity can only import RAW float data if its 32bit or 64 bit float (big or little endian).

    Thanks for any insight.

  • Revision af3519a385 : Change the use of a reserved color space entry This commit rename a reserved co

    7 novembre 2014, par Yaowu Xu

    Changed Paths :
     Modify /vp9/common/vp9_enums.h



    Change the use of a reserved color space entry

    This commit rename a reserved color space entry to BT_2020, it intends
    to provide support for VP9 bitstream to pass along the color space
    type defined in BT.2020(Rec.2020)

    please note this entry does not have any effect on encoding/decoding
    behavior, but allow applications to the pass the information along
    from encoding end to decoding end.

    Change-Id : I4678520e89141ea5e8900f7bd1c0e95b710b7091