Recherche avancée

Médias (91)

Autres articles (97)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

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

  • Installation en mode standalone

    4 février 2011, par

    L’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
    [mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
    Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)

Sur d’autres sites (7756)

  • libavfilter : vf_scale : Properly take in->color_range into account

    23 février 2022, par Martin Storsjö
    libavfilter : vf_scale : Properly take in->color_range into account
    

    While swscale can be reconfigured with sws_setColorspaceDetails,
    the in/out ranges also need to be set before calling
    sws_init_context, otherwise the initialization might choose
    fastpaths that don't take the ranges into account.

    Therefore, look at in->color_range too, when deciding on whether
    the scaler needs to be reconfigured.

    Add a new member variable for keeping track of this, for being
    able to differentiate between whether the scale filter parameter
    "in_range" has been set (which should override whatever the input
    frame has set) or whether it has been configured based on the
    latest frame (which should trigger reconfiguring the scaler if
    the input frame ranges change).

    Fixes : Ticket #9576

    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavfilter/vf_scale.c
  • In ffmpeg command-line, how to show all filter settings and their parameters before encoding ?

    7 décembre 2023, par F.X.

    Is there a way to force the ffmpeg command-line to display a comprehensive list of all filters and their parameters, even those that are applied automatically like -vf scale ?

    &#xA;

    (EDIT : To clarify, I do not mean filter documentation, but rather displaying filters that are instantiated at runtime for a particular command-line, just before transcoding starts. The goal of this is mostly checking that ffmpeg is indeed doing the right thing and not inserting/changing filters when I do not intend it to.)

    &#xA;

    There are a few options available, but none are comprehensive enough. For example :

    &#xA;

      &#xA;
    • The lavfi module has a dumpgraph option (here) but only if you're using lavfi.
    • &#xA;

    • The -sws_flags print_info option (here) can be used to determine if -vf scale is applied automatically and shows a subset of its parameters, but not all of them.
    • &#xA;

    &#xA;

    Additionally, this question appears related the answer doesn't answer what I'm looking for.

    &#xA;

    Are there better ways to achieve that ?

    &#xA;

  • Problems to read frame using FFMPEG to OpenCV Mat

    28 décembre 2022, par Alex

    I'm trying to read all frames from a video using FFMPEG library in C++, but I have got this exception :

    &#xA;

    Assertion desc failed at libswscale/swscale_internal.h:727&#xA;

    &#xA;

    The code that I'm using is follow :

    &#xA;

    #include <iostream>&#xA;#include <string>&#xA;#include <vector>&#xA;&#xA;extern "C" {&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>imgutils.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;}&#xA;&#xA;&#xA;#include <opencv2></opencv2>opencv.hpp>&#xA;&#xA;// helper function to check for FFmpeg errors&#xA;inline void checkError(int error, const std::string &amp;message) {&#xA;    if (error &lt; 0) {&#xA;        std::cerr &lt;&lt; message &lt;&lt; ": " &lt;&lt; av_err2str(error) &lt;&lt; std::endl;&#xA;        exit(EXIT_FAILURE);&#xA;    }&#xA;}&#xA;&#xA;int main() {&#xA;    // initialize FFmpeg&#xA;    av_log_set_level(AV_LOG_ERROR);&#xA;    avformat_network_init();&#xA;&#xA;    // open the input file&#xA;    std::string fileName = "input.mp4";&#xA;    AVFormatContext *formatContext = nullptr;&#xA;    int error = avformat_open_input(&amp;formatContext, fileName.c_str(), nullptr, nullptr);&#xA;    checkError(error, "Error opening input file");&#xA;&#xA;    // find the video stream&#xA;    AVStream *videoStream = nullptr;&#xA;    for (unsigned int i = 0; i &lt; formatContext->nb_streams; i&#x2B;&#x2B;) {&#xA;        if (formatContext->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO &amp;&amp; !videoStream) {&#xA;            videoStream = formatContext->streams[i];&#xA;        }&#xA;    }&#xA;    if (!videoStream) {&#xA;        std::cerr &lt;&lt; "Error: input file does not contain a video stream" &lt;&lt; std::endl;&#xA;        exit(EXIT_FAILURE);&#xA;    }&#xA;&#xA;    // create the video codec context&#xA;    const AVCodec *videoCodec = avcodec_find_decoder(videoStream->codecpar->codec_id);&#xA;    AVCodecContext *videoCodecContext = avcodec_alloc_context3(videoCodec);&#xA;    if (!videoCodecContext) {&#xA;        std::cerr &lt;&lt; "Error allocating video codec context" &lt;&lt; std::endl;&#xA;        exit(EXIT_FAILURE);&#xA;    }&#xA;    error = avcodec_parameters_to_context(videoCodecContext, videoStream->codecpar);&#xA;    checkError(error, "Error setting video codec context parameters");&#xA;    error = avcodec_open2(videoCodecContext, videoCodec, nullptr);&#xA;    checkError(error, "Error opening video codec");&#xA;&#xA;    // create the frame scaler&#xA;        int width = videoCodecContext->width;&#xA;    int height = videoCodecContext->height;&#xA;    struct SwsContext *frameScaler = sws_getContext(width, height, videoCodecContext->pix_fmt, width, height, AV_PIX_FMT_BGR24, SWS_BICUBIC, nullptr, nullptr, nullptr);&#xA;&#xA;    // read the packets and decode the video frames&#xA;    std::vector videoFrames;&#xA;    AVPacket packet;&#xA;    while (av_read_frame(formatContext, &amp;packet) == 0) {&#xA;        if (packet.stream_index == videoStream->index) {&#xA;            // decode the video frame&#xA;            AVFrame *frame = av_frame_alloc();&#xA;            int gotFrame = 0;&#xA;            error = avcodec_send_packet(videoCodecContext, &amp;packet);&#xA;            checkError(error, "Error sending packet to video codec");&#xA;            error = avcodec_receive_frame(videoCodecContext, frame);&#xA;            checkError(error, "Error receiving frame from video codec");&#xA;            if (error == 0) {&#xA;                gotFrame = 1;&#xA;            }&#xA;            if (gotFrame) {&#xA;                // scale the frame to the desired format&#xA;                AVFrame *scaledFrame = av_frame_alloc();&#xA;                av_image_alloc(scaledFrame->data, scaledFrame->linesize, width, height, AV_PIX_FMT_BGR24, 32);&#xA;                sws_scale(frameScaler, frame->data, frame->linesize, 0, height, scaledFrame->data, scaledFrame->linesize);&#xA;&#xA;                // copy the frame data to a cv::Mat object&#xA;                cv::Mat mat(height, width, CV_8UC3, scaledFrame->data[0], scaledFrame->linesize[0]);&#xA;                videoFrames.push_back(mat.clone());&#xA;&#xA;                // clean up&#xA;                av_freep(&amp;scaledFrame->data[0]);&#xA;                av_frame_free(&amp;scaledFrame);&#xA;            }&#xA;            av_frame_free(&amp;frame);&#xA;        }&#xA;        av_packet_unref(&amp;packet);&#xA;    }&#xA;&#xA;    // clean up&#xA;    sws_freeContext(frameScaler);&#xA;    avcodec_free_context(&amp;videoCodecContext);&#xA;    avformat_close_input(&amp;formatContext);&#xA;&#xA;    return 0;&#xA;}&#xA;</vector></string></iostream>

    &#xA;

    The line that GDB says that occur the exception is this :

    &#xA;

    struct SwsContext *frameScaler = sws_getContext(width, height, videoCodecContext->pix_fmt, width, height, AV_PIX_FMT_BGR24, SWS_BICUBIC, nullptr, nullptr, nullptr);&#xA;

    &#xA;