Recherche avancée

Médias (91)

Autres articles (21)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Ajouter notes et légendes aux images

    7 février 2011, par

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

Sur d’autres sites (4848)

  • avformat/hlsenc : Add deinit function

    15 décembre 2019, par Andreas Rheinhardt
    avformat/hlsenc : Add deinit function
    

    This fixes memleaks in instances such as :
    a) When an allocation fails at one of the two places in hls_init() where
    the error is returned immediately without goto fail first.
    b) When an error happens when writing the header.
    c) When an allocation fails at one of the three places in
    hls_write_trailer() where the error is returned immediately without goto
    fail first.
    d) When one decides not to write the trailer at all (e.g. because of
    errors when writing packets).
    Furthermore, it removes code duplication and allows to return
    immediately, without goto fail first.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

    • [DH] libavformat/hlsenc.c
  • ffmpeg wont "gracefully" terminate using q or kill -2

    24 mai 2023, par Jeff Thompson

    I am trying to run a bash command on Ubuntu to pull video from a stream and make an .mp4 with it. Here is the command I am using.

    &#xA;

    ffmpeg -rtsp_transport tcp -i &#x27;rtsp://username:password!@ipaddress/?inst=1&#x27; -c copy -f segment -segment_time 180 -reset_timestamps 1 ipaddress_day_3_2_%d.mp4

    &#xA;

    It connects and begins copying the stream fine, the issue comes with trying to stop the process. It states press [q] to stop, which does not work. I have also tried kill -2 pid and kill -15 pid. Where pid is the process id. However kill -9 pid works and ctrl+c works. The issue with killing it this way is it corrupts the .mp4 rendering it useless. This is the error I get when using ctrl+c or kill -9.

    &#xA;

    av_interleaved_write_frame(): Immediate exit requested   [segment @ 0x56337ec42980] Failure occurred when ending segment &#x27;ipaddress_day_3_2_0.mp4&#x27; Error writing trailer of ipaddress_day_3_2_0%d.mp4: Immediate exit requested

    &#xA;

    One thing to note is pressing [q] did work once, when I first started working on this but has not since.

    &#xA;

    Thank You.

    &#xA;

    I have tried kill -2 pid, kill -15 pid and [q], which I expected to "gracefully" terminate it.&#xA;kill -9 pid and ctrl+c will forcefully terminate it but corrupt the file.

    &#xA;

  • How to write a video file using FFmpeg

    15 janvier 2024, par Summit

    I am trying to write a video file using FFMPEG but i get the following errors

    &#xA;

    [libx264 @ 000002bdf90c3c00] broken ffmpeg default settings detected&#xA;[libx264 @ 000002bdf90c3c00] use an encoding preset (e.g. -vpre medium)&#xA;[libx264 @ 000002bdf90c3c00] preset usage: -vpre <speed> -vpre <profile>&#xA;[libx264 @ 000002bdf90c3c00] speed presets are listed in x264 --help&#xA;[libx264 @ 000002bdf90c3c00] profile is optional; x264 defaults to high&#xA;</profile></speed>

    &#xA;

    This is my code

    &#xA;

    #pragma warning(disable : 4996)&#xA;&#xA;extern "C" {&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>mathematics.h>&#xA;#include <libswscale></libswscale>swscale.h>&#xA;}&#xA;&#xA;int main() {&#xA;    av_register_all();&#xA;    AVFormatContext* formatContext = nullptr;&#xA;    AVOutputFormat* outputFormat = nullptr;&#xA;    AVStream* videoStream = nullptr;&#xA;&#xA;    const char* filename = "output.mp4";&#xA;&#xA;    // Open the output file&#xA;    if (avformat_alloc_output_context2(&amp;formatContext, nullptr, nullptr, filename) &lt; 0) {&#xA;        fprintf(stderr, "Error allocating output format context\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    outputFormat = formatContext->oformat;&#xA;&#xA;    // Add a video stream&#xA;    videoStream = avformat_new_stream(formatContext, nullptr);&#xA;    if (!videoStream) {&#xA;        fprintf(stderr, "Error creating video stream\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Set codec parameters, you may need to adjust these based on your needs&#xA;    AVCodecContext* codecContext = avcodec_alloc_context3(nullptr);&#xA;    codecContext->codec_id = outputFormat->video_codec;&#xA;    codecContext->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    codecContext->pix_fmt = AV_PIX_FMT_YUV420P;&#xA;    codecContext->width = 640;&#xA;    codecContext->height = 480;&#xA;    codecContext->time_base = { 1, 25 };&#xA;&#xA;    // Open the video codec&#xA;    AVCodec* videoCodec = avcodec_find_encoder(codecContext->codec_id);&#xA;    if (!videoCodec) {&#xA;        fprintf(stderr, "Error finding video codec\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    if (avcodec_open2(codecContext, videoCodec, nullptr) &lt; 0) {&#xA;        fprintf(stderr, "Error opening video codec\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    videoStream->codecpar->codec_id = codecContext->codec_id;&#xA;    videoStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    videoStream->codecpar->format = codecContext->pix_fmt;&#xA;    videoStream->codecpar->width = codecContext->width;&#xA;    videoStream->codecpar->height = codecContext->height;&#xA;&#xA;    if (avformat_write_header(formatContext, nullptr) &lt; 0) {&#xA;        fprintf(stderr, "Error writing header\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Create a frame&#xA;    AVFrame* frame = av_frame_alloc();&#xA;    frame->format = codecContext->pix_fmt;&#xA;    frame->width = codecContext->width;&#xA;    frame->height = codecContext->height;&#xA;    av_frame_get_buffer(frame, 32);&#xA;&#xA;    // Fill the frame with red color&#xA;    for (int y = 0; y &lt; codecContext->height; &#x2B;&#x2B;y) {&#xA;        for (int x = 0; x &lt; codecContext->width; &#x2B;&#x2B;x) {&#xA;            frame->data[0][y * frame->linesize[0] &#x2B; x * 3] = 255;     // Red component&#xA;            frame->data[0][y * frame->linesize[0] &#x2B; x * 3 &#x2B; 1] = 0;   // Green component&#xA;            frame->data[0][y * frame->linesize[0] &#x2B; x * 3 &#x2B; 2] = 0;   // Blue component&#xA;        }&#xA;    }&#xA;&#xA;    // Write video frames&#xA;    AVPacket packet;&#xA;    for (int i = 0; i &lt; 100; &#x2B;&#x2B;i) {&#xA;        // Send the frame for encoding&#xA;        if (avcodec_send_frame(codecContext, frame) &lt; 0) {&#xA;            fprintf(stderr, "Error sending a frame for encoding\n");&#xA;            return -1;&#xA;        }&#xA;&#xA;        // Receive the encoded packet&#xA;        while (avcodec_receive_packet(codecContext, &amp;packet) == 0) {&#xA;            // Write the packet to the output file&#xA;            if (av_write_frame(formatContext, &amp;packet) != 0) {&#xA;                fprintf(stderr, "Error writing video frame\n");&#xA;                return -1;&#xA;            }&#xA;            av_packet_unref(&amp;packet);&#xA;        }&#xA;    }&#xA;&#xA;    // Write the trailer&#xA;    if (av_write_trailer(formatContext) != 0) {&#xA;        fprintf(stderr, "Error writing trailer\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Clean up resources&#xA;    av_frame_free(&amp;frame);&#xA;    avcodec_free_context(&amp;codecContext);&#xA;    avformat_free_context(formatContext);&#xA;&#xA;    return 0;&#xA;}&#xA;

    &#xA;