Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (22)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (3929)

  • how to decode wmp3 video using libavcodec ? (ffmpeg)

    13 mars 2012, par Renan Elias

    I'm developing an application that reads a live tv stream from the internet and I need to play it on my ipad application.

    I've compiled the ffmpeg into my ipad application to use the libavcodec lib, but I've not been able to use it in this lib...

    I know how to get the stream packets, read if it is an audio or video packet, but I don't know how to use the lib to convert the original packet codecs to h264 and mp3 codec...

    I need to convert an stream packet wmv3 to h264 and save it on a file.

    My code is below...

    AVFormatContext* pFormatCtx = avformat_alloc_context();
    int             i, videoStream, audioStream;
    AVCodecContext  *pCodecCtx;
    AVCodecContext *aCodecCtx;
    AVCodec         *pCodec;
    AVCodec         *aCodec;
    AVFrame         *pFrame;
    AVFrame         *pFrameRGB;
    AVPacket        packet;
    int             frameFinished;
    int             numBytes;
    uint8_t         *buffer;

    static struct SwsContext *img_convert_ctx;


    // Register all formats and codecs
    av_register_all();
    avcodec_register_all();
    avformat_network_init();

    // Open video file
    if(avformat_open_input(&pFormatCtx, [objURL cStringUsingEncoding:NSASCIIStringEncoding] ,NULL,NULL) != 0){
       return -1;
    }

    // Retrieve stream information
    if(avformat_find_stream_info(pFormatCtx, NULL)<0)
       return -1; // Couldn't find stream information

    // Dump information about file onto standard error
    av_dump_format(pFormatCtx, 0, [objURL cStringUsingEncoding:NSASCIIStringEncoding], 0);

    // Find the first video stream
    videoStream=-1;
    audioStream=-1;
    for(i=0; i < pFormatCtx->nb_streams; i++) {
       if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO && videoStream < 0) {
           videoStream=i;
       }
       if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO && audioStream < 0) {
           audioStream=i;
       }
    }
    if(videoStream==-1)
       return -1; // Didn't find a video stream
    if(audioStream==-1)
       return -1;

    // Get a pointer to the codec context for the video stream
    pCodecCtx=pFormatCtx->streams[videoStream]->codec;

    // Find the decoder for the video stream
    pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
    if(pCodec==NULL) {
       fprintf(stderr, "Unsupported codec!\n");
       return -1; // Codec not found
    }

    // Open codec
    if(avcodec_open2(pCodecCtx, pCodec, NULL)<0)
       return -1; // Could not open codec

    // Get a pointer to the codec context for the audio stream
    aCodecCtx=pFormatCtx->streams[audioStream]->codec;

    // Find the decoder for the audio stream
    aCodec = avcodec_find_decoder(aCodecCtx->codec_id);
    if(!aCodec) {
       fprintf(stderr, "Unsupported codec!\n");
       return -1; // Codec not found
    }

    // Open codec
    if(avcodec_open2(aCodecCtx, aCodec, NULL)<0)
       return -1; // Could not open codec

    // Allocate video frame
    pFrame=avcodec_alloc_frame();

    // Allocate an AVFrame structure
    pFrameRGB=avcodec_alloc_frame();
    if(pFrameRGB==NULL)
       return -1;

    // Determine required buffer size and allocate buffer
    numBytes=avpicture_get_size(PIX_FMT_RGB24, pCodecCtx->width,
                               pCodecCtx->height);
    buffer=(uint8_t *)av_malloc(numBytes*sizeof(uint8_t));

    // Assign appropriate parts of buffer to image planes in pFrameRGB
    // Note that pFrameRGB is an AVFrame, but AVFrame is a superset
    // of AVPicture
    avpicture_fill((AVPicture *)pFrameRGB, buffer, PIX_FMT_RGB24,
                  pCodecCtx->width, pCodecCtx->height);

    // Read frames and save first five frames to disk
    i=0;
    while(av_read_frame(pFormatCtx, &packet)>=0) {
       // Is this a packet from the video stream?
       if(packet.stream_index==audioStream) {
           NSLog(@"Audio.. i'll solve the video first...");
       } else if(packet.stream_index==videoStream) {

           /// HOW CONVERT THIS VIDEO PACKET TO H264 and save on a file? :(
       }

       // Free the packet that was allocated by av_read_frame
       av_free_packet(&packet);
    }

    // Free the RGB image
    av_free(buffer);
    av_free(pFrameRGB);

    // Free the YUV frame
    av_free(pFrame);

    // Close the codec
    avcodec_close(pCodecCtx);

    // Close the video file
    avformat_close_input(&pFormatCtx);

    return 0;
  • ffmpeg - how does moving overlay / text command work ?

    7 mars 2015, par Stpn

    In Ffmpeg you can create moving text :

    ffmpeg -y -t 10 -s qcif -f rawvideo -pix_fmt rgb24 -s 1280x720 -i /dev/zero -g 1 -r 24 -vf drawtext="fontfile=~/fonts/Trebuchet_MS.ttf:text='thing crawls':fontsize=155:fontcolor=red:y=h-20*t" wow.mpg

    So this will give me a black frame with "thing crawls" slowly going from bottom up..

    If I know the length of the video (20 seconds) and want to, for example create "thing falls" that starts at the top of the screen at time 0 and goes to the bottom of the screen until 00:00:20, how do I do that ?

    Also can I create the situation where the text will start going from top to bottom, but stop at the middle of the screen ?

  • Set up a Red5 server with FFmpeg for live streaming to iOS

    13 mars 2013, par Giancarlo Molina

    I'm an app developer and I need to implement FFmpeg to transcode/change an rtmp live stream to an http live stream so that I can play it on any iOS device (iPhone and iPad).

    My problem is that I am fairly new when it comes to server, media stuff and FFmpeg. And I need to change the server so that I can transcode the live stream on the server side (which I have read that is possible). Any tips, suggestions, sample code, or tutorials would be of great help.