Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (74)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (11278)

  • How to save video data in a vector using ffmpeg ? (C++)

    25 octobre 2022, par nokla

    I'm new to ffmpeg and I am trying to write a program for video editing.

    


    I want to import a video file and save it somehow in a vector so I could edit its frames later.
When I saved all the decoded AVFrames in a vector I saw it takes a lot of memory and that I need to find a better way to do so.

    


    The function I used for reading a video :

    


    ** the function is in a class that representing video, source type is std::vector<avframe></avframe>

    &#xA;

    void VideoSource::ReadSource(std::string path)&#xA;{&#xA;    // Open the file using libavformat&#xA;    AVFormatContext* av_format_ctx = avformat_alloc_context();&#xA;    if (!av_format_ctx) {&#xA;        printf("Couldn&#x27;t create AVFormatContext\n");&#xA;        return; &#xA;    }&#xA;    if (avformat_open_input(&amp;av_format_ctx, path.c_str(), NULL, NULL) != 0) {&#xA;        printf("Couldn&#x27;t open video file\n");&#xA;        return;&#xA;    }&#xA;&#xA;    // Find the first valid video stream inside the file&#xA;    int video_stream_index = -1;&#xA;    AVCodecParameters* av_codec_params = NULL;&#xA;    const AVCodec* av_codec = NULL;&#xA;    for (int i = 0; i &lt; av_format_ctx->nb_streams; i)&#xA;    {&#xA;        av_codec_params = av_format_ctx->streams[i]->codecpar;&#xA;        av_codec = avcodec_find_decoder(av_codec_params->codec_id);&#xA;&#xA;        if (!av_codec) {&#xA;            continue;&#xA;        }&#xA;        if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {&#xA;            video_stream_index = i;&#xA;            break;&#xA;        }&#xA;    }&#xA;&#xA;    if (video_stream_index == -1) {&#xA;        printf("Couldn&#x27;t find valid video stream inside file\n");&#xA;        return;&#xA;    }&#xA;&#xA;    // Set up a codec context for the decoder&#xA;    AVCodecContext* av_codec_ctx = avcodec_alloc_context3(av_codec);&#xA;    if (!av_codec_ctx) {&#xA;        printf("Couldn&#x27;t create AVCpdecContext\n");&#xA;        return;&#xA;    }&#xA;&#xA;    if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) &lt; 0)&#xA;    {&#xA;        printf("Couldn&#x27;t initialize AVCodecContext\n");&#xA;        return;&#xA;    }&#xA;    if (avcodec_open2(av_codec_ctx, av_codec, NULL) &lt; 0) {&#xA;        printf("Couldn&#x27;t open codec\n");&#xA;        return;&#xA;    }&#xA;&#xA;    AVFrame* av_frame = av_frame_alloc();&#xA;    if (!av_frame) {&#xA;        printf("Couldn&#x27;t allocate AVFrame\n");&#xA;        return;&#xA;    }&#xA;    AVPacket* av_packet = av_packet_alloc();&#xA;    if (!av_packet) {&#xA;        printf("Couldn&#x27;t allocate AVPacket\n");&#xA;        return;&#xA;    }&#xA;    int response;&#xA;&#xA;    while (av_read_frame(av_format_ctx, av_packet) >= 0) {&#xA;        if (av_packet->stream_index != video_stream_index) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        }&#xA;        response = avcodec_send_packet(av_codec_ctx, av_packet);&#xA;        if (response &lt; 0) {&#xA;            printf("Failed to decode packet: %s\n", av_err2str(response));&#xA;            return;&#xA;        }&#xA;        response = avcodec_receive_frame(av_codec_ctx, av_frame);&#xA;        if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {&#xA;            av_packet_unref(av_packet);&#xA;            continue;&#xA;        }&#xA;        else if (response &lt; 0) {&#xA;            printf("Failed to decode frame: %s\n", av_err2str(response));&#xA;            return;&#xA;        }&#xA;        av_packet_unref(av_packet);&#xA;&#xA;        av_packet = av_packet_alloc();&#xA;&#xA;        // response = avcodec_send_frame(av_codec_ctx, av_frame);&#xA;&#xA;        source.push_back(*new AVFrame);&#xA;        source.back() = *av_frame_clone(av_frame);&#xA;&#xA;        av_frame_unref(av_frame);&#xA;    }&#xA;    &#xA;&#xA;    avformat_close_input(&amp;av_format_ctx);&#xA;    avformat_free_context(av_format_ctx);&#xA;    av_frame_free(&amp;av_frame);&#xA;    av_packet_free(&amp;av_packet);&#xA;    avcodec_free_context(&amp;av_codec_ctx);&#xA;}&#xA;

    &#xA;

    I thought maybe I should save it as a vector of encoded AVFrames or as a vector of encoded packet that contains some frames in it.

    &#xA;

    When I tried to encode a single AVFrame, I added this line&#xA;response = avcodec_send_frame(av_codec_ctx, av_frame); before pushing the frame into the vector (You can see it marked as a comment in the code above).
    &#xA;It returned invalid argument (-22) and I am not sure why.

    &#xA;

    Questions :

    &#xA;

      &#xA;
    1. Why did I get that error (-22) ?
    2. &#xA;

    3. How to save an encoded packet with multiple AVFrame in it ?
    4. &#xA;

    5. Is there a better way of working on a video that won't take as much memory ?
    6. &#xA;

    &#xA;

  • avformat/url : check url root node when rel include double dot and trim double dot

    29 avril 2020, par Steven Liu
    avformat/url : check url root node when rel include double dot and trim double dot
    

    fix ticket : 8625
    and add testcase into url for double dot corner case

    Signed-off-by : Steven Liu <lq@chinaffmpeg.org>

    • [DH] libavformat/tests/url.c
    • [DH] libavformat/url.c
    • [DH] tests/ref/fate/url
  • Add logo or watermark to Converted video using ffmpeg and PHP

    27 mars 2022, par Medicare Advisors

    We are converting videos to MP4 using FFMPEG.

    &#xA;

    We did a lot of research, however we cannot figure out how to add the company logo as a logo or a water mark to the converted video

    &#xA;

    PHP code

    &#xA;

    &lt;?php &#xA;$uploads_dir = &#x27;original/&#x27;;&#xA;$file_name = basename($_FILES[&#x27;file&#x27;][&#x27;name&#x27;]);&#xA;$output_name = explode(&#x27;.&#x27;, $file_name)[0];&#xA;$uploaded_file = $uploads_dir . $file_name;&#xA;$convert_status = [&#x27;mp4&#x27; => 0, &#x27;webm&#x27; => 0];&#xA;&#xA;if(isset($_POST[&#x27;submit&#x27;])) {&#xA;  if(move_uploaded_file($_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;], $uploaded_file)) {&#xA;    // Make sure to get the correct path to ffmpeg&#xA;    // Run $ where ffmpeg to get the path&#xA;    $ffmpeg = &#x27;/bin/ffmpeg&#x27;;&#xA;    &#xA;    // MP4&#xA;    $video_mp4 = $output_name . &#x27;.mp4&#x27;;&#xA;    exec($ffmpeg . &#x27; -i "&#x27; . $uploaded_file . &#x27;" -vcodec h264 -acodec libfdk_aac "./converted/&#x27; . $video_mp4 . &#x27;" -y 1>convert.txt 2>&amp;1&#x27;, $output, $convert_status[&#x27;mp4&#x27;]);&#xA;&#xA;    // Debug&#xA;    // echo &#x27;<pre>&#x27; . print_r($output, 1) . &#x27; </pre>&#x27;;&#xA;&#xA;   &#xA;&#xA;    // Debug&#xA;    // echo &#x27;<pre>&#x27; . print_r($output, 1) . &#x27; </pre>&#x27;;&#xA;  }&#xA;}&#xA;?>&#xA;

    &#xA;

    The logo we want to add is on : https://propeview.com/wp-content/uploads/2021/08/logo-whiteb.png

    &#xA;