Recherche avancée

Médias (91)

Autres articles (20)

  • 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

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Les thèmes de MediaSpip

    4 juin 2013

    3 thèmes sont proposés à l’origine par MédiaSPIP. L’utilisateur MédiaSPIP peut rajouter des thèmes selon ses besoins.
    Thèmes MediaSPIP
    3 thèmes ont été développés au départ pour MediaSPIP : * SPIPeo : thème par défaut de MédiaSPIP. Il met en avant la présentation du site et les documents média les plus récents ( le type de tri peut être modifié - titre, popularité, date) . * Arscenic : il s’agit du thème utilisé sur le site officiel du projet, constitué notamment d’un bandeau rouge en début de page. La structure (...)

Sur d’autres sites (5622)

  • Sending big packets gets Bad Address error

    30 mars 2012, par Roi

    Im writing a live webcam stream using ffmpeg and sdl on C.
    my platform is linux.

    my application is a client server based.
    The client is reading from the webcam, produce an AVPacket, then send to server.

    My problem is, that the AVPacket struct has a member named data which is approximately 600k.
    At first, i had not checked the send() return value,
    So, of course the packet had failed to send completely.

    But after I checked, the send() returns Bad Address error at the second iteration of the big packet.
    the length of the data packet must be correct because is supplied from the AVPacket struct.

    It sends 2 members of the AVPacket before, so the server is up and functional.

    The problematic section :

       int send_video_data(video_client_t *client, void* buf, int length)
       {
           int rc;

           while (length > 0)
           {
              if ((rc = send(client->sockfd, buf, length, 0)) == -1) {
                        perror("failed sending data to server");
                        exit(1);
               }

               length-=rc;
               buf+=rc;
           }

           return 0;

       }

    Any one got any ideas why it's not working ?
    Thanks in advanced !

  • Decode audio using libavcodec and play using libAO ?

    21 mars 2012, par Ashika Umanga Umagiliya

    I use following code snippet to decode audio files (tested with MP3,WAV,WMV).

    But when it plays the audio , it just gives static sounds and crashes time to time.
    Any hints on what i am doing wrong here ?

    #include
    #include
    #include
    #include


    extern "C" {
    #include "libavutil/mathematics.h"
    #include "libavformat/avformat.h"
    #include "libswscale/swscale.h"
    #include <ao></ao>ao.h>

    }

    void die(const char *msg)
    {
       fprintf(stderr,"%s\n",msg);
       exit(1);
    }

    int main(int argc, char **argv)
    {

       const char* input_filename=argv[1];

       //avcodec_register_all();
       av_register_all();
       //av_ini

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

       if(av_find_stream_info(container)&lt;0){
           die("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){
           die("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){
           die("cannot find codec!");
       }

       if(avcodec_open(ctx,codec)&lt;0){
           die("Codec cannot be found");
       }

       //ctx=avcodec_alloc_context3(codec);

       //initialize AO lib
       ao_initialize();

       int driver=ao_default_driver_id();

       ao_sample_format sformat;
       sformat.bits=16;
       sformat.channels=2;
       sformat.rate=44100;
       sformat.byte_format=AO_FMT_NATIVE;
       sformat.matrix=0;

       ao_device *adevice=ao_open_live(driver,&amp;sformat,NULL);
       //end of init AO LIB

       AVPacket packet;
       av_init_packet(&amp;packet);

       AVFrame *frame=avcodec_alloc_frame();

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



       int len;
       int frameFinished=0;
       while(av_read_frame(container,&amp;packet)>=0)
       {

           if(packet.stream_index==stream_id){
               //printf("Audio Frame read  \n");
               int len=avcodec_decode_audio4(ctx,frame,&amp;frameFinished,&amp;packet);
               //frame->
               if(frameFinished){
                   //printf("Finished reading Frame %d %d\n",packet.size,len);
                   ao_play(adevice, (char*)frame->data, len);
               }

           }


       }

       av_close_input_file(container);
       ao_shutdown();
       return 0;
    }
  • PHP ffmpeg exec returns null

    19 mars 2012, par benedict_w

    I'm trying to run ffmpeg through a PHP exec call, I've been debugging for a while and looked at lot of responses on here, but still not found any answers...

    My simplified call is :

    $cmd = &#39;ffmpeg 2>&amp;1&#39;;

    exec(escapeshellcmd($cmd), $stdout, $stderr);

    var_dump($stderr);
    var_dump($stdout);
    var_dump($cmd);
    exit;

    My output is $stderr = int(1) and $stdout = array(0)

    Also I tried shell_exec($cmd) which returns NULL.

    cmd.exe has permissions set for the IUSR account - e.g. I can run $cmd = &#39;dir&#39; and see a directory listing output.

    PHP is not running in safe mode.

    The ffmpeg.exe is in the same directory as my php file, but I have the same response giving an absolute path to the ffmpeg.exe file in $cmd.

    ffmpeg is executing fine from the command line.

    I'm running Windows XP, IIS and PHP 5.3.

    EDIT :

    If I run 'ffmpeg -h' I get the help commands, which must indicated that ffmpeg is recognised

    I've increased the PHP memory limit to 1024 - no luck.