Recherche avancée

Médias (2)

Mot : - Tags -/rotation

Autres articles (81)

  • 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 (...)

  • 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 ;

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (7852)

  • Http Streaming from ffmpeg, How to get a sequenced packet ?

    10 septembre 2011, par manutd

    I am trying to make http streaming program.
    So I follow this code at this.
    However, when i decode, only one frame is decoded.
    I think I need call back function.
    Do you know how to make a call back function ?
    I know 'asf' packet's call back function is like int read_data(void *opaque, char *buf, int buf_size)

    But the other formats(mp3, ogg, aac, ..) doesn't work..

    Please help me.

    Any advice or comment are very appreciated.

    #include
    #include
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavformat></libavformat>avformat.h>
    #include <libavdevice></libavdevice>avdevice.h>

    int main(int argc, char **argv)
    {
           static AVInputFormat *file_iformat;
           static AVFormatContext *pFormatCtx;
           AVFormatParameters params;

           AVCodecContext *pCodecCtx;
           AVCodec *pCodec;

           const char url[] = "http://listen.radionomy.com/feelingfloyd";

           avcodec_register_all();
           avdevice_register_all();
           av_register_all();

           av_log_set_level(AV_LOG_VERBOSE);

           file_iformat = av_find_input_format("mp3"); /* mp3 demuxer */
           if (!file_iformat)
           {
                   fprintf(stderr, "Unknown input format: %s\n", &amp;url[0]);
                   exit(1);
           }

           //file_iformat->flags |= AVFMT_NOFILE; /* ??? */
           params.prealloced_context = 0;

           if (av_open_input_file(&amp;pFormatCtx, &amp;url[0], file_iformat, 0, &amp;params) != 0)
           {
                   fprintf(stderr, "err 1\n");
                   exit(2);
           }

           /* poulates AVFormatContex structure */
           if (av_find_stream_info(pFormatCtx) &lt; 0)
           {
                   fprintf(stderr, "err 2\n");
           }

           /* sanity check (1 stream) */
           if (pFormatCtx->nb_streams != 1 &amp;&amp;
                           pFormatCtx->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
           {
                   fprintf(stderr, "err 3\n");
           }

           pCodecCtx = pFormatCtx->streams[0]->codec;

           /* find decoder for input audio stream */
           pCodec = avcodec_find_decoder(pCodecCtx->codec_id);
           if (pCodec == NULL)
           {
                   fprintf(stderr, "err 4: unsupported codec\n");
           }

           if (pCodec->capabilities &amp; CODEC_CAP_TRUNCATED)
                   pCodecCtx->flags |= CODEC_FLAG_TRUNCATED;

           if (avcodec_open(pCodecCtx, pCodec) &lt; 0)
           {
                   fprintf(stderr, "err 5\n");
           }

           {
                   uint8_t *pAudioBuffer;
                   AVPacket pkt;

                   int ret;
                   int data_size = 2 * AVCODEC_MAX_AUDIO_FRAME_SIZE;

                   av_init_packet(&amp;pkt);
                   //pkt.data=NULL;
                   //pkt.size=0;
                   //pkt.stream_index = 0;

                   pAudioBuffer = av_malloc(data_size * sizeof(int16_t));

                   while (av_read_frame(pFormatCtx, &amp;pkt) == 0) {
                           //data_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
                           ret = avcodec_decode_audio3(pFormatCtx->streams[pkt.stream_index]->codec,
                                           (int16_t *)pAudioBuffer, &amp;data_size, &amp;pkt);

                           /* got an error (-32) here */
                           if (ret &lt; 0) {
                                   av_strerror(ret, (char *)pAudioBuffer, data_size);
                                   fprintf(stderr, "err 6 (%s)\n", pAudioBuffer);
                                   break;
                           }

                           printf("size=%d, stream_index=%d |ret=%d data_size=%d\n",
                                           pkt.size, pkt.stream_index, ret, data_size);
                           av_free_packet(&amp;pkt);
                   }

                   av_free(pAudioBuffer);
           }

           avcodec_close(pCodecCtx);
           av_close_input_file(pFormatCtx);

           return 0;
    }
  • FFMpeg doesn't convert the video, just creates a thumb... It was working now not ?

    20 septembre 2011, par Matt Reid

    Theres a site im making for someone where it uses FFMpeg to convert the files to MP4's... I set it up and got the converter working... but now a week or so later ive came to use it and it doesn't convert the video, it runs the create thumbnail exec() but the video exec() doesn't run. It returns a 1 status like its gone through but there is no converted file and the browser quickly processes the convert file rather than lagging for a few seconds like it did when it was working...

    Any ideas ?

    &lt;?php

    //Thumbnail VARS
    $tn_size = &#39;480x360&#39;;
    $tn_interval = 3;
    $tn_type = &#39;mjpeg&#39;;

    //Video VARS
    $vi_size = &#39;480x360&#39;;
    $vi_fileto = &#39;mp4&#39;;

    //Default Setup
    $id = $_GET[&#39;ListingID&#39;];
    $ext = $_GET[&#39;Ext&#39;];
    $temp_url = &#39;/var/www/files/videos-tmp/&#39;.$id.".".$ext;
    $new_url = &#39;/var/www/files/videos/&#39;.$id.".mp4";
    $new_url_thumb = &#39;/var/www/files/videos-thumb/&#39;.$id.".jpg";

    //echo $new_url."<br />".$id." ".$ext. " " .$temp_url;

    //Do
    if(file_exists($temp_url)) {
    @unlink($new_url);
    //echo "/usr/local/bin/ffmpeg -i {$temp_url} -f {$vi_fileto} -r 25 -ar 22050 -ab 48000      -ac 1 -s {$vi_size} {$new_url}";
    exec("/usr/local/bin/ffmpeg -i {$temp_url} -deinterlace -an -ss $tn_interval -f {$tn_type} -t 1 -r 1 -y -s $tn_size &#39;{$new_url_thumb}&#39;"); //make thumbnai
    exec("/usr/local/bin/ffmpeg -i {$temp_url} -f {$vi_fileto} -r 25 -ar 22050 -ab 48000 -ac 1 -s {$vi_size} {$new_url}",$output,$status); //convert video

    //@unlink($temp_url);
    if(isset($_GET[&#39;UsrOvr&#39;])) { } else {
    echo "<b>Convert Complete</b>";
    echo "<br /><br />Return to listings <a href="http://stackoverflow.com/feeds/tag/&#39;admin_listings.php&#39;">page</a>.";
    exit;
    }
    } else {
    die("The video selected does not exist!");
    }
    ?>
  • need to Setup ffmpeg in eclipse for windows

    16 décembre 2011, par user1101687

    i am getting this error !

    Building target: cyg.exe
    Invoking: Cygwin C Linker
    gcc -L"C:\cygwin\usr\libjjmpeg.so" -o "cyg.exe"  ./tut.o   -lavcodec
    /usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: cannot find -lavcodec
    collect2: ld returned 1 exit status
    makefile:29: recipe for target `cyg.exe&#39; failed
    make: *** [cyg.exe] Error 1