Recherche avancée

Médias (0)

Mot : - Tags -/clipboard

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

Autres articles (40)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

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

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (6515)

  • ffmpeg +libx264 iPhone -> 'avcodec_encode_video' return always 0 . please advice

    2 janvier 2014, par isaiah

                     av_register_all();

            AVCodec *codec ;
            AVCodecContext *c= NULL ;
            int  out_size, size, outbuf_size ;
            //FILE *f ;
            uint8_t *outbuf ;
    

    printf("Video encoding\n") ;

    /* find the mpeg video encoder */
    codec =avcodec_find_encoder(CODEC_ID_H264) ;//avcodec_find_encoder_by_name("libx264") ; //avcodec_find_encoder(CODEC_ID_H264) ;//CODEC_ID_H264) ;
    NSLog(@"codec = %i",codec) ;
    if (!codec)
    fprintf(stderr, "codec not found\n") ;
    exit(1) ;

    c= avcodec_alloc_context() ;

    /* put sample parameters */
    c->bit_rate = 400000 ;
    c->bit_rate_tolerance = 10 ;
    c->me_method = 2 ;
    /* resolution must be a multiple of two */
    c->width = 352 ;//width ;//352 ;
    c->height = 288 ;//height ;//288 ;
    /* frames per second */
    c->time_base= (AVRational)1,25 ;
    c->gop_size = 10 ; /* emit one intra frame every ten frames */
    //c->max_b_frames=1 ;
    c->pix_fmt = PIX_FMT_YUV420P ;

    c ->me_range = 16 ;
    c ->max_qdiff = 4 ;
    c ->qmin = 10 ;
    c ->qmax = 51 ;
    c ->qcompress = 0.6f ;

    'avcodec_encode_video' is always 0 .

    I guess that because 'non-strictly-monotonic PTS' warning, do you konw same situation ?

  • Android-NDK building using the Bambuser source

    13 juillet 2015, par Kenny910

    I am trying to use the FFmpeg source provided by the Bambuser.

    However, I am fail to build the files

    I get the following error :

    arm-linux-androideabi-gcc is unable to create an executable file.
    C compiler test failed.

    I have already set the NDK path to /home/android-ndk but still get this error

    And I am using Android-NDK-r5b

    can anyone help ? THX

    Here is my build.sh

    #!/bin/bash

    if [ "$NDK" = "" ]; then
       echo NDK variable not set, assuming ${HOME}/android-ndk
       export NDK=${HOME}/android-ndk
    fi

    SYSROOT=$NDK/platforms/android-3/arch-arm
    # Expand the prebuilt/* path into the correct one
    TOOLCHAIN=`echo $NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows`
    export PATH=$TOOLCHAIN/bin:$PATH

    rm -rf build/ffmpeg
    mkdir -p build/ffmpeg
    cd ffmpeg

    # Don't build any neon version for now
    for version in armv5te armv7a; do

       DEST=../build/ffmpeg
       FLAGS="--target-os=linux --cross-prefix=arm-linux-androideabi- --arch=arm"
       FLAGS="$FLAGS --sysroot=$SYSROOT"
       FLAGS="$FLAGS --soname-prefix=/data/data/com.streaming.realive/lib/"
       FLAGS="$FLAGS --enable-shared --disable-symver"
       FLAGS="$FLAGS --enable-small --optimization-flags=-O2"
       FLAGS="$FLAGS --enable-encoder=mpeg4 --enable-decoder=mpeg4"
       FLAGS="$FLAGS --enable-encoder=mpeg2video --enable-encoder=nellymoser"
       FLAGS="$FLAGS --enable-protocol=rtp --enable-protocol=rtmp"
       FLAGS="$FLAGS --enable-protocol=http --enable-protocol=tcp --enable-protocol=udp"
       FLAGS="$FLAGS --enable-protocol=file"

       case "$version" in
           neon)
               EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon"
               EXTRA_LDFLAGS="-Wl,--fix-cortex-a8"
               # Runtime choosing neon vs non-neon requires
               # renamed files
               ABI="armeabi-v7a"
               ;;
           armv7a)
               EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp"
               EXTRA_LDFLAGS=""
               ABI="armeabi-v7a"
               ;;
           *)
               EXTRA_CFLAGS=""
               EXTRA_LDFLAGS=""
               ABI="armeabi"
               ;;
       esac
       DEST="$DEST/$ABI"
       FLAGS="$FLAGS --prefix=$DEST"

       mkdir -p $DEST
       echo $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" > $DEST/info.txt
       ./configure $FLAGS --extra-cflags="$EXTRA_CFLAGS" --extra-ldflags="$EXTRA_LDFLAGS" | tee $DEST/configuration.txt
       [ $PIPESTATUS == 0 ] || exit 1
       make clean
       make -j4 || exit 1
       make install || exit 1

    done
  • Why doesn't this FFmpeg code create a video from a series of images ?

    20 octobre 2011, par user551117

    I have successfully compiled the FFmpeg library for use in an iOS application. I would like to use it for encoding a video from a series of images, but I can't seem to make it work.

    The following is the code that I am using to encode this video :

    AVCodec *codec;
    AVCodecContext *c= NULL;
    int i, out_size, size, outbuf_size;
    FILE *f;
    AVFrame *picture;
    uint8_t *outbuf;

    printf("Video encoding\n");

    /// find the mpeg video encoder
    codec=avcodec_find_encoder(CODEC_ID_MPEG4);
    //codec = avcodec_find_encoder(CODEC_ID_MPEG4);
    if (!codec) {
       fprintf(stderr, "codec not found\n");
       exit(1);
    }

    c= avcodec_alloc_context();
    picture= avcodec_alloc_frame();

    // put sample parameters
    c->bit_rate = 400000;
    /// resolution must be a multiple of two
    c->width = 320;
    c->height = 480;
    //frames per second
    c->time_base= (AVRational){1,25};
    c->gop_size = 10; /// emit one intra frame every ten frames
    c->max_b_frames=1;
    c->pix_fmt = PIX_FMT_YUV420P;

    //open it
    if (avcodec_open(c, codec) < 0) {
       fprintf(stderr, "could not open codec\n");
       exit(1);
    }

    f = fopen([[NSTemporaryDirectory() stringByAppendingPathComponent:filename] UTF8String], "w");
    if (!f) {
       fprintf(stderr, "could not open %s\n",[filename UTF8String]);
       exit(1);
    }

    // alloc image and output buffer
    outbuf_size = 100000;
    outbuf = malloc(outbuf_size);
    size = c->width * c->height;

    #pragma mark -
    AVFrame* outpic = avcodec_alloc_frame();
    int nbytes = avpicture_get_size(PIX_FMT_YUV420P, c->width, c->height);

    //create buffer for the output image
    uint8_t* outbuffer = (uint8_t*)av_malloc(nbytes);

    #pragma mark -  
    for(i=1;i<48;i++) {
       fflush(stdout);

       int numBytes = avpicture_get_size(PIX_FMT_YUV420P, c->width, c->height);
       uint8_t *buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t));

       UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", i]];
       CGImageRef newCgImage = [image CGImage];

       CGDataProviderRef dataProvider = CGImageGetDataProvider(newCgImage);
       CFDataRef bitmapData = CGDataProviderCopyData(dataProvider);
       buffer = (uint8_t *)CFDataGetBytePtr(bitmapData);  

       avpicture_fill((AVPicture*)picture, buffer, PIX_FMT_RGB24, c->width, c->height);
       avpicture_fill((AVPicture*)outpic, outbuffer, PIX_FMT_YUV420P, c->width, c->height);

       struct SwsContext* fooContext = sws_getContext(c->width, c->height,
                                                      PIX_FMT_RGB24,
                                                      c->width, c->height,
                                                      PIX_FMT_YUV420P,
                                                      SWS_FAST_BILINEAR, NULL, NULL, NULL);

       //perform the conversion
       sws_scale(fooContext, picture->data, picture->linesize, 0, c->height, outpic->data, outpic->linesize);
       // Here is where I try to convert to YUV

       // encode the image

       out_size = avcodec_encode_video(c, outbuf, outbuf_size, outpic);
       printf("encoding frame %3d (size=%5d)\n", i, out_size);
       fwrite(outbuf, 1, out_size, f);

       free(buffer);
       buffer = NULL;      

    }

    // get the delayed frames
    for(; out_size; i++) {
       fflush(stdout);

       out_size = avcodec_encode_video(c, outbuf, outbuf_size, NULL);
       printf("write frame %3d (size=%5d)\n", i, out_size);
       fwrite(outbuf, 1, outbuf_size, f);      
    }

    // add sequence end code to have a real mpeg file
    outbuf[0] = 0x00;
    outbuf[1] = 0x00;
    outbuf[2] = 0x01;
    outbuf[3] = 0xb7;
    fwrite(outbuf, 1, 4, f);
    fclose(f);
    free(outbuf);

    avcodec_close(c);
    av_free(c);
    av_free(picture);
    printf("\n");

    What could be wrong with this code ?