Recherche avancée

Médias (91)

Autres articles (75)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

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

Sur d’autres sites (3563)

  • ffmpeg got black and white video when encoding flv

    17 décembre 2012, par samyou

    i searched the site and got a post :
    getting black and white image after encoding
    but i got no answer.

    don't know how but it is all black and white.

    hear is the init code :

    JNIEXPORT jboolean JNICALL Java_sam_flvmuxer_SamRTMPNative_nativeInitMuxerAndStart(
       JNIEnv *env, jclass jcls, jstring outfile, jint inwidth, jint inheight,
       jint fps) {
    audioOutBuffer = malloc(AUDIO_OUT_BUFFER_SIZE);
    videoOutBuffer = malloc(VIDEO_OUT_BUFFER_SIZE);
    VIDEO_WIDTH = inwidth;
    VIDEO_HEIGHT = inheight;
    av_log_set_callback(samffmpeglogback);
    av_register_all();
    char *filepath = (*env)->GetStringUTFChars(env, outfile, 0);
    JNILOG("file path is %s",filepath);
    avformat_alloc_output_context2(&avFormatContext, NULL, NULL, filepath);
    if (!avFormatContext) {
       JNILOG("avformat_alloc_output_context2 with filepath failed");
       return JNI_FALSE;
    }
    AVOutputFormat *fmt = avFormatContext->oformat;
    //fmt->video_codec = VIDEO_CODEC_ID;
    ////init video
    avVideoStream = avformat_new_stream(avFormatContext, NULL );
    if (!avVideoStream) {
       (*env)->ReleaseStringUTFChars(env, outfile, filepath);
       return 0;
    }

    AVCodec *videocodec = avcodec_find_encoder(VIDEO_CODEC_ID);
    if (!videocodec) {
       JNILOG("avcodec_find_encoder error");
       return JNI_FALSE;
    }
    avcodec_get_context_defaults3(avVideoStream->codec, videocodec);

    AVCodecContext *avVideoCodecContext = avVideoStream->codec;
    avVideoCodecContext->codec_type = AVMEDIA_TYPE_VIDEO;
    avVideoCodecContext->codec_id = VIDEO_CODEC_ID;
    avVideoCodecContext->width = inwidth;
    avVideoCodecContext->height = inheight;
    avVideoCodecContext->time_base.den = fps;
    avVideoCodecContext->time_base.num = 1;
    avVideoCodecContext->gop_size = 10;
    avVideoCodecContext->pix_fmt = PIX_FMT_YUV420P;
    JNILOG("bitrate befort set = %d",avVideoCodecContext->bit_rate);
    avVideoCodecContext->bit_rate = 600000;


    if (fmt->flags & AVFMT_GLOBALHEADER)
       avVideoCodecContext->flags |= CODEC_FLAG_GLOBAL_HEADER;

    av_dump_format(avFormatContext,0,filepath,1);
    if(avcodec_open2(avVideoCodecContext,videocodec,NULL)<0)
    {
       JNILOG("video avcodec_open2 failed");
       (*env)->ReleaseStringUTFChars(env, outfile, filepath);
       return JNI_FALSE;
    }



    ///////
    /* open the output file, if needed */
    if (!(fmt->flags & AVFMT_NOFILE)) {
       if ((avio_open(&avFormatContext->pb, filepath, AVIO_FLAG_WRITE)) < 0) {
           JNILOG("Could not open file!");
           (*env)->ReleaseStringUTFChars(env, outfile, filepath);
           return 0;
       }
    }
    if (avformat_write_header(avFormatContext, NULL ) < 0) {
       JNILOG("Could not avformat_write_header!");
       (*env)->ReleaseStringUTFChars(env, outfile, filepath);
       return 0;
    }
    (*env)->ReleaseStringUTFChars(env, outfile, filepath);
    YUVFrame = avcodec_alloc_frame();
    JNILOG("ffmpeg every thing inited");
    return JNI_TRUE;
    }

    and encode code looks like below :

    avpicture_fill((AVPicture *)YUVFrame,framedata,PIX_FMT_YUV420P,VIDEO_WIDTH,VIDEO_HEIGHT);
       ///打印data 分量!!!!
       AVPacket pkt;
       av_init_packet(&pkt);
       pkt.data = videoOutBuffer;
       pkt.size = VIDEO_OUT_BUFFER_SIZE;
       int gotpkt = 0;
       avcodec_encode_video2(avVideoStream->codec,&pkt,YUVFrame,&gotpkt);
       if (gotpkt > 0) {
           JNILOG("encoded size=%d,gotpktflag=%d",pkt.size,gotpkt);
           pkt.stream_index = avVideoStream->index;
           pkt.flags |= AV_PKT_FLAG_KEY;
           pkt.pts = timestamp;
           while (pkt.pts <= lastVideoPts) {
               pkt.pts++;
           }
           lastVideoPts = pkt.pts;
           if (av_interleaved_write_frame(avFormatContext, &pkt) < 0) {
               JNILOG("av_interleaved_write_frame failed");
           }
       }

    someone please help me with this problem^^

  • FFMPEG add circular mask to videos, convert to black and white and concatenate

    3 mai 2018, par Yassine

    Hello everyone i’m a beginner and i would appreciate your help.

    I’m making a mobile application that generates custom video resumes based on the user’s videos taken from his phone, the user has to upload 5 different videos to the server from the mobile application, in the server side i want to :

    • Add a .png circular mask to each video.
    • Make each video black and white.
    • Concatenate the videos with other already existing title videos
      (e.g [userVideo1] [title1] [userVideo2] [title2]...) Visual Example

      [Edit : I would like more features]

    • Add background music
    • Add watermark logo in the middle
    • Remove silent footage from the beginning and from the end
    • Some input videos might be rotated, i want to rotate videos back to normal if they are rotated.

    So far i managed to add the circular mask, make the videos black and white and concatenate 3 videos including a premade title video, but the second user video has no sound in the output.

    This is the script i ended up with :

    ffmpeg -i uservid1.mov -i uservid2.mp4 -i mask.png -i title1.mp4  -preset
    ultrafast -filter_complex "

    [2:v][0:v]scale2ref[s1][s2];    
    [s2][s1]overlay[vid1];  
    [2:v][1:v]scale2ref[s3][s4];
    [s4][s3]overlay[vid2];  
    [vid1]hue=s=0[v0];
    [vid2]hue=s=0[v1];  
    [v0]scale=720x400[in0];
    [v1]scale=720x400[in1];
    [3:v]scale=720x400[in3];
    [in0]setsar=sar=0[final0];
    [in1]setsar=sar=0[final1];      
    [in3]setsar=sar=0[final3];
    [final0][final3][final1]concat=n=3;"

    -codec:a copy finalCV.mp4  
  • Compile x86/swscale_template with -mno-red-zone.

    21 septembre 2011, par Reimar Döffinger

    Compile x86/swscale_template with -mno-red-zone.