Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (89)

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (3747)

  • Ffmpeg H.264 encode video is sped up if camera capture with low light

    10 août 2020, par Expressingx

    I'm encoding everything to H.264. If h264_qsv is available I'm using it, else libx264. Works fine, but I noticed that if the camera is recording in low light, the video saved is sped up like x2 or x3. And I'm not sure where the problem is. Creating the input format context :

    


        private AVFormatContext* CreateFormatContext()
    {
        AVDictionary* options = null;

        ffmpeg.av_dict_set(&options, "packet-buffering", "0", 0);
        ffmpeg.av_dict_set(&options, "sync", "1", 0);
        ffmpeg.av_dict_set(&options, "rtsp_transport", "tcp", 0);
        ffmpeg.av_dict_set(&options, "reconnect", "1", 0);
        ffmpeg.av_dict_set(&options, "analyzeduration", "2000000", 0);
        ffmpeg.av_dict_set(&options, "probesize", (16384 * 16).ToString(), 0);
        ffmpeg.av_dict_set(&options, "max_delay", "0", 0);
        ffmpeg.av_dict_set(&options, "reorder_queue_size", "0", 0);
        ffmpeg.av_dict_set(&options, "skip_frame", "8", 0);
        ffmpeg.av_dict_set(&options, "skip_loop_filter", "48", 0);
        ffmpeg.av_dict_set(&options, "rtbufsize", "1000M", 0);

        AVFormatContext* pInputFmtCtx = ffmpeg.avformat_alloc_context();

        AVInputFormat* inputFormat = null;

        if (!string.IsNullOrEmpty(_format))
        {
            inputFormat = ffmpeg.av_find_input_format(_format);

            if (inputFormat == null)
            {
                //throw
            }
        }

        int ret = ffmpeg.avformat_open_input(&pInputFmtCtx, _streamUrl, inputFormat, &options);

        if (ret != 0)
        {
            //throw
        }

        return pInputFmtCtx;
    }


    


    video decoder

    


        private void CreateVideoDecoder()
    {
        AVStream* videoStream = InputFormatContext->streams[VideoStreamIndex];
        AVCodecParameters* videoCodecParams = videoStream->codecpar;
        AVCodec* videoDecoder = ffmpeg.avcodec_find_decoder(videoCodecParams->codec_id);

        VideoDecodeContext = ffmpeg.avcodec_alloc_context3(videoDecoder);

        if (ffmpeg.avcodec_parameters_to_context(VideoDecodeContext, videoCodecParams) < 0)
        {
            //throw
        }

        if (ffmpeg.avcodec_open2(VideoDecodeContext, videoDecoder, null) < 0)
        {
            //throw
        }
    }


    


    and the h264 encoder

    


    private void CreateH264Encoder(AVStream* inputStream, AVStream* outputStream)
    {
        AVRational framerate = ffmpeg.av_guess_frame_rate(_inputContext.InputFormatContext, inputStream, null);

        AVCodec* videoEncoder = ffmpeg.avcodec_find_encoder_by_name("h264_qsv");
        if (videoEncoder == null)
        {
            videoEncoder = ffmpeg.avcodec_find_encoder_by_name("libx264");
            PixelFormat = AVPixelFormat.AV_PIX_FMT_YUV420P;
        }

        if (videoEncoder == null)
        {
            //throw
        }

        VideoEncodeContext = ffmpeg.avcodec_alloc_context3(videoEncoder);

        if (VideoEncodeContext == null)
        {
            //throw
        }

        VideoEncodeContext->width = _inputContext.VideoDecodeContext->width;
        VideoEncodeContext->height = _inputContext.VideoDecodeContext->height;
        VideoEncodeContext->pix_fmt = PixelFormat;
        VideoEncodeContext->bit_rate = 2 * 1000 * 1000;
        VideoEncodeContext->rc_buffer_size = 4 * 1000 * 1000;
        VideoEncodeContext->rc_max_rate = 2 * 1000 * 1000;
        VideoEncodeContext->rc_min_rate = 3 * 1000 * 1000;
        VideoEncodeContext->framerate = framerate;
        VideoEncodeContext->max_b_frames = 0;
        VideoEncodeContext->time_base = ffmpeg.av_inv_q(framerate);
        VideoEncodeContext->flags |= ffmpeg.AV_CODEC_FLAG_GLOBAL_HEADER;

        ffmpeg.av_opt_set(VideoEncodeContext->priv_data, "preset", "slow", 0);
        ffmpeg.av_opt_set(VideoEncodeContext->priv_data, "vprofile", "baseline", 0);

        if (ffmpeg.avcodec_open2(VideoEncodeContext, videoEncoder, null) < 0)
        {
            //throw
        }

        ffmpeg.avcodec_parameters_from_context(outputStream->codecpar, VideoEncodeContext);
    }


    


    I'm using ffmpeg 4.0.1, so I'm decoding/encoding with the new format API which I'll skip to share for now because its nothing more than following the link : https://ffmpeg.org/doxygen/3.3/group__lavc__encdec.html

    


  • Joining Lots of clips with crossfade filter using FFmpeg

    26 juillet 2020, par Mr. Who

    I have many video-only clips and I would like to join them with crossfade filter using FFmpeg. My Idea was that I join first two then join it with the next and so on. I implemented the loop in the python and run bash commend using os.system(). My code has been demonstrated below :

    


    out_n = '0.mp4' # output of step n (current step)
for i in range(1,10):
    out_np1 = 'mm%d.mp4'%(i)  # output of step n+1 (next step)
    t0 = time.time() 
    o = os.system('ffmpeg  -i %s -i %d.mp4  -f lavfi -i "color=black:s=1920x1080:d=9" -filter_complex "[0:v]format=pix_fmts=yuva420p,fade=t=out:st=4:d=1:alpha=1,setpts=PTS-STARTPTS[va0];[1:v]format=pix_fmts=yuva420p,fade=t=in:st=0:d=1:alpha=1,setpts=PTS-STARTPTS+4/TB[va1];[2:v][va0]overlay[over1];[over1][va1]overlay=format=yuv420[outv]" -vcodec libx264 -map [outv] %s'%(out_n, i, out_np1))
    print('# %d'%i,(time.time() - t0)/60,o)
    os.remove(out_n) 
    out_n = out_np1  


    


    My Problem is that it won't work properly, the very last output does not even contain all of the last clip and there is no trace of previous ones.

    


  • Linux - ffmpeg 3.4.6 vs. 4.2.1 - bash script with Tee (record & stream) runs in older version just fine - what needs to change for new version ?

    22 juillet 2020, par pomptondrive

    Thanks for reading my post. I have a bash script that I tested and it ran just fine ; although I was putting the script into identical hardware as the test computer, I forgot that the target computer would have a newer version of ffmpeg. It should be simple. I'm splitting the signal, recording, and streaming via UDP. Here's the script, that runs just fine with ffmpeg 3.4.6 :

    


    ffmpeg -f v4l2 -i /dev/video0 -t 00:30:00 -vf "drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf:text='%{localtime\:%T}':x=20:y=20:fontcolor=white" \
-profile:v high -pix_fmt yuvj420p -level:v 4.1 -preset ultrafast -tune \
zerolatency -vcodec libx264 -r 15 -b:v 512k -s 960x720 -f mpegts -flush_packets 0 \
-f tee -map 0:v "/media/dkm/video_usb/videos/video_$(date +%Y-%m-%d_%H.%M.%S).mkv|[f=mpegts]udp://192.168.0.19:5000?pkt_size=1316"


    


    I could try to downgrade, but that doesn't seem right, since that computer is running Linux Mint 19.2 and the original test computer was Ubuntu 18.4 LTS. Is there something basic that I need to change for v. 4.2.1 ?

    


    I'm hoping that this is a quick fix, since it runs in the old version, but I've learned not to get my hopes up for such things. Any help would be appreciated. I've perused the documentation, but I wasn't able to see anything salient. Thanks in advance !