Recherche avancée

Médias (3)

Mot : - Tags -/pdf

Autres articles (72)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (10789)

  • Segmentation fault in samplerate conversion function

    17 juin 2014, par user3749290

    playmp3() using libmpg123

    if (isPaused==0 && mpg123_read(mh, buffer, buffer_size, &done) == MPG123_OK)
    {
       char * resBuffer=&buffer[0]; //22100=0,5s
       buffer = resample(resBuffer,22100,22100);
       if((ao_play(dev, (char*)buffer, done)==0)){
           return 1;
    }

    resample() Using avcodec from ffmpeg

    #define LENGTH_MS 500       // how many milliseconds of speech to store
    #define RATE 44100      // the sampling rate (input)
    #define FORMAT PA_SAMPLE_S16NE  // sample size: 8 or 16 bits
    #define CHANNELS 2      // 1 = mono 2 = stereo

    struct AVResampleContext* audio_cntx = 0;

    char * resample(char in_buffer[(LENGTH_MS*RATE*16*CHANNELS)/8000],int out_rate,int nsamples)
    {
       char out_buffer[ sizeof( in_buffer ) * 4];
       audio_cntx = av_resample_init( out_rate, //out rate
           RATE, //in rate
           16, //filter length
           10, //phase count
           0, //linear FIR filter
           1.0 ); //cutoff frequency
       assert( audio_cntx && "Failed to create resampling context!");
       int samples_consumed;
       int samples_output = av_resample( audio_cntx, //resample context
           (short*)out_buffer, //buffout
           (short*)in_buffer,  //buffin
           &samples_consumed,  //&consumed
           nsamples,       //nb_samples
           sizeof(out_buffer)/2,//lenout
           0);//is_last
       assert( samples_output > 0 && "Error calling av_resample()!" );
       av_resample_close( audio_cntx );
       //*resample = malloc(sizeof(out_buffer));
       return &out_buffer[0];  
    }

    When i run this code i get 3393 Segmentation fault (core dump created). Why ?

    For example, the use of pointers is correct ?
    and 22100 are the samples that are contained in 0.5 seconds of the song ?

  • Segmentation Fault error when trying to compare two videos with pHash library and its ruby bindings

    10 juillet 2014, par anado1771

    I have set up my system with the latest ffmpeg and pHash libraries (ffmpeg-2.2.1 and pHash-0.9.6) as well as the pHash ruby gem (https://github.com/toy/pHash).

    I am using ruby and attempting to compare two video files like this :

    require 'phash/video'

    video1 = Phash::Video.new('video1.mp4')
    video2 = Phash::Video.new('video2.mp4')

    video1 % video2

    Executing this script results in a Segmentation fault :

    ..../gems/pHash-1.1.4/lib/phash/video.rb:20: [BUG] Segmentation fault
    ruby 1.9.3p545 (2014-02-24 revision 45159) [x86_64-darwin13.1.0]

    -- Control frame information -----------------------------------------------
    c:0008 p:---- s:0029 b:0029 l:000028 d:000028 CFUNC  :ph_dct_videohash
    c:0007 p:0042 s:0024 b:0024 l:000023 d:000023 METHOD .../gems/pHash-1.1.4/lib/phash/video.rb:20
    c:0006 p:0038 s:0017 b:0017 l:000016 d:000016 METHOD .../gems/pHash-1.1.4/lib/phash.rb:43
    c:0005 p:0025 s:0014 b:0014 l:000013 d:000013 METHOD .../gems/pHash-1.1.4/lib/phash.rb:39
    c:0004 p:0011 s:0011 b:0011 l:000010 d:000010 METHOD .../gems/pHash-1.1.4/lib/phash.rb:48
    c:0003 p:0050 s:0006 b:0006 l:000128 d:0011b8 EVAL   video_test_phash.rb:3
    c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
    c:0001 p:0000 s:0002 b:0002 l:000128 d:000128 TOP  

    -- Ruby level backtrace information ----------------------------------------
    video_test_phash.rb:3:in `<main>'
    .../gems/pHash-1.1.4/lib/phash.rb:48:in `similarity'
    .../gems/pHash-1.1.4/lib/phash.rb:39:in `phash'
    .../gems/pHash-1.1.4/lib/phash.rb:43:in `compute_phash'
    .../gems/pHash-1.1.4/lib/phash/video.rb:20:in `video_hash'
    .../gems/pHash-1.1.4/lib/phash/video.rb:20:in `ph_dct_videohash'

    ...

    Abort trap: 6
    </main>

    It appears that the crash happens in the ph_dct_videohash function which is part of the pHash library. The function is in file pHash.cpp. I am copying it here in case it would make sense to someone :

    ulong64* ph_dct_videohash(const char *filename, int &amp;Length){

       CImgList *keyframes = ph_getKeyFramesFromVideo(filename);
       if (keyframes == NULL)
       return NULL;

       Length = keyframes->size();

       ulong64 *hash = (ulong64*)malloc(sizeof(ulong64)*Length);
       CImg<float> *C = ph_dct_matrix(32);
       CImg<float> Ctransp = C->get_transpose();
       CImg<float> dctImage;
       CImg<float> subsec;
       CImg currentframe;

       for (unsigned int i=0;i &lt; keyframes->size(); i++){
       currentframe = keyframes->at(i);
       currentframe.blur(1.0);
       dctImage = (*C)*(currentframe)*Ctransp;
       subsec = dctImage.crop(1,1,8,8).unroll('x');
       float med = subsec.median();
       hash[i] =     0x0000000000000000;
       ulong64 one = 0x0000000000000001;
       for (int j=0;j&lt;64;j++){
           if (subsec(j) > med)
           hash[i] |= one;
           one = one &lt;&lt; 1;
       }
       }

       keyframes->clear();
       delete keyframes;
       keyframes = NULL;
       delete C;
       C = NULL;
       return hash;
    }
    </float></float></float></float>

    Any help is very much appreciated !

  • AR.Drone 2, ffmpeg avcodec_decode_video2( ) segmentation fault

    21 avril 2014, par mechanicalmanb

    I have been trying to decode the video stream from an AR.Drone 2.0 (http://ardrone2.parrot.com/) for a while now with no success. Despite several examples that I have been following closely (I’d paste links, but I am not allowed) I cannot escape a segmentation fault inside of the ffmpeg libavcodec library. I thought that perhaps I was making some kind of mistake in the multi-threaded structure I was building, so I cut out everything except the bare minimum you need to connect to the drone, collect a frame from the drone, and send it to ffmpeg’s avcodec_decode_video2() function.

    I compiled the ffmpeg source (I’ve actually tried three different releases !) and can get the ffplay utility to display the drone’s video TCP stream. The video lags significantly, but at least I know the drone isn’t sending me complete gibberish.

    Has anyone encountered a problem like this before ? What could be causing this segmentation fault, and what can I do about it ? Is there a way to isolate a test on ffmpeg so that I can be sure it is the library and not something I’ve been doing this entire time ?

    Thanks for your time.

    A pastebin with my code :
    http://pastebin.com/NYTf0NeT

    Some details on my ffmpeg and compiler set up :

    ffmpeg version 2.2.git Copyright (c) 2000-2014 the FFmpeg developers
     built on Mar  3 2014 18:05:42 with gcc 4.8 (Ubuntu 4.8.1-2ubuntu1~12.04)
     configuration:
     libavutil      52. 66.100 / 52. 66.100
     libavcodec     55. 52.102 / 55. 52.102
     libavformat    55. 33.100 / 55. 33.100
     libavdevice    55. 10.100 / 55. 10.100
     libavfilter     4.  2.100 /  4.  2.100
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 18.100 /  0. 18.100

    The output of my code and a backtrace at the segmentation fault :

    *********************** START ***********************



    booting...

    [h264 @ 0x604040] err{or,}_recognition separate: 1; 1

    [h264 @ 0x604040] err{or,}_recognition combined: 1; 1

    [h264 @ 0x604040] Unsupported bit depth: 0

    asked for 40000 bytes, received packet of 1448 bytes

    PaVE synchronized. YIPEEEEEEEEEEEEEEEEEEEEEEEE



    ---------------------------

    Codec : H264

    StreamID : 1

    Timestamp : 1031517 ms

    Encoded dims : 640 x 368

    Display dims : 640 x 360

    Header size : 76

    Payload size : 17583

    Size of SPS inside payload : 14

    Size of PPS inside payload : 10

    Slices in the frame : 1

    Frame Type / Number : IDR-Frame : 31467 : slide 1/1

    ---------------------------




    gathering payload...

    asked for 16211 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 14763 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 13315 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 11867 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 10419 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 8971 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 7523 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 6075 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 4627 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 3179 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 1731 bytes, received packet of 1448 bytes

    gathering payload...

    asked for 283 bytes, received packet of 283 bytes

    payload complete, attempting to decode frame




    Program received signal SIGSEGV, Segmentation fault.

    0x00007ffff73fccba in ?? () from /usr/lib/x86_64-linux-gnu/libavcodec.so.53

    (gdb) bt

    #0  0x00007ffff73fccba in ?? () from /usr/lib/x86_64-linux-gnu/libavcodec.so.53

    #1  0x00007ffff73fd8f5 in avcodec_decode_video2 () from /usr/lib/x86_64-linux-gnu/libavcodec.so.53

    #2  0x000000000040159f in fetch_and_decode(int, parrot_video_encapsulation_t, AVCodecContext*, AVFrame*)

       ()

    #3  0x00000000004019c6 in main ()

    EDIT : I used Valgrind to try and get a better picture of the seg fault, and received the following :

    ==4730== Invalid read of size 1
    ==4730==    at 0x5265CBA: ??? (in /usr/lib/x86_64-linux-gnu/libavcodec.so.53.35.0)
    ==4730==    by 0x52668F4: avcodec_decode_video2 (in /usr/lib/x86_64-linux-gnu/libavcodec.so.53.35.0)
    ==4730==    by 0x40140E: fetch_and_decode(int, AVCodecContext*, AVFrame*) (main.cpp:176)
    ==4730==    by 0x401757: main (main.cpp:273)
    ==4730==  Address 0x280056c46f9 is not stack'd, malloc'd or (recently) free'd
    ==4730==
    ==4730==
    ==4730== Process terminating with default action of signal 11 (SIGSEGV)
    ==4730==  Access not within mapped region at address 0x280056C46F9
    ==4730==    at 0x5265CBA: ??? (in /usr/lib/x86_64-linux-gnu/libavcodec.so.53.35.0)
    ==4730==    by 0x52668F4: avcodec_decode_video2 (in /usr/lib/x86_64-linux-gnu/libavcodec.so.53.35.0)
    ==4730==    by 0x40140E: fetch_and_decode(int, AVCodecContext*, AVFrame*) (main.cpp:176)
    ==4730==    by 0x401757: main (main.cpp:273)

    "Invalid read size of 1" refers to trying to access a byte outside the bounds of an array. Does this mean that the library is trying to access something outside the bounds of an array I’m giving it ? I’ve checked the AVPkt, and that seems fine. I’m still stumped !