Recherche avancée

Médias (1)

Mot : - Tags -/ogg

Autres articles (63)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

Sur d’autres sites (5476)

  • libswscale error Slice Parameters 0, 1080 are invalid

    3 mai 2023, par lokit khemka

    I am trying to scale a video from 1080p to 480p. For that, I have setup swscaler context as :

    &#xA;

    encoder_sc->sws_ctx = sws_getContext(1920, 1080,&#xA;                            AV_PIX_FMT_YUV420P, &#xA;                           854, 480, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL );&#xA;

    &#xA;

    However, when I am calling the scale frame function as

    &#xA;

    sws_scale_frame(encoder->sws_ctx, input_frame, input_frame);&#xA;

    &#xA;

    However, when I do that I am getting the error Slice parameter 0, 1080 are in valid. I am very new to FFMPEG and video processing in general. I could not find any solution while searching. Any help is greatly appreciated.

    &#xA;

    EDIT : I am including the entire source code because I cannot seem to solve the issue.

    &#xA;

    &#xA;&#xA;typedef struct StreamingContext{&#xA;    AVFormatContext* avfc;&#xA;    AVCodec *video_avc;&#xA;    AVCodec *audio_avc;&#xA;    AVStream *video_avs;&#xA;    AVStream *audio_avs;&#xA;    AVCodecContext *video_avcc;&#xA;    AVCodecContext *audio_avcc;&#xA;    int video_index;&#xA;    int audio_index;&#xA;    char* filename;&#xA;    struct SwsContext *sws_ctx;&#xA;}StreamingContext;&#xA;&#xA;&#xA;typedef struct StreamingParams{&#xA;    char copy_video;&#xA;    char copy_audio;&#xA;    char *output_extension;&#xA;    char *muxer_opt_key;&#xA;    char *muxer_opt_value;&#xA;    char *video_codec;&#xA;    char *audio_codec;&#xA;    char *codec_priv_key;&#xA;    char *codec_priv_value;&#xA;}StreamingParams;&#xA;&#xA;&#xA;int prepare_video_encoder(StreamingContext *encoder_sc, AVCodecContext *decoder_ctx, AVRational input_framerate,&#xA;                          StreamingParams sp)&#xA;{&#xA;    encoder_sc->video_avs = avformat_new_stream(encoder_sc->avfc, NULL);&#xA;    encoder_sc->video_avc = avcodec_find_encoder_by_name(sp.video_codec);&#xA;    if (!encoder_sc->video_avc)&#xA;    {&#xA;        logging("Cannot find the Codec.");&#xA;        return -1;&#xA;    }&#xA;&#xA;    encoder_sc->video_avcc = avcodec_alloc_context3(encoder_sc->video_avc);&#xA;    if (!encoder_sc->video_avcc)&#xA;    {&#xA;        logging("Could not allocate memory for Codec Context.");&#xA;        return -1;&#xA;    }&#xA;&#xA;    av_opt_set(encoder_sc->video_avcc->priv_data, "preset", "fast", 0);&#xA;    if (sp.codec_priv_key &amp;&amp; sp.codec_priv_value)&#xA;        av_opt_set(encoder_sc->video_avcc->priv_data, sp.codec_priv_key, sp.codec_priv_value, 0);&#xA;&#xA;    encoder_sc->video_avcc->height = decoder_ctx->height;&#xA;    encoder_sc->video_avcc->width = decoder_ctx->width;&#xA;    encoder_sc->video_avcc->sample_aspect_ratio = decoder_ctx->sample_aspect_ratio;&#xA;&#xA;    if (encoder_sc->video_avc->pix_fmts)&#xA;        encoder_sc->video_avcc->pix_fmt = encoder_sc->video_avc->pix_fmts[0];&#xA;    else&#xA;        encoder_sc->video_avcc->pix_fmt = decoder_ctx->pix_fmt;&#xA;&#xA;    encoder_sc->video_avcc->bit_rate = 2 * 1000 * 1000;&#xA;    encoder_sc->video_avcc->rc_buffer_size = 4 * 1000 * 1000;&#xA;    encoder_sc->video_avcc->rc_max_rate = 2 * 1000 * 1000;&#xA;    encoder_sc->video_avcc->rc_min_rate = 2.5 * 1000 * 1000;&#xA;&#xA;    encoder_sc->video_avcc->time_base = av_inv_q(input_framerate);&#xA;    encoder_sc->video_avs->time_base = encoder_sc->video_avcc->time_base;&#xA;&#xA;    //Creating Scaling Context&#xA;    encoder_sc->sws_ctx = sws_getContext(1920, 1080,&#xA;                            decoder_ctx->pix_fmt, &#xA;                           854, 480, encoder_sc->video_avcc->pix_fmt, SWS_BICUBIC, NULL, NULL, NULL );&#xA;    if (!encoder_sc->sws_ctx){logging("Cannot Create Scaling Context."); return -1;}&#xA;&#xA;    if (avcodec_open2(encoder_sc->video_avcc, encoder_sc->video_avc, NULL) &lt; 0)&#xA;    {&#xA;        logging("Could not open the Codec.");&#xA;        return -1;&#xA;    }&#xA;    avcodec_parameters_from_context(encoder_sc->video_avs->codecpar, encoder_sc->video_avcc);&#xA;    return 0;&#xA;}&#xA;&#xA;&#xA;&#xA;int transcode_video(StreamingContext *decoder, StreamingContext *encoder, AVPacket *input_packet, AVFrame *input_frame, AVFrame *scaled_frame)&#xA;{&#xA;    int response = avcodec_send_packet(decoder->video_avcc, input_packet);&#xA;    if (response &lt; 0)&#xA;    {&#xA;        logging("Error while sending the Packet to Decoder: %s", av_err2str(response));&#xA;        return response;&#xA;    }&#xA;&#xA;    while (response >= 0)&#xA;    {&#xA;        response = avcodec_receive_frame(decoder->video_avcc, input_frame);&#xA;        &#xA;        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF)&#xA;        {&#xA;            break;&#xA;        }&#xA;        else if (response &lt; 0)&#xA;        {&#xA;            logging("Error while receiving frame from Decoder: %s", av_err2str(response));&#xA;            return response;&#xA;        }&#xA;        if (response >= 0)&#xA;        {&#xA;            scaled_frame->format = encoder->video_avcc->pix_fmt;&#xA;            scaled_frame->width = 854;&#xA;            scaled_frame->height = 480;&#xA;            sws_scale_frame(encoder->sws_ctx, scaled_frame, input_frame);&#xA;            //ERROR is in the scaled_frame&#xA;            if (encode_video(decoder, encoder, scaled_frame)) &#xA;                return -1;&#xA;        }&#xA;&#xA;        av_frame_unref(input_frame);&#xA;    }&#xA;    return 0;&#xA;}&#xA;&#xA;

    &#xA;

  • Unable to allocate 47.5 MiB for an array with shape (1080, 1920, 3) and data type float64

    21 août 2022, par eragon

    Iam try to create a large video(longer than 3h)by CompositeVideoClip using moviepy.&#xA;The problem is it take too much ram (i have 32gb ram).It takes the whole ram (99%) by create a bunch of ffmpeg-win64-v4.2.2.exe ffmpeg-win64-v4.2.2.exe&#xA; it takes the whole ram

    &#xA;

    it create a bunch of ffmpeg-win64-v4.2.2.exe ffmpeg-win64-v4.2.2.exe

    &#xA;

    after it a while it said Unable to allocate 47.5 MiB for an array with shape (1080, 1920, 3) and data type float64.&#xA;here is my code :

    &#xA;

    def CombieVideo():&#xA;    global curentVideoLengt&#xA;    masterVideo = NULL&#xA;    for videoUrl in videoFiles:&#xA;        print(videoUrl)&#xA;        video = VideoFileClip(videoUrl).fx(vfx.fadein,1).fx(vfx.fadeout,1)&#xA;        curentVideoLengt &#x2B;= video.duration&#xA;        if curentVideoLengt >= (audioLen*60*60):&#xA;            break&#xA;        if masterVideo== NULL:&#xA;            masterVideo= video&#xA;        else:&#xA;            masterVideo = CompositeVideoClip([masterVideo,video])&#xA;            &#xA;    if curentVideoLengt &lt; (audioLen*60*60):&#xA;        videoUrl=random.choice(videoFiles)&#xA;        print(videoUrl)&#xA;        video =video(videoUrl).fx(vfx.fadein,1).fx(vfx.fadeout,1)&#xA;        curentVideoLengt= curentVideoLengt&#x2B;video.duration&#xA;        masterVideo = CompositeVideoClip([masterVideo,video])&#xA;        CombieVideo()&#xA;    else:&#xA;        masterVideo.audio = CompositeAudioClip(audios)&#xA;        masterVideo.write_videofile(&#x27;./MasterVideo/output_video.avi&#x27;, fps=30, threads=4, codec="png")&#xA;        &#xA;CombieVideo()&#xA;

    &#xA;

  • FFMPEG : alphaextract+split create transparent video in 1080 x 1920 pixels not working

    30 juin 2021, par Karim Elhalloumi

    Create your transparent video :&#xA;i found a solution to a problem of creating alpha from a video then put it next to original as an output it give one video with original+alpha&#xA;using this ffmpeg cmd :

    &#xA;

    ffmpeg -i video_name.video_extension -vf "split [a], pad=iw*2:ih [b], [a] alphaextract, [b] overlay=w" -y final_name_alpha.mp4&#xA;

    &#xA;

    source :https://docs.minsar.app/create/howtos/transparentvideos/&#xA;the problem is This operation with Ffmpeg will not work if your video is not in 16:9 format, or has no alpha background.

    &#xA;

    Result :&#xA;CMD Result &#xA;iwant put as input a template for phone size with black background and generate the 2 video in one

    &#xA;

    what Iam trying to get is video.mp4 :&#xA;Process here

    &#xA;

    I'm new to ffmpeg, is there any cmd to generate alpha next to original without having only black back ground and with 9:16 instead ?

    &#xA;

    &#xA;ffmpeg version 4.4-essentials_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;output.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf57.83.100&#xA;  Duration: 00:00:14.02, start: 0.000000, bitrate: 797 kb/s&#xA;  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 540x960, 662 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)&#xA;    Metadata:&#xA;      handler_name    : VideoHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;  Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      handler_name    : SoundHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))&#xA;  Stream #0:1 -> #0:1 (aac (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[Parsed_alphaextract_2 @ 000001a9dae4bdc0] Requested planes not available.&#xA;[Parsed_alphaextract_2 @ 000001a9dae4bdc0] Failed to configure input pad on Parsed_alphaextract_2&#xA;Error reinitializing filters!&#xA;Failed to inject frame into filter network: Invalid argument&#xA;Error while processing the decoded data for stream #0:0&#xA;[aac @ 000001a9dadd4280] Qavg: 6441.061&#xA;[aac @ 000001a9dadd4280] 2 frames left in the queue on closing&#xA;Conversion failed!&#xA;

    &#xA;

    cmd I'm using to merge video :

    &#xA;

    - filter_complexe "[2]split=2[color][alpha];[color]crop=iw/2:ih:0:0[color];[alpha]crop=iw/2:ih:iw/2:0[alpha];[color][alpha]alphamerge[ovrly];[0]scale=460:505,setsar=1[0_scaled];[1]scale=460:505,setsar=1[1_scaled];[3][0_scaled]overlay=x=80:y=175[base_img_1];[3][1_scaled]overlay=x=80:y=175[base_img_2];[base_img_1]zoompan=z=&#x27;if(lte(zoom,1.0),1.2,max(1.001,zoom-0.0006))&#x27;:d=25*14:s=540x960,fade=out:st=6:d=1:alpha=1,fade=t=in:st=0:d=1[video1];[base_img_2]zoompan=z=&#x27;if(lte(on,25*6),1,if(lte(zoom,-1.0),1.2,min(zoom&#x2B;0.0006,1.2)))&#x27;:d=25*14:s=540x960[video2];[video2][video1]overlay[overlay_video1];[overlay_video1][ovrly]overlay=0:0[base_video];[base_video][4]overlay=enable=&#x27;between(t,0,7)&#x27;:x=30:y=30[watermarked_part1];[watermarked_part1][4]overlay=enable=&#x27;between(t,7,14)&#x27;:x=(main_w-overlay_w-30):y=(main_h-overlay_h-10)[final_video]"&#xA;

    &#xA;