Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (39)

  • MediaSPIP Init et Diogène : types de publications de MediaSPIP

    11 novembre 2010, par

    À l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
    Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
    Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (7135)

  • Discord FFMPEG audio wont play from yt-dlp

    19 mars 2023, par user21236822

    My question is this : Why isn't my bot playing audio ?

    


    I want the bot to join, play audio from queue, then disconnect without downloading an mp3 file.

    


    I tried using youtube-dl, but I switched to the yt-dlp library after getting errors I couldn't fix.
I am running on Windows 10 locally. All my libraries are up to date.

    


    Here are my ydl_opts and FFMPEG_OPTS :

    


    ydl_opts = {
    'format': 'bestaudio/best',
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}

FFMPEG_OPTIONS = {
    'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5',
    'options': '-vn'
} 


    


    Here is where I believe the problem is.

    


    async def play():
    print("Play Called")
    musicPlay()
    # Get message object from initial request
    message = ytLinkQue.get()
    print(f"Message object recieved: {message}")
    voiceChannel = message.author.voice.channel
    vc = await voiceChannel.connect()
    songsPlayed = 0
    
    while not ytLinkQue.empty():
        # Get current song
        currentSong = ytLinkQue.get()[0]
        print(f"Current song: {currentSong}")

        # Get song from Youtube
        with yt_dlp.YoutubeDL(ydl_opts) as ydl:
            # song = ydl.download(currentSong)
            info = ydl.extract_info(currentSong, download=False)
            song = info['formats'][0]['url']

        # Play Song
        vc.play(discord.FFmpegPCMAudio(song, **FFMPEG_OPTIONS), after=lambda e: print('Song done'))

        # Wait until the song has finished playing
        while vc.is_playing():
            print("playing rn")
            await asyncio.sleep(1)
    
    await vc.disconnect()
    musicStop()


    


    When play() is called, here is the output in terminal with my annotations as **** text **** :

    


    >python main.py&#xA;2023-02-17 15:21:09 INFO     discord.client logging in using static token&#xA;2023-02-17 15:21:10 INFO     discord.gateway Shard ID None has connected to Gateway (Session ID: 60b9fce14faa5daa4aed9eb6db01a74d).&#xA;Max que: 50&#xA;Text Channel: 828698708123451434&#xA;Testing Bot#4591 is ready.&#xA;Passing message object&#xA;**** play() funciton is called ****&#xA;Play Called&#xA;Message object recieved: <message channel="<TextChannel" position="7" nsfw="False" news="False"> type= author=<member discriminator="&#x27;0199&#x27;" bot="False" nick="&#x27;Fragnk7?&#x27;" guild="<Guild" chunked="True">> flags=<messageflags value="0">>&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Connecting to voice...&#xA;2023-02-17 15:21:16 INFO     discord.voice_client Starting voice handshake... (connection attempt 1)&#xA;2023-02-17 15:21:17 INFO     discord.voice_client Voice handshake complete. Endpoint found seattle2004.discord.media&#xA;Current song: https://www.youtube.com/watch?v=vcAp4nmTZCA&#xA;[youtube] Extracting URL: https://www.youtube.com/watch?v=vcAp4nmTZCA &#xA;[youtube] vcAp4nmTZCA: Downloading webpage &#xA;[youtube] vcAp4nmTZCA: Downloading android player API JSON &#xA;**** Does not play any audio ****&#xA;Playing rn&#xA;Song done&#xA;2023-02-17 15:21:18 INFO     discord.player ffmpeg process 20700 successfully terminated with return code of 1.&#xA;2023-02-17 15:21:19 INFO     discord.voice_client The voice handshake is being terminated for Channel ID 400178308467392513 (Guild ID 261601676941721602)&#xA;2023-02-17 15:21:19 INFO     discord.voice_client Disconnecting from voice normally, close code 1000.&#xA;</messageflags></member></message>

    &#xA;

    On Discord's end, the bot successfully connects then disconnects after 2 second.

    &#xA;

    Note : I've only included code I think is relevant. Please let me know if I should add anything else to the post, otherwise, here is the github for the project. Code is in main.py.&#xA;https://github.com/LukeLeimbach/wallMomentMusic

    &#xA;

    Thank you in advance !

    &#xA;

    I've applied the advice from these posts but it still will not play audio :

    &#xA;

    -https://stackoverflow.com/questions/45770016/how-do-i-make-my-discord-bot-play-audio-from-youtube

    &#xA;

    -https://stackoverflow.com/questions/66070749/how-to-fix-discord-music-bot-that-stops-playing-before-the-song-is-actually-over?newreg=c70dd786cf5844e490045494223c0381

    &#xA;

    -https://stackoverflow.com/questions/57688808/playing-music-with-a-bot-from-youtube-without-downloading-the-file

    &#xA;

  • Ffmpeg error "avcodec_send_frame" return "invalid argument"

    17 octobre 2023, par Paulo Coutinho

    I have a problem in function avcodec_send_frame throwing error Error sending frame for encoding: Invalid argument (-22). I already search, check, recheck and nothing. It is near the ffmpeg examples. Can anyone help me ? Thanks.

    &#xA;

    This is my code :

    &#xA;

    static void callbackAddSubtitle(const Message &amp;m, const Response r)&#xA;{&#xA;    try&#xA;    {&#xA;        av_log_set_level(AV_LOG_DEBUG);&#xA;&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Adding subtitle...");&#xA;&#xA;        auto inputOpt = m.get("input");&#xA;        auto outputOpt = m.get("output");&#xA;&#xA;        if (!inputOpt.has_value() || !outputOpt.has_value())&#xA;        {&#xA;            r(std::string{"INVALID-PARAMS"});&#xA;            return;&#xA;        }&#xA;&#xA;        const std::string &amp;input = inputOpt.value();&#xA;        const std::string &amp;output = outputOpt.value();&#xA;&#xA;        // initialize input&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Initializing input video...");&#xA;&#xA;        AVFormatContext *inputFormatCtx = avformat_alloc_context();&#xA;        if (avformat_open_input(&amp;inputFormatCtx, input.c_str(), nullptr, nullptr) != 0)&#xA;        {&#xA;            spdlog::error("Failed to open input");&#xA;            r(std::string{"ERROR-OPEN-INPUT"});&#xA;            return;&#xA;        }&#xA;&#xA;        if (avformat_find_stream_info(inputFormatCtx, nullptr) &lt; 0)&#xA;        {&#xA;            spdlog::error("Failed to find stream information");&#xA;            avformat_close_input(&amp;inputFormatCtx);&#xA;            r(std::string{"ERROR-FIND-STREAM"});&#xA;            return;&#xA;        }&#xA;&#xA;        int videoStreamIndex = av_find_best_stream(inputFormatCtx, AVMEDIA_TYPE_VIDEO, -1, -1, nullptr, 0);&#xA;        if (videoStreamIndex &lt; 0)&#xA;        {&#xA;            spdlog::error("Could not find a video stream");&#xA;            r(std::string{"ERROR-FIND-VIDEO-STREAM"});&#xA;            return;&#xA;        }&#xA;&#xA;        AVRational timeBase = inputFormatCtx->streams[videoStreamIndex]->time_base;&#xA;&#xA;        AVCodecParameters *inputCodecPar = inputFormatCtx->streams[videoStreamIndex]->codecpar;&#xA;        const AVCodec *inputCodec = avcodec_find_decoder(inputCodecPar->codec_id);&#xA;        AVCodecContext *inputCodecCtx = avcodec_alloc_context3(inputCodec);&#xA;&#xA;        avcodec_parameters_to_context(inputCodecCtx, inputCodecPar);&#xA;        avcodec_open2(inputCodecCtx, inputCodec, nullptr);&#xA;&#xA;        // initialize input audio&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Initializing input audio...");&#xA;&#xA;        int audioStreamIndex = av_find_best_stream(inputFormatCtx, AVMEDIA_TYPE_AUDIO, -1, -1, nullptr, 0);&#xA;        if (audioStreamIndex &lt; 0)&#xA;        {&#xA;            spdlog::error("Could not find an audio stream");&#xA;            r(std::string{"ERROR-FIND-AUDIO-STREAM"});&#xA;            return;&#xA;        }&#xA;&#xA;        AVCodecParameters *inputAudioCodecPar = inputFormatCtx->streams[audioStreamIndex]->codecpar;&#xA;        const AVCodec *inputAudioCodec = avcodec_find_decoder(inputAudioCodecPar->codec_id);&#xA;        AVCodecContext *inputAudioCodecCtx = avcodec_alloc_context3(inputAudioCodec);&#xA;&#xA;        avcodec_parameters_to_context(inputAudioCodecCtx, inputAudioCodecPar);&#xA;        avcodec_open2(inputAudioCodecCtx, inputAudioCodec, nullptr);&#xA;&#xA;        // initialize output video&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Initializing output video...");&#xA;&#xA;        AVFormatContext *outputFormatCtx = nullptr;&#xA;        avformat_alloc_output_context2(&amp;outputFormatCtx, nullptr, nullptr, output.c_str());&#xA;        AVStream *outputStream = avformat_new_stream(outputFormatCtx, nullptr);&#xA;&#xA;        AVCodecContext *outputCodecCtx = avcodec_alloc_context3(inputCodec);&#xA;        avcodec_parameters_to_context(outputCodecCtx, inputCodecPar);&#xA;        int retOutVideo = avcodec_open2(outputCodecCtx, inputCodec, nullptr);&#xA;&#xA;        if (retOutVideo &lt; 0)&#xA;        {&#xA;            char err[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, retOutVideo);&#xA;            spdlog::error("Failed to initialize output video: {}", err);&#xA;            r(std::string{"ERROR-INIT-OUTPUT-VIDEO"});&#xA;            return;&#xA;        }&#xA;&#xA;        outputStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;        outputStream->codecpar->codec_id = inputCodec->id;&#xA;        avcodec_parameters_from_context(outputStream->codecpar, outputCodecCtx);&#xA;&#xA;        if (!(outputFormatCtx->oformat->flags &amp; AVFMT_NOFILE))&#xA;        {&#xA;            avio_open(&amp;outputFormatCtx->pb, output.c_str(), AVIO_FLAG_WRITE);&#xA;        }&#xA;&#xA;        const char *pixelFormatName = getPixelFormatName(outputCodecCtx->pix_fmt);&#xA;        spdlog::debug("Pixel Format: {}", pixelFormatName);&#xA;&#xA;        // initialize output audio&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Initializing output audio...");&#xA;&#xA;        AVStream *outputAudioStream = avformat_new_stream(outputFormatCtx, nullptr);&#xA;        AVCodecContext *outputAudioCodecCtx = avcodec_alloc_context3(inputAudioCodec);&#xA;        avcodec_parameters_to_context(outputAudioCodecCtx, inputAudioCodecPar);&#xA;        int retOutAudio = avcodec_open2(outputAudioCodecCtx, inputAudioCodec, nullptr);&#xA;&#xA;        if (retOutAudio &lt; 0)&#xA;        {&#xA;            char err[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, retOutAudio);&#xA;            spdlog::error("Failed to initialize output audio: {}", err);&#xA;            r(std::string{"ERROR-INIT-OUTPUT-AUDIO"});&#xA;            return;&#xA;        }&#xA;&#xA;        outputAudioStream->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;&#xA;        outputAudioStream->codecpar->codec_id = inputAudioCodec->id;&#xA;        avcodec_parameters_from_context(outputAudioStream->codecpar, outputAudioCodecCtx);&#xA;&#xA;        // initialize filters&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Initializing filters...");&#xA;&#xA;        AVFilterGraph *filterGraph = avfilter_graph_alloc();&#xA;        if (!filterGraph)&#xA;        {&#xA;            spdlog::error("Failed to allocate filter graph");&#xA;            r(std::string{"ERROR-FILTER-GRAPH"});&#xA;            return;&#xA;        }&#xA;&#xA;        AVFilterContext *bufferSinkCtx;&#xA;        AVFilterContext *bufferSrcCtx;&#xA;&#xA;        const AVFilter *bufferSink = avfilter_get_by_name("buffersink");&#xA;        const AVFilter *bufferSrc = avfilter_get_by_name("buffer");&#xA;&#xA;        // input filter&#xA;        char filterInArgs[512];&#xA;        snprintf(filterInArgs, sizeof(filterInArgs), "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", inputCodecPar->width, inputCodecPar->height, inputCodecCtx->pix_fmt, timeBase.num, timeBase.den, inputCodecCtx->sample_aspect_ratio.num, inputCodecCtx->sample_aspect_ratio.den);&#xA;&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Buffer src args: {}", filterInArgs);&#xA;&#xA;        int retFilterIn = avfilter_graph_create_filter(&amp;bufferSrcCtx, bufferSrc, "in", filterInArgs, nullptr, filterGraph);&#xA;        if (retFilterIn &lt; 0)&#xA;        {&#xA;            char err[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, retFilterIn);&#xA;            spdlog::error("Failed to create bufferSrcCtx: {}", err);&#xA;            r(std::string{"ERROR-CREATE-FILTER-SRC"});&#xA;            return;&#xA;        }&#xA;&#xA;        // output filter&#xA;        int retFilterOut = avfilter_graph_create_filter(&amp;bufferSinkCtx, bufferSink, "out", nullptr, nullptr, filterGraph);&#xA;&#xA;        if (retFilterOut &lt; 0)&#xA;        {&#xA;            char err[AV_ERROR_MAX_STRING_SIZE];&#xA;            av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, retFilterOut);&#xA;            spdlog::error("Failed to create bufferSinkCtx: {}", err);&#xA;            r(std::string{"ERROR-CREATE-FILTER-SINK"});&#xA;            return;&#xA;        }&#xA;&#xA;        enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE};&#xA;        av_opt_set_int_list(bufferSinkCtx, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN);&#xA;&#xA;        // add filters to graph and link them&#xA;        const char *filterSpec = "drawtext=text=&#x27;Legenda Adicionada Automaticamente Via FFMPEG e C&#x2B;&#x2B;&#x27;: fontcolor=yellow: bordercolor=black: fontfile=&#x27;/Users/paulo/Downloads/roboto/Roboto-Black.ttf&#x27;";&#xA;        const AVFilter *filter = avfilter_get_by_name("drawtext");&#xA;&#xA;        AVFilterInOut *outputs = avfilter_inout_alloc();&#xA;        AVFilterInOut *inputs = avfilter_inout_alloc();&#xA;&#xA;        outputs->name = av_strdup("in");&#xA;        outputs->filter_ctx = bufferSrcCtx;&#xA;        outputs->pad_idx = 0;&#xA;        outputs->next = nullptr;&#xA;        inputs->name = av_strdup("out");&#xA;        inputs->filter_ctx = bufferSinkCtx;&#xA;        inputs->pad_idx = 0;&#xA;        inputs->next = nullptr;&#xA;&#xA;        if (avfilter_graph_parse_ptr(filterGraph, filterSpec, &amp;inputs, &amp;outputs, nullptr) &lt; 0)&#xA;        {&#xA;            spdlog::error("Failed to parse filter graph");&#xA;            r(std::string{"ERROR-PARSE-FILTER"});&#xA;            return;&#xA;        }&#xA;&#xA;        if (avfilter_graph_config(filterGraph, nullptr) &lt; 0)&#xA;        {&#xA;            spdlog::error("Failed to configure filter graph");&#xA;            r(std::string{"ERROR-CONFIG-FILTER"});&#xA;            return;&#xA;        }&#xA;&#xA;        // header&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Writing header...");&#xA;&#xA;        if (avformat_write_header(outputFormatCtx, nullptr) &lt; 0)&#xA;        {&#xA;            spdlog::error("Error writing header");&#xA;            r(std::string{"ERROR-WRITE-HEADER"});&#xA;            return;&#xA;        }&#xA;&#xA;        // read frames and write to output&#xA;        AVPacket *packet = av_packet_alloc();&#xA;        AVFrame *frame = av_frame_alloc();&#xA;&#xA;        frame->format = inputCodecCtx->pix_fmt;&#xA;        frame->width = inputCodecCtx->width;&#xA;        frame->height = inputCodecCtx->height;&#xA;&#xA;        AVFrame *filt_frame = av_frame_alloc();&#xA;&#xA;        filt_frame->format = inputCodecCtx->pix_fmt;&#xA;        filt_frame->width = inputCodecCtx->width;&#xA;        filt_frame->height = inputCodecCtx->height;&#xA;&#xA;        while (av_read_frame(inputFormatCtx, packet) >= 0)&#xA;        {&#xA;            if (packet->stream_index == videoStreamIndex)&#xA;            {&#xA;                if (avcodec_send_packet(inputCodecCtx, packet) &lt; 0)&#xA;                {&#xA;                    spdlog::error("Error sending packet for decoding");&#xA;                    r(std::string{"ERROR-SEND-PACKET-DECODE"});&#xA;                    return;&#xA;                }&#xA;&#xA;                while (avcodec_receive_frame(inputCodecCtx, frame) == 0)&#xA;                {&#xA;                    // Envia o quadro decodificado para o gr&#xE1;fico de filtro&#xA;                    if (av_buffersrc_add_frame_flags(bufferSrcCtx, frame, AV_BUFFERSRC_FLAG_KEEP_REF) &lt; 0)&#xA;                    {&#xA;                        spdlog::error("Error while feeding the filtergraph");&#xA;                        r(std::string{"ERROR-FEED-FILTERGRAPH"});&#xA;                        return;&#xA;                    }&#xA;&#xA;                    // Recebe um quadro do gr&#xE1;fico de filtro&#xA;                    if (av_buffersink_get_frame(bufferSinkCtx, filt_frame) &lt; 0)&#xA;                    {&#xA;                        spdlog::error("Error while receiving the filtered frame");&#xA;                        r(std::string{"ERROR-RECEIVE-FILTERED-FRAME"});&#xA;                        return;&#xA;                    }&#xA;&#xA;                    // Envia o quadro decodificado para re-codifica&#xE7;&#xE3;o&#xA;                    int retSendFrame = avcodec_send_frame(outputCodecCtx, filt_frame);&#xA;                    if (retSendFrame &lt; 0)&#xA;                    {&#xA;                        char err[AV_ERROR_MAX_STRING_SIZE];&#xA;                        av_make_error_string(err, AV_ERROR_MAX_STRING_SIZE, retSendFrame);&#xA;                        spdlog::error("Error sending frame for encoding: {}", err);&#xA;                        r(std::string{"ERROR-SEND-FRAME-ENCODE"});&#xA;                        return;&#xA;                    }&#xA;&#xA;                    AVPacket *output_packet = av_packet_alloc();&#xA;                    output_packet->data = nullptr;&#xA;                    output_packet->size = 0;&#xA;&#xA;                    // Re-codifica filt_frame para um pacote&#xA;                    if (avcodec_receive_packet(outputCodecCtx, output_packet) == 0)&#xA;                    {&#xA;                        // Escreve o pacote no fluxo de sa&#xED;da&#xA;                        av_write_frame(outputFormatCtx, output_packet);&#xA;                        av_packet_unref(output_packet);&#xA;                    }&#xA;&#xA;                    av_frame_unref(filt_frame);&#xA;                }&#xA;&#xA;                // time&#xA;                packet->pts = av_rescale_q_rnd(packet->pts, inputFormatCtx->streams[videoStreamIndex]->time_base, outputFormatCtx->streams[videoStreamIndex]->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));&#xA;                packet->dts = av_rescale_q_rnd(packet->dts, inputFormatCtx->streams[videoStreamIndex]->time_base, outputFormatCtx->streams[videoStreamIndex]->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));&#xA;                packet->duration = av_rescale_q(packet->duration, inputFormatCtx->streams[videoStreamIndex]->time_base, outputFormatCtx->streams[videoStreamIndex]->time_base);&#xA;                packet->stream_index = videoStreamIndex;&#xA;&#xA;                // write packet to output video stream&#xA;                av_interleaved_write_frame(outputFormatCtx, packet);&#xA;            }&#xA;            else if (packet->stream_index == audioStreamIndex)&#xA;            {&#xA;                // rescale timestamps&#xA;                packet->pts = av_rescale_q_rnd(packet->pts, inputFormatCtx->streams[audioStreamIndex]->time_base, outputFormatCtx->streams[audioStreamIndex]->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));&#xA;                packet->dts = av_rescale_q_rnd(packet->dts, inputFormatCtx->streams[audioStreamIndex]->time_base, outputFormatCtx->streams[audioStreamIndex]->time_base, (AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));&#xA;                packet->duration = av_rescale_q(packet->duration, inputFormatCtx->streams[audioStreamIndex]->time_base, outputFormatCtx->streams[audioStreamIndex]->time_base);&#xA;                packet->stream_index = audioStreamIndex;&#xA;&#xA;                // write packet to output audio stream&#xA;                av_interleaved_write_frame(outputFormatCtx, packet);&#xA;            }&#xA;&#xA;            av_packet_unref(packet);&#xA;        }&#xA;&#xA;        av_packet_free(&amp;packet);&#xA;        av_frame_free(&amp;frame);&#xA;        av_frame_free(&amp;filt_frame);&#xA;&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Writing trailer...");&#xA;&#xA;        if (av_write_trailer(outputFormatCtx) &lt; 0)&#xA;        {&#xA;            spdlog::error("Error writing trailer");&#xA;            r(std::string{"ERROR-WRITE-TRAILER"});&#xA;            return;&#xA;        }&#xA;&#xA;        // cleanup&#xA;        spdlog::debug("[Mapping :: callbackAddSubtitle] Cleaning...");&#xA;&#xA;        if (!(outputFormatCtx->oformat->flags &amp; AVFMT_NOFILE))&#xA;        {&#xA;            avio_closep(&amp;outputFormatCtx->pb);&#xA;        }&#xA;&#xA;        avcodec_free_context(&amp;inputCodecCtx);&#xA;        avcodec_free_context(&amp;inputAudioCodecCtx);&#xA;        avcodec_free_context(&amp;outputCodecCtx);&#xA;        avcodec_free_context(&amp;outputAudioCodecCtx);&#xA;&#xA;        avformat_free_context(inputFormatCtx);&#xA;        avformat_free_context(outputFormatCtx);&#xA;&#xA;        r(std::string{"OK"});&#xA;    }&#xA;    catch (const std::exception &amp;e)&#xA;    {&#xA;        spdlog::error("Error: {}", e.what());&#xA;        r(std::string{"ERROR"});&#xA;    }&#xA;}&#xA;

    &#xA;

    The error is :

    &#xA;

    [2023-10-17 06:30:16.936] [debug] [Mapping :: callbackAddSubtitle] Adding subtitle...&#xA;[2023-10-17 06:30:16.936] [debug] [Mapping :: callbackAddSubtitle] Initializing input video...&#xA;[NULL @ 0x153604a60] Opening &#x27;/Users/paulo/Downloads/movie.mp4&#x27; for reading&#xA;[file @ 0x6000001fd170] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] ISO: File Type Major Brand: isom&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] Unknown dref type 0x206c7275 size 12&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] Processing st: 0, edit list 0 - media time: 0, duration: 2669670&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] Unknown dref type 0x206c7275 size 12&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] Processing st: 1, edit list 0 - media time: 1024, duration: 4272096&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] drop a frame at curr_cts: 0 @ 0&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] Before avformat_find_stream_info() pos: 113542488 bytes read:110788 seeks:1 nb_streams:2&#xA;[h264 @ 0x153604cd0] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x153604cd0] Decoding VUI&#xA;[h264 @ 0x153604cd0] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] demuxer injecting skip 1024 / discard 0&#xA;[aac @ 0x1536056f0] skip 1024 / discard 0 samples due to side data&#xA;[h264 @ 0x153604cd0] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x153604cd0] Decoding VUI&#xA;[h264 @ 0x153604cd0] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[h264 @ 0x153604cd0] nal_unit_type: 6(SEI), nal_ref_idc: 0&#xA;[h264 @ 0x153604cd0] nal_unit_type: 5(IDR), nal_ref_idc: 3&#xA;[h264 @ 0x153604cd0] Format yuv420p chosen by get_format().&#xA;[h264 @ 0x153604cd0] Reinit context to 1088x1920, pix_fmt: yuv420p&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] All info found&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x153604a60] After avformat_find_stream_info() pos: 195211 bytes read:305951 seeks:2 frames:2&#xA;[2023-10-17 06:30:18.160] [debug] [Mapping :: callbackAddSubtitle] Initializing input audio...&#xA;[h264 @ 0x143604330] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x143604330] Decoding VUI&#xA;[h264 @ 0x143604330] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[2023-10-17 06:30:18.160] [debug] [Mapping :: callbackAddSubtitle] Initializing output video...&#xA;[h264 @ 0x143611ec0] nal_unit_type: 7(SPS), nal_ref_idc: 3&#xA;[h264 @ 0x143611ec0] Decoding VUI&#xA;[h264 @ 0x143611ec0] nal_unit_type: 8(PPS), nal_ref_idc: 3&#xA;[file @ 0x6000001f4000] Setting default whitelist &#x27;file,crypto,data&#x27;&#xA;[2023-10-17 06:30:18.167] [debug] Pixel Format: YUV420P&#xA;[2023-10-17 06:30:18.167] [debug] [Mapping :: callbackAddSubtitle] Initializing output audio...&#xA;[2023-10-17 06:30:18.167] [debug] [Mapping :: callbackAddSubtitle] Initializing filters...&#xA;[2023-10-17 06:30:18.168] [debug] [Mapping :: callbackAddSubtitle] Buffer src args: video_size=1080x1920:pix_fmt=0:time_base=1/30000:pixel_aspect=1/1&#xA;detected 10 logical cores&#xA;[in @ 0x6000004ec0b0] Setting &#x27;video_size&#x27; to value &#x27;1080x1920&#x27;&#xA;[in @ 0x6000004ec0b0] Setting &#x27;pix_fmt&#x27; to value &#x27;0&#x27;&#xA;[in @ 0x6000004ec0b0] Setting &#x27;time_base&#x27; to value &#x27;1/30000&#x27;&#xA;[in @ 0x6000004ec0b0] Setting &#x27;pixel_aspect&#x27; to value &#x27;1/1&#x27;&#xA;[in @ 0x6000004ec0b0] w:1080 h:1920 pixfmt:yuv420p tb:1/30000 fr:0/1 sar:1/1&#xA;[AVFilterGraph @ 0x6000017e8000] Setting &#x27;text&#x27; to value &#x27;Legenda Adicionada Automaticamente Via FFMPEG e C&#x2B;&#x2B;&#x27;&#xA;[AVFilterGraph @ 0x6000017e8000] Setting &#x27;fontcolor&#x27; to value &#x27;yellow&#x27;&#xA;[AVFilterGraph @ 0x6000017e8000] Setting &#x27;bordercolor&#x27; to value &#x27;black&#x27;&#xA;[AVFilterGraph @ 0x6000017e8000] Setting &#x27;fontfile&#x27; to value &#x27;/Users/paulo/Downloads/roboto/Roboto-Black.ttf&#x27;&#xA;[AVFilterGraph @ 0x6000017e8000] query_formats: 3 queried, 2 merged, 0 already done, 0 delayed&#xA;[2023-10-17 06:30:18.172] [debug] [Mapping :: callbackAddSubtitle] Writing header...&#xA;[h264 @ 0x143604330] nal_unit_type: 6(SEI), nal_ref_idc: 0&#xA;[h264 @ 0x143604330] nal_unit_type: 5(IDR), nal_ref_idc: 3&#xA;[h264 @ 0x143604330] Format yuv420p chosen by get_format().&#xA;[h264 @ 0x143604330] Reinit context to 1088x1920, pix_fmt: yuv420p&#xA;[Parsed_drawtext_0 @ 0x6000004f4160] Copying data in avfilter.&#xA;[Parsed_drawtext_0 @ 0x6000004f4160] n:0 t:0.000000 text_w:424 text_h:16 x:0 y:0&#xA;[2023-10-17 06:30:18.182] [error] Error sending frame for encoding: Invalid argument&#xA;Returned Value: ERROR-SEND-FRAME-ENCODE&#xA;

    &#xA;

  • ffmpeg giving Error while decoding stream #0:1 : Invalid data found when processing input

    12 octobre 2023, par Aby

    I am trying to merge two video files into one using ffmpeg on Windows. The process has been proven to work over and over (with over 100 files merged together at some points) - but I have come across an input file that is causing the process to fail with the errors :

    &#xA;

    _[aac @ 00000142532f74c0] channel element 1.0 is not allocated&#xA;Error while decoding stream #0:1: Invalid data found when processing input&#xA;[aac @ 00000142532f74c0] channel element 1.0 is not allocated&#xA;Error while decoding stream #0:1: Invalid data found when processing input&#xA;[aac @ 00000142532f74c0] channel element 1.0 is not allocated&#xA;.&#xA;.&#xA;.&#xA;

    &#xA;

    There seems to be 3 command line steps to get here, using a concats-inputs.dat file containing :

    &#xA;

    file E:/..../snippet A.mp4&#xA;file E:/..../snippet B.mp4&#xA;

    &#xA;

    (Copies of these files can be found at https://filebin.net/77wbowvh7vbklkey/snippet_A.mp4 and https://filebin.net/77wbowvh7vbklkey/snippet_B.mp4)

    &#xA;

    Step 1 :

    &#xA;

    > ffmpeg-6.0-full_build/bin/ffmpeg -y -progress ".Default.mp4.progressinfo.dat" -vsync 0 -f concat -safe 0 -i "E:/...../concat-inputs.dat" -c:v copy -c:a copy -crf 0 -b:v 10M "E:/...../video.Default.mp4"&#xA;

    &#xA;

    with the output....

    &#xA;

    built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;&#xA;  libavutil      58.  2.100 / 58.  2.100&#xA;  libavcodec     60.  3.100 / 60.  3.100&#xA;  libavformat    60.  3.100 / 60.  3.100&#xA;  libavdevice    60.  1.100 / 60.  1.100&#xA;  libavfilter     9.  3.100 /  9.  3.100&#xA;  libswscale      7.  1.100 /  7.  1.100&#xA;  libswresample   4. 10.100 /  4. 10.100&#xA;  libpostproc    57.  1.100 / 57.  1.100&#xA;&#xA;-vsync is deprecated. Use -fps_mode&#xA;&#xA;Passing a number to -vsync is deprecated, use a string argument as described in the manual.&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 000001bf88ffe240] Auto-inserting h264_mp4toannexb bitstream filter&#xA;Input #0, concat, from &#x27;E:/...../concat-inputs.dat&#x27;:&#xA;&#xA;  Duration: N/A, start: -0.010667, bitrate: 20382 kb/s&#xA;&#xA;  Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 20043 kb/s, 50 fps, 50 tbr, 12800 tbn&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : VideoHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc60.3.100 libx264&#xA;&#xA;  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, 5.1, fltp, 339 kb/s&#xA;&#xA;    Metadata:&#xA;      handler_name    : SoundHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;&#xA;Output #0, mp4, to &#x27;E:/...../video.Default.mp4&#x27;:&#xA;&#xA;  Metadata:&#xA;    encoder         : Lavf60.3.100&#xA;&#xA;  Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 10000 kb/s, 50 fps, 50 tbr, 12800 tbn&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : VideoHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;&#xA;      encoder         : Lavc60.3.100 libx264&#xA;&#xA;  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, 5.1, fltp, 339 kb/s&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : SoundHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;&#xA;Stream mapping:&#xA;&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;  Stream #0:1 -> #0:1 (copy)&#xA;&#xA;Press [q] to stop, [?] for help&#xA;&#xA;frame=    0 fps=0.0 q=-1.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    &#xA;_[mov,mp4,m4a,3gp,3g2,mj2 @ 000001bf890653c0] Auto-inserting h264_mp4toannexb bitstream filter&#xA;&#xA;[mp4 @ 000001bf89000580] Non-monotonous DTS in output stream 0:1; previous: 180224, current: 180192; changing to 180225. This may result in incorrect timestamps in the output file.&#xA;&#xA;frame=  210 fps=0.0 q=-1.0 Lsize=   11537kB time=00:00:04.21 bitrate=22433.7kbits/s speed=41.9x&#xA;&#xA;video:11417kB audio:114kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.053312%&#xA;

    &#xA;

    Step 2

    &#xA;

    > ffmpeg-6.0-full_build/bin/ffmpeg -y -progress ".Default.mp4.progressinfo.dat" -vsync 0 -f concat -safe 0 -i "E:/...../concat-inputs.dat" -c:v copy -c:a copy -crf 0 -b:v 10M "E:/...../audio.Default.wav"&#xA;

    &#xA;

    which outputs...

    &#xA;

    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;&#xA;  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;&#xA;  libavutil      58.  2.100 / 58.  2.100&#xA;  libavcodec     60.  3.100 / 60.  3.100&#xA;  libavformat    60.  3.100 / 60.  3.100&#xA;  libavdevice    60.  1.100 / 60.  1.100&#xA;  libavfilter     9.  3.100 /  9.  3.100&#xA;  libswscale      7.  1.100 /  7.  1.100&#xA;  libswresample   4. 10.100 /  4. 10.100&#xA;  libpostproc    57.  1.100 / 57.  1.100&#xA;&#xA;-vsync is deprecated. Use -fps_mode&#xA;&#xA;Passing a number to -vsync is deprecated, use a string argument as described in the manual.&#xA;&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 00000246d314e240] Auto-inserting h264_mp4toannexb bitstream filter&#xA;&#xA;Input #0, concat, from &#x27;E:/...../concat-inputs.dat&#x27;:&#xA;&#xA;  Duration: N/A, start: -0.010667, bitrate: 20382 kb/s&#xA;&#xA;  Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 20043 kb/s, 50 fps, 50 tbr, 12800 tbn&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : VideoHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;      encoder         : Lavc60.3.100 libx264&#xA;&#xA;  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, 5.1, fltp, 339 kb/s&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : SoundHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;&#xA;[out#0/wav @ 00000246d31bd240] Codec AVOption b (set bitrate (in bits/s)) has not been used for any stream. The most likely reason is either wrong type (e.g. a video option with no video streams) or that it is a private option of some encoder which was not actually used for any stream.&#xA;&#xA;Output #0, wav, to &#x27;E:/...../audio.Default.wav&#x27;:&#xA;&#xA;  Metadata:&#xA;&#xA;    ISFT            : Lavf60.3.100&#xA;&#xA;  Stream #0:0(und): Audio: aac (LC) ([255][0][0][0] / 0x00FF), 96000 Hz, 5.1, fltp, 339 kb/s&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : SoundHandler&#xA;      vendor_id       : [0][0][0][0]&#xA;&#xA;Stream mapping:&#xA;&#xA;  Stream #0:1 -> #0:0 (copy)&#xA;&#xA;Press [q] to stop, [?] for help&#xA;&#xA;size=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    &#xA;_[mov,mp4,m4a,3gp,3g2,mj2 @ 00000246d3b009c0] Auto-inserting h264_mp4toannexb bitstream filter&#xA;&#xA;[wav @ 00000246d3150580] Non-monotonous DTS in output stream 0:0; previous: 180224, current: 180192; changing to 180224. This may result in incorrect timestamps in the output file.&#xA;&#xA;size=     114kB time=00:00:04.21 bitrate= 222.4kbits/s speed= 128x&#xA;&#xA;video:0kB audio:114kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.102561%&#xA;

    &#xA;

    Step 3

    &#xA;

    > ffmpeg-6.0-full_build/bin/ffmpeg -y -progress ".Default.mp4.progressinfo.dat" -i "E:/...../video.Default.mp4" -i "E:/...../audio.Default.wav" -crf 0 -c:v copy -c:a aac "E:/...../Default.mp4"&#xA;

    &#xA;

    ... which then gives the errors....

    &#xA;

    ffmpeg version 6.0-full_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers&#xA;&#xA;  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)&#xA;&#xA;  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint&#xA;&#xA;  libavutil      58.  2.100 / 58.  2.100&#xA;  libavcodec     60.  3.100 / 60.  3.100    &#xA;  libavformat    60.  3.100 / 60.  3.100    &#xA;  libavdevice    60.  1.100 / 60.  1.100    &#xA;  libavfilter     9.  3.100 /  9.  3.100    &#xA;  libswscale      7.  1.100 /  7.  1.100    &#xA;  libswresample   4. 10.100 /  4. 10.100    &#xA;  libpostproc    57.  1.100 / 57.  1.100&#xA;&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;E:/...../video.Default.mp4&#x27;:&#xA;&#xA;  Metadata:&#xA;&#xA;    major_brand     : isom    &#xA;    minor_version   : 512    &#xA;    compatible_brands: isomiso2avc1mp41    &#xA;    encoder         : Lavf60.3.100&#xA;&#xA;  Duration: 00:00:04.23, start: 0.000000, bitrate: 22359 kb/s&#xA;&#xA;  Stream #0:0[0x1](und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 22178 kb/s, 49.80 fps, 50 tbr, 12800 tbn (default)&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : VideoHandler    &#xA;      vendor_id       : [0][0][0][0]    &#xA;      encoder         : Lavc60.3.100 libx264&#xA;&#xA;  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, 5.1, fltp, 221 kb/s (default)&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : SoundHandler    &#xA;      vendor_id       : [0][0][0][0]&#xA;&#xA;[aac @ 000001425315e580] Multiple frames in a packet.&#xA;&#xA;Input #1, wav, from &#x27;E:/...../audio.Default.wav&#x27;:&#xA;&#xA;  Metadata:&#xA;&#xA;    encoder         : Lavf60.3.100&#xA;&#xA;  Duration: 00:00:04.22, bitrate: 221 kb/s&#xA;&#xA;  Stream #1:0: Audio: aac (LC) ([255][0][0][0] / 0x00FF), 96000 Hz, 5.1, fltp, 339 kb/s&#xA;&#xA;Stream mapping:&#xA;&#xA;  Stream #0:0 -> #0:0 (copy)    &#xA;  Stream #0:1 -> #0:1 (aac (native) -> aac (native))&#xA;&#xA;Press [q] to stop, [?] for help&#xA;&#xA;Output #0, mp4, to &#x27;E:/...../Default.mp4&#x27;:&#xA;&#xA;  Metadata:&#xA;&#xA;    major_brand     : isom    &#xA;    minor_version   : 512    &#xA;    compatible_brands: isomiso2avc1mp41&#xA;&#xA;    encoder         : Lavf60.3.100&#xA;&#xA;  Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 22178 kb/s, 49.80 fps, 50 tbr, 12800 tbn (default)&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : VideoHandler    &#xA;      vendor_id       : [0][0][0][0]    &#xA;      encoder         : Lavc60.3.100 libx264&#xA;&#xA;  Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 96000 Hz, 5.1, fltp, 341 kb/s (default)&#xA;&#xA;    Metadata:&#xA;&#xA;      handler_name    : SoundHandler    &#xA;      vendor_id       : [0][0][0][0]    &#xA;      encoder         : Lavc60.3.100 aac&#xA;&#xA;frame=    0 fps=0.0 q=-1.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    &#xA;_[aac @ 00000142532f74c0] channel element 1.0 is not allocated&#xA;&#xA;Error while decoding stream #0:1: Invalid data found when processing input    &#xA;[aac @ 00000142532f74c0] channel element 1.0 is not allocated&#xA;.&#xA;.&#xA;.&#xA;

    &#xA;

    If I was to do this to merge snippet B with snippet B then it would work - it's something about snippet A that is causing the problem.

    &#xA;

    Is there any way to get around this... what is it about snippet A that is causing a problem... and is there a way to "normalize" it so that it can be merged as part of the "set".

    &#xA;

    Note, I just upgraded to ffmpeg6 after a previous version was giving the same problems - so I will also work on the deprecated messages when I can.

    &#xA;