Recherche avancée

Médias (91)

Autres articles (38)

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

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (5874)

  • Bad src image ptrs converting YUV to RGB after H264 decoding with libav and c++

    31 octobre 2023, par Sebastian DELLING

    I am getting "bad src image ptrs" errors when trying to convert my frames to RGB with sws_scale after decoding frames from a H264 file and cannot figure out wht is going wrong.

    


    I checked what is causing the error and found the check_image_pointers function in swscale.c which validates that the planes and line sizes needed for the pixel format (av_pix_fmt_desc_get) are present in the given data which seems not to be the case with my data.

    


    The written pgm files look ok to me, also replaying the file works.

    


    I printed the corresponding data of my frame. The problem seems that planes 1 and 2 have lines sizes of 0. All 3 of them seem to have data. Plane 0 line size is three times image width which is also confusing to me.

    


    Here is my output :

    


    Have videoStreamIndex 0 codec id: 27
saving frame 1 C:\\tmp\\output-frame-1.pgm colorspace 2 pix_fmt 0 w: 3840 h: 2160
Required:
plane 0 : 0
plane 1 : 1
plane 2 : 2
plane 3 : 0
Present:
Frame plane 0: 1 , 11520
Frame plane 1: 1 , 0
Frame plane 2: 1 , 0
Frame plane 3: 0 , 0
Frame plane 4: 0 , 0
Frame plane 5: 0 , 0
Frame plane 6: 0 , 0
Frame plane 7: 0 , 0


    


    Here the whole code of my application, the issues occurs in method decode :

    


    #include <iostream>&#xA;#include <cstring>&#xA;#include <cstdio>&#xA;#include <cstdint>&#xA;#include <string>&#xA;#include <iostream>&#xA;#include <chrono>&#xA;&#xA;// #include <opencv2></opencv2>highgui.hpp>&#xA;// #include <opencv2></opencv2>opencv.hpp>&#xA;&#xA;extern "C"&#xA;{&#xA;&#xA;#include <libswscale></libswscale>swscale.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavfilter></libavfilter>buffersink.h>&#xA;#include <libavfilter></libavfilter>buffersrc.h>&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavutil></libavutil>pixdesc.h>&#xA;#include <libavutil></libavutil>display.h>&#xA;#include "libavutil/imgutils.h"&#xA;}&#xA;&#xA;#define INBUF_SIZE 4096&#xA;class H264Decoder&#xA;{&#xA;public:&#xA;    H264Decoder(const std::string &amp;inputFilename, const std::string &amp;outputFilenamePrefix)&#xA;    {&#xA;&#xA;        // Open input file&#xA;        if (avformat_open_input(&amp;formatContext, inputFilename.c_str(), nullptr, nullptr) != 0)&#xA;        {&#xA;            throw std::runtime_error("Could not open input file");&#xA;        }&#xA;&#xA;        if (avformat_find_stream_info(formatContext, nullptr) &lt; 0)&#xA;        {&#xA;            throw std::runtime_error("Could not find stream information");&#xA;        }&#xA;&#xA;        // Find H.264 video stream&#xA;        for (unsigned i = 0; i &lt; formatContext->nb_streams; i&#x2B;&#x2B;)&#xA;        {&#xA;            if (formatContext->streams[i]->codecpar->codec_id == AV_CODEC_ID_H264)&#xA;            {&#xA;                videoStreamIndex = i;&#xA;                std::cout &lt;&lt; "Have videoStreamIndex " &lt;&lt; videoStreamIndex &lt;&lt; " codec id: " &lt;&lt; formatContext->streams[i]->codecpar->codec_id &lt;&lt; std::endl;&#xA;                break;&#xA;            }&#xA;        }&#xA;&#xA;        if (videoStreamIndex == -1)&#xA;        {&#xA;            throw std::runtime_error("H.264 video stream not found");&#xA;        }&#xA;&#xA;        // Initialize codec and codec context&#xA;        const AVCodec *codec = avcodec_find_decoder(formatContext->streams[videoStreamIndex]->codecpar->codec_id);&#xA;        if (!codec)&#xA;        {&#xA;            throw std::runtime_error("Codec not found");&#xA;        }&#xA;&#xA;        parser = av_parser_init(codec->id);&#xA;        if (!parser)&#xA;        {&#xA;            throw std::runtime_error("parser not found");&#xA;        }&#xA;&#xA;        codecContext = avcodec_alloc_context3(codec);&#xA;        if (!codecContext)&#xA;        {&#xA;            throw std::runtime_error("Could not allocate codec context");&#xA;        }&#xA;&#xA;        if (avcodec_open2(codecContext, codec, nullptr) &lt; 0)&#xA;        {&#xA;            throw std::runtime_error("Could not open codec");&#xA;        }&#xA;&#xA;        // Initialize frame&#xA;        frame = av_frame_alloc();&#xA;        frame->format = AV_PIX_FMT_YUV420P;&#xA;        if (!frame)&#xA;        {&#xA;            throw std::runtime_error("Could not allocate frame");&#xA;        }&#xA;&#xA;        inputPacket = av_packet_alloc();&#xA;        if (!inputPacket)&#xA;        {&#xA;            throw std::runtime_error("Could not allocate packet");&#xA;        }&#xA;&#xA;        inputFilename_ = inputFilename;&#xA;        outputFilenamePrefix_ = outputFilenamePrefix;&#xA;    }&#xA;&#xA;    void decode()&#xA;    {&#xA;        char buf[1024];&#xA;        int ret;&#xA;&#xA;        ret = avcodec_send_packet(codecContext, inputPacket);&#xA;        if (ret &lt; 0)&#xA;        {&#xA;            fprintf(stderr, "Error sending a packet for decoding\n");&#xA;            exit(1);&#xA;        }&#xA;&#xA;        while (ret >= 0)&#xA;        {&#xA;            ret = avcodec_receive_frame(codecContext, frame);&#xA;            if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;                return;&#xA;            else if (ret &lt; 0)&#xA;            {&#xA;                fprintf(stderr, "Error during decoding\n");&#xA;                exit(1);&#xA;            }&#xA;&#xA;            /* the picture is allocated by the decoder. no need to&#xA;               free it */&#xA;            snprintf(buf, sizeof(buf), "%s-%" PRId64 ".pgm", outputFilenamePrefix_.c_str(), codecContext->frame_num);&#xA;&#xA;            std::cout &lt;&lt; "saving frame " &lt;&lt; codecContext->frame_num &lt;&lt; " " &lt;&lt; buf &lt;&lt; " colorspace " &lt;&lt; frame->colorspace &lt;&lt; " pix_fmt " &lt;&lt; codecContext->pix_fmt &lt;&lt; " w: " &lt;&lt; frame->width &lt;&lt; " h: " &lt;&lt; frame->height &lt;&lt; std::endl;&#xA;&#xA;            SwsContext *sws_ctx = NULL;&#xA;&#xA;            sws_ctx = sws_getContext(codecContext->width,&#xA;                                     codecContext->height,&#xA;                                     codecContext->pix_fmt,&#xA;                                     codecContext->width,&#xA;                                     codecContext->height,&#xA;                                     AV_PIX_FMT_RGB24,&#xA;                                     SWS_BICUBIC,&#xA;                                     NULL,&#xA;                                     NULL,&#xA;                                     NULL);&#xA;&#xA;            AVFrame *frame2 = av_frame_alloc();&#xA;            int num_bytes = av_image_get_buffer_size(AV_PIX_FMT_RGB24, codecContext->width, codecContext->height, 32);&#xA;            uint8_t *frame2_buffer = (uint8_t *)av_malloc(num_bytes * sizeof(uint8_t));&#xA;            av_image_fill_arrays(frame2->data, frame->linesize, frame2_buffer, AV_PIX_FMT_RGB24, codecContext->width, codecContext->height, 32);&#xA;&#xA;            const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(codecContext->pix_fmt);&#xA;            std::cout &lt;&lt; "Required:" &lt;&lt; std::endl;&#xA;            for (int i = 0; i &lt; 4; i&#x2B;&#x2B;)&#xA;            {&#xA;                int plane = desc->comp[i].plane;&#xA;                std::cout &lt;&lt; "plane " &lt;&lt; i &lt;&lt; " : " &lt;&lt; plane &lt;&lt; std::endl;&#xA;            }&#xA;            std::cout &lt;&lt; "Present:" &lt;&lt; std::endl;&#xA;            for (int i = 0; i &lt; AV_NUM_DATA_POINTERS; &#x2B;&#x2B;i)&#xA;            {&#xA;                std::cout &lt;&lt; "Frame plane " &lt;&lt; i &lt;&lt; ": " &lt;&lt; static_cast<bool>(frame->data[i]) &lt;&lt; " , " &lt;&lt; frame->linesize[i] &lt;&lt; std::endl;&#xA;            }&#xA;&#xA;            sws_scale(sws_ctx, frame->data,&#xA;                      frame->linesize, 0, codecContext->height,&#xA;                      frame2->data, frame2->linesize);&#xA;&#xA;            // cv::Mat img(frame2->height, frame2->width, CV_8UC3, frame2->data[0]);&#xA;            // cv::imshow("Image", img);&#xA;&#xA;            pgm_save(frame->data[0], frame->linesize[0],&#xA;                     frame->width, frame->height, buf);&#xA;        }&#xA;    }&#xA;&#xA;    ~H264Decoder()&#xA;    {&#xA;        avformat_close_input(&amp;formatContext);&#xA;        avformat_free_context(formatContext);&#xA;        avcodec_free_context(&amp;codecContext);&#xA;        av_frame_free(&amp;frame);&#xA;        av_packet_free(&amp;inputPacket);&#xA;    }&#xA;&#xA;    void readAndDecode()&#xA;    {&#xA;        FILE *f;&#xA;        uint8_t inbuf[INBUF_SIZE &#x2B; AV_INPUT_BUFFER_PADDING_SIZE];&#xA;        uint8_t *data;&#xA;        size_t data_size;&#xA;        int ret;&#xA;        int eof;&#xA;        f = fopen(inputFilename_.c_str(), "rb");&#xA;        auto start = std::chrono::high_resolution_clock::now();&#xA;        do&#xA;        {&#xA;            /* read raw data from the input file */&#xA;            data_size = fread(inbuf, 1, INBUF_SIZE, f);&#xA;            if (ferror(f))&#xA;                break;&#xA;            eof = !data_size;&#xA;&#xA;            /* use the parser to split the data into frames */&#xA;            data = inbuf;&#xA;            while (data_size > 0 || eof)&#xA;            {&#xA;                ret = av_parser_parse2(parser, codecContext, &amp;inputPacket->data, &amp;inputPacket->size,&#xA;                                       data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0);&#xA;                if (ret &lt; 0)&#xA;                {&#xA;                    fprintf(stderr, "Error while parsing\n");&#xA;                    exit(1);&#xA;                }&#xA;                data &#x2B;= ret;&#xA;                data_size -= ret;&#xA;&#xA;                if (inputPacket->size)&#xA;                {&#xA;                    decode();&#xA;                }&#xA;                else if (eof)&#xA;                {&#xA;                    break;&#xA;                }&#xA;            }&#xA;        } while (!eof);&#xA;        auto diff = std::chrono::high_resolution_clock::now() - start;&#xA;        std::cout &lt;&lt; "Decoded " &lt;&lt; codecContext->frame_num &lt;&lt; " frames in " &lt;&lt; std::chrono::duration_cast(diff).count() &lt;&lt; " ms" &lt;&lt; std::endl;&#xA;    }&#xA;&#xA;private:&#xA;    AVFormatContext *formatContext = nullptr;&#xA;    AVCodecContext *codecContext = nullptr;&#xA;    AVCodecParserContext *parser;&#xA;    AVFrame *frame = nullptr;&#xA;    AVFrame *frameRgb = nullptr;&#xA;    AVPacket *inputPacket = nullptr;&#xA;    int videoStreamIndex = -1;&#xA;    std::string inputFilename_;&#xA;    std::string outputFilenamePrefix_;&#xA;&#xA;    static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, const char *filename)&#xA;    {&#xA;        FILE *f = fopen(filename, "wb");&#xA;        if (!f)&#xA;        {&#xA;            std::cout &lt;&lt; "Error opening file for saving PGM" &lt;&lt; std::endl;&#xA;            exit(1);&#xA;        }&#xA;&#xA;        fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255);&#xA;        for (int i = 0; i &lt; ysize; i&#x2B;&#x2B;)&#xA;            fwrite(buf &#x2B; i * wrap, 1, xsize, f);&#xA;&#xA;        fclose(f);&#xA;    }&#xA;};&#xA;&#xA;int main(int argc, char *argv[])&#xA;{&#xA;    if (argc &lt; 2)&#xA;    {&#xA;        std::cout &lt;&lt; "Please provide input file name as parameter" &lt;&lt; std::endl;&#xA;    }&#xA;&#xA;    std::string inputFilename = argv[1];&#xA;    std::string outputFilenamePrefix = "C:\\tmp\\output-frame";&#xA;&#xA;    try&#xA;    {&#xA;&#xA;        H264Decoder decoder(inputFilename, outputFilenamePrefix);&#xA;        decoder.readAndDecode();&#xA;    }&#xA;    catch (const std::exception &amp;e)&#xA;    {&#xA;        std::cout &lt;&lt; "Error: " &lt;&lt; e.what() &lt;&lt; std::endl;&#xA;        return 1;&#xA;    }&#xA;&#xA;    return 0;&#xA;}&#xA;</bool></chrono></iostream></string></cstdint></cstdio></cstring></iostream>

    &#xA;

  • Merge file without data loss using FFmpeg inside of WASM

    9 septembre 2023, par Deji

    Edit : I'm rewriting this entire question

    &#xA;

    Goal : To reconstruct a video from its pieces/chunks from a network stream inside of an @ffmpeg/ffmpeg worker

    &#xA;

    Problems :

    &#xA;

      &#xA;
    1. Video chunks/pieces which come after the first piece/chunk are reported by @ffmpeg/ffmpeg to have invalid data, as seen in the log below :
    2. &#xA;

    &#xA;

    {&#xA;  "type": "stderr",&#xA;  "message": "video-0_chunk-1.part: Invalid data found when processing input"&#xA;}&#xA;

    &#xA;

      &#xA;
    1. How would I merge these chunks/pieces to reconstruct the full video using @ffmpeg/ffmpeg (after solving the first issue above)
    2. &#xA;

    &#xA;

    My current code situation :

    &#xA;

      &#xA;
    1. For merging the video pieces
    2. &#xA;

    &#xA;

    const constructFile = async (chunks: Uint8Array[], queueId: number) => {&#xA;  await Promise.all(&#xA;    chunks.map(async (chunk, index) => {&#xA;      const chunkFile = `video-${queueId}_chunk-${index}`;&#xA;      await ffmpeg.writeFile(chunkFile, chunk);&#xA;&#xA;      // Return information about newly created file&#xA;      ffmpeg.exec(["-i", chunkFile]);&#xA;    })&#xA;  );&#xA;};&#xA;

    &#xA;

    I'm reading the logs/output for

    &#xA;

    ffmpeg.exec([&#x27;-i&#x27;, chunkFile])&#xA;

    &#xA;

    using

    &#xA;

    ffmpeg.on(&#x27;log&#x27;, (log) => console.log(log))&#xA;

    &#xA;

      &#xA;
    1. For fetching the videos using streams
    2. &#xA;

    &#xA;

    await useFetch(Capacitor.convertFileSrc(file.path), {&#xA;  responseType: "stream",&#xA;&#xA;  onResponse: async ({ response }) => {&#xA;    if (response.body) {&#xA;      const reader = response.body.getReader();&#xA;&#xA;      while (true) {&#xA;        const { done, value } = await reader.read();&#xA;&#xA;        if (done) break;&#xA;        file.chunks.push(value);&#xA;      }&#xA;      reader.releaseLock();&#xA;    }&#xA;  },&#xA;});&#xA;

    &#xA;

    Note : file.chunks is linked to a reactive value which is passed to constructFile() when initialized

    &#xA;

    These are the logs I get from the code currently above :

    &#xA;

    chunk-4OF65L5M.js:2710 <suspense> is an experimental feature and its API will likely change.&#xA;(index):298 native App.addListener (#25407936)&#xA;(index):298 native FilePicker.pickVideos (#25407937)&#xA;(index):272 result FilePicker.pickVideos (#25407937)&#xA;(index):298 native VideoEditor.thumbnail (#25407938)&#xA;(index):272 result VideoEditor.thumbnail (#25407938)&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  built with emcc (Emscripten gcc/clang-like repla…3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  configuration: --target-os=none --arch=x86_32 --…e-libfreetype --enable-libfribidi --enable-libass&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavutil      57. 28.100 / 57. 28.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavcodec     59. 37.100 / 59. 37.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavformat    59. 27.100 / 59. 27.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavdevice    59.  7.100 / 59.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavfilter     8. 44.100 /  8. 44.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswscale      6.  7.100 /  6.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswresample   4.  7.100 /  4.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libpostproc    56.  6.100 / 56.  6.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: "Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;video-0_chunk-0&#x27;:"}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  Metadata:&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;    major_brand     : mp42&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;    minor_version   : 0&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;    compatible_brands: isommp42&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;    creation_time   : 2022-11-29T14:46:32.000000Z&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  Duration: 00:00:51.50, start: 0.000000, bitrate: 81 kb/s&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  Stream #0:0[0x1](und): Video: h264 (High) (avc1 …6], 259 kb/s, 30 fps, 30 tbr, 15360 tbn (default)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;    Metadata:&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;      creation_time   : 2022-11-29T14:46:32.000000Z&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;      handler_name    : ISO Media file produced by Google Inc. Created on: 11/29/2022.&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;      vendor_id       : [0][0][0][0]&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0…706D), 44100 Hz, stereo, fltp, 127 kb/s (default)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;    Metadata:&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;      creation_time   : 2022-11-29T14:46:32.000000Z&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;      handler_name    : ISO Media file produced by Google Inc. Created on: 11/29/2022.&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;      vendor_id       : [0][0][0][0]&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;At least one output file must be specified&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;Aborted()&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  built with emcc (Emscripten gcc/clang-like repla…3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  configuration: --target-os=none --arch=x86_32 --…e-libfreetype --enable-libfribidi --enable-libass&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavutil      57. 28.100 / 57. 28.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavcodec     59. 37.100 / 59. 37.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavformat    59. 27.100 / 59. 27.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavdevice    59.  7.100 / 59.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavfilter     8. 44.100 /  8. 44.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswscale      6.  7.100 /  6.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswresample   4.  7.100 /  4.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libpostproc    56.  6.100 / 56.  6.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;video-0_chunk-1: Invalid data found when processing input&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;Aborted()&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  built with emcc (Emscripten gcc/clang-like repla…3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  configuration: --target-os=none --arch=x86_32 --…e-libfreetype --enable-libfribidi --enable-libass&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavutil      57. 28.100 / 57. 28.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavcodec     59. 37.100 / 59. 37.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavformat    59. 27.100 / 59. 27.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavdevice    59.  7.100 / 59.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavfilter     8. 44.100 /  8. 44.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswscale      6.  7.100 /  6.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswresample   4.  7.100 /  4.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libpostproc    56.  6.100 / 56.  6.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;video-0_chunk-2: Invalid data found when processing input&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;Aborted()&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  built with emcc (Emscripten gcc/clang-like repla…3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  configuration: --target-os=none --arch=x86_32 --…e-libfreetype --enable-libfribidi --enable-libass&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavutil      57. 28.100 / 57. 28.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavcodec     59. 37.100 / 59. 37.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavformat    59. 27.100 / 59. 27.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavdevice    59.  7.100 / 59.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavfilter     8. 44.100 /  8. 44.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswscale      6.  7.100 /  6.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswresample   4.  7.100 /  4.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libpostproc    56.  6.100 / 56.  6.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;video-0_chunk-3: Invalid data found when processing input&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;Aborted()&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;ffmpeg version 5.1.3 Copyright (c) 2000-2022 the FFmpeg developers&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  built with emcc (Emscripten gcc/clang-like repla…3.1.40 (5c27e79dd0a9c4e27ef2326841698cdd4f6b5784)&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  configuration: --target-os=none --arch=x86_32 --…e-libfreetype --enable-libfribidi --enable-libass&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavutil      57. 28.100 / 57. 28.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavcodec     59. 37.100 / 59. 37.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavformat    59. 27.100 / 59. 27.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavdevice    59.  7.100 / 59.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libavfilter     8. 44.100 /  8. 44.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswscale      6.  7.100 /  6.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libswresample   4.  7.100 /  4.  7.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;  libpostproc    56.  6.100 / 56.  6.100&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;video-0_chunk-4: Invalid data found when processing input&#x27;}&#xA;Processing.vue:135 {type: &#x27;stderr&#x27;, message: &#x27;Aborted()&#x27;}&#xA;</suspense>

    &#xA;

    Notes :

    &#xA;

      &#xA;
    1. The sections which start with Processing.vue come from the logging system I've setup.
    2. &#xA;

    3. The pieces/chunks gotten from the network where stored in exactly the same order in which they came
    4. &#xA;

    5. If you've seen the old question, the ReferenceError happens as a result of HMR by Vite&#xA;
        &#xA;
      1. Similar to this, some logs were repeated twice because I was actively changing some things and the component had to rerun from the start
      2. &#xA;

      &#xA;

    6. &#xA;

    &#xA;

    Summary : If my problem is still not clear, you could provide another way of fetching a large file (video) from a network, loading the file into memory and passing the file data to @ffmpeg/ffmpeg for further processing

    &#xA;

  • ffmpeg - allow to create empty aac file

    27 juillet 2023, par user11149927

    I have two commands :

    &#xA;

    ffmpeg -y -i file.mp4 -vn -acodec copy file.aac&#xA;

    &#xA;

    and then :

    &#xA;

    ffmpeg -y -i file.mp4 -i file.aac -c:v copy -c:a aac new-file.mp4&#xA;

    &#xA;

    The first command throw error when the video has no audio :

    &#xA;

    Output file does not contain any stream&#xA;

    &#xA;

    I would like to change first command to allow create empty aac file (maybe silent audio) when video has no audio. Or maybe exists better solution ?

    &#xA;