Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (39)

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

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 is the first MediaSPIP stable release.
    Its official release date is June 21, 2013 and is announced here.
    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 (...)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

Sur d’autres sites (6653)

  • video4linux2 : Avoid a floating point exception

    27 juillet 2014, par Bernhard Übelacker
    video4linux2 : Avoid a floating point exception
    

    This avoids a segfault in avconv_opt.c:opt_target when trying to
    determine the norm.

    • [DBH] avconv_opt.c
  • video4linux2 : Avoid a floating point exception

    27 juillet 2014, par Bernhard Übelacker
    video4linux2 : Avoid a floating point exception
    

    This avoids a segfault in avconv_opt.c:opt_target when trying to
    determine the norm.

    • [DH] avconv_opt.c
  • 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;