Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (33)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

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

Sur d’autres sites (3684)

  • memcpy to av_malloc's memory crash

    26 octobre 2023, par PeacefulWindy

    I use the code in x64 windows :

    


    #include<iostream>&#xA;#include<memory>&#xA;#include<vector>&#xA;extern "C"&#xA;{&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include<libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>imgutils.h>&#xA;#include<libswscale></libswscale>swscale.h>&#xA;#include<libswresample></libswresample>swresample.h>&#xA;}&#xA;&#xA;struct BufferData&#xA;{&#xA;    uint8_t* ptr;&#xA;    size_t size;&#xA;    size_t file_size;&#xA;};&#xA;&#xA;int main()&#xA;{&#xA;    auto file=fopen("E:/test.jpg", "rb");&#xA;    fseek(file, 0, SEEK_END);&#xA;    auto fileSize = ftell(file);&#xA;    fseek(file, 0, SEEK_SET);&#xA;    auto data = std::vector(fileSize);&#xA;    fread(data.data(), sizeof(uint8_t), fileSize, file);&#xA;    fclose(file);&#xA;&#xA;    auto test = BufferData();&#xA;    test.ptr = data.data();&#xA;    test.size = data.size();&#xA;    test.file_size = data.size();&#xA;    auto buffer = (uint8_t*)av_malloc(4096 * 10);&#xA;    char errStr[128] = { 0 };&#xA;&#xA;    auto avformatContext = avformat_alloc_context();&#xA;    auto avioContext = avio_alloc_context(buffer, 4096, 0, &amp;test, [](void* opaque, uint8_t* buf, int buf_size)&#xA;        {&#xA;            BufferData* bd = (BufferData*)opaque;&#xA;            auto size = std::min(bd->size, (size_t)buf_size);&#xA;&#xA;            if (!size)&#xA;            {&#xA;                return -1;&#xA;            }&#xA;&#xA;            memcpy(buf, bd->ptr, size);&#xA;            bd->ptr &#x2B;= size;&#xA;            bd->size -= size;&#xA;            return (int)size;&#xA;        }, NULL, NULL);&#xA;    avformatContext->pb = avioContext;&#xA;    avformatContext->flags = AVFMT_FLAG_CUSTOM_IO;&#xA;&#xA;    auto ret = avformat_open_input(&amp;avformatContext, nullptr, nullptr, nullptr);&#xA;    if (ret != 0)&#xA;    {&#xA;        av_strerror(ret, errStr, sizeof(errStr));&#xA;        std::cout &lt;&lt; errStr &lt;&lt; std::endl;&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    ret = avformat_find_stream_info(avformatContext, nullptr);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        av_strerror(ret, errStr, sizeof(errStr));&#xA;        std::cout &lt;&lt; errStr &lt;&lt; std::endl;&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    av_dump_format(avformatContext, 0, nullptr, 0);&#xA;&#xA;    auto videoIndex = av_find_best_stream(avformatContext, AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0);&#xA;    if (videoIndex == AVERROR_STREAM_NOT_FOUND)&#xA;    {&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;    else if (videoIndex == AVERROR_DECODER_NOT_FOUND)&#xA;    {&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    auto videoCodecPar = avformatContext->streams[videoIndex]->codecpar;&#xA;    auto videoCodec = avcodec_find_decoder(videoCodecPar->codec_id);&#xA;    if (!videoCodec)&#xA;    {&#xA;        av_free(buffer);&#xA;        avformat_close_input(&amp;avformatContext);&#xA;        return 0;&#xA;    }&#xA;&#xA;    av_free(buffer);&#xA;    avformat_close_input(&amp;avformatContext);&#xA;}&#xA;</vector></memory></iostream>

    &#xA;

    I use memcpy to copy data to buffer,it run to av_free(buffer) get crash.&#xA;ffmpeg version is 6.0.&#xA;Visual Studio version is 2022 with CMake.

    &#xA;

    Use fread replace memcpy,it can work !But I need to resolve load from std::vector memory,not fread.&#xA;I think maybe memory-align problem when run av_free,but I no way to find the cause.

    &#xA;

  • FFmpeg batchfile to compress images JPG JPEGs and keep EXIF (metadata)

    24 novembre 2023, par esdoublelef

    I tried searching everywhere for a possible solution but I really can't find it. Hope someone can help me out here.

    &#xA;

    I have written a batch file to use FFmpeg to compress and sharpen JPGs in a folder.

    &#xA;

    @ECHO ON&#xA;  FOR %%a in (*.jpg) DO (ffmpeg -i "%%a" -q:v 8 -vf unsharp=5:5:1.0:5:5:0.0 "2022 01 22 %%~na".jpg)&#xA;PAUSE&#xA;

    &#xA;

    The new file comes out smaller in size, but is missing all the EXIF information that the original photo has.

    &#xA;

    I tried to add in the command -metadata but apparently it works for MP4 only. I have an existing solution with ImageMagick but I'm hoping to solve this via FFmpeg.

    &#xA;

    Or is there a way to integrate exiftool into the batch file ?

    &#xA;

    Thank you and I really appreciate any help here.

    &#xA;

  • Latest FFmpeg fails to create a good MP4 out of JPG file (Windows 10)

    30 décembre 2023, par mengrie

    I am using FFmpeg to create an MP4 file out of several JPG files. The command to accomplish this

    &#xA;

    ffmpeg.exe ^&#xA;-hide_banner -nostats -loglevel error -y ^&#xA;-loop 1 -t 6 -i 001.jpg ^&#xA;-loop 1 -t 6 -i 002.jpg ^&#xA;-loop 1 -t 6 -i 003.jpg ^&#xA;-loop 1 -t 6 -i 004.jpg ^&#xA;-loop 1 -t 6 -i 005.jpg ^&#xA;-loop 1 -t 6 -i 006.jpg ^&#xA;-filter_complex ^&#xA;"[0:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=out:st=5:d=1[v0]; ^&#xA;[1:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=5:d=1[v1]; ^&#xA;[2:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=5:d=1[v2]; ^&#xA;[3:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=5:d=1[v3]; ^&#xA;[4:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=5:d=1[v4]; ^&#xA;[5:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1,fade=t=in:st=0:d=1,fade=t=out:st=5:d=1[v5]; ^&#xA;[v0][v1][v2][v3][v4][v5]concat=n=6:v=1:a=0,format=yuv420p[v]" -map "[v]" -r 30 006.mp4&#xA;

    &#xA;

    Using "ffmpeg version 2022-12-25-git-eeb280f351-full_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 12.1.0 (Rev2, Built by MSYS2 project)" does the job as expected.

    &#xA;

    However, yesterdag I downloaded (from gyan.dev - Windows - ffmpeg-git-full.7z) the latest version and upgrade the tool. "ffmpeg version 2023-12-28-git-c1340f3439-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers built with gcc 12.2.0 (Rev10, Built by MSYS2 project)"

    &#xA;

    Using this version, the MP4 contains only a few JPGs and timing is also messed up, resulting in a useless MP4.

    &#xA;

    Has something changed or are these parameters causing a new behaviour ?

    &#xA;

    Thx

    &#xA;

    In meanwhile I went back to older version

    &#xA;