
Recherche avancée
Autres articles (36)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne 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 (...) -
Personnaliser les catégories
21 juin 2013, parFormulaire de création d’une catégorie
Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
On peut modifier ce formulaire dans la partie :
Administration > Configuration des masques de formulaire.
Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...) -
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)
Sur d’autres sites (5959)
-
Segmentation fault on debian 9 when decoding audio with ffmpeg and libopus
27 août 2021, par Ramil DautovI wrote the program that takes as an input some .opus file, decodes it using libavcodec and libopus and then plays it using SDL2. Program works on Windows 10 and Ubuntu 18.04, however it crashes with the segmentation fault on Debian 9.


I've tried to update libavcodec and libopus libraries, tried to compile using clang and gcc - nothing helped.


Address sanitizer shows that stack overflow happens :


ASAN:DEADLYSIGNAL
=================================================================
==12167==ERROR: AddressSanitizer: stack-overflow on address 0x2b3e74c81ff8 (pc 0x2b3e7a098803 bp 0x2b3e74c82690 sp 0x2b3e74c81eb0 T2)
 #0 0x2b3e7a098802 in quant_all_bands celt/bands.c:1403
 #1 0x2b3e7a0a2a37 in celt_decode_with_ec celt/celt_decoder.c:1083
 #2 0x2b3e7a0c8afb in opus_decode_frame src/opus_decoder.c:518
 #3 0x2b3e7a0c9e40 in opus_decode_native src/opus_decoder.c:721
 #4 0x2b3e7a0d33f3 in opus_multistream_decode_native src/opus_multistream_decoder.c:253
 #5 0x2b3e7a0d37a8 in opus_multistream_decode src/opus_multistream_decoder.c:398
 #6 0x2b3e760ad83c (/usr/lib/x86_64-linux-gnu/libavcodec.so.57+0x43583c)
 #7 0x2b3e75e4ca27 (/usr/lib/x86_64-linux-gnu/libavcodec.so.57+0x1d4a27)
 #8 0x2b3e75e4f62a in avcodec_send_packet (/usr/lib/x86_64-linux-gnu/libavcodec.so.57+0x1d762a)
 #9 0x2b3e75e4f9e6 (/usr/lib/x86_64-linux-gnu/libavcodec.so.57+0x1d79e6)
 #10 0x55ef09511882 in decode(AVCodecContext*, AVPacket*, unsigned char*, int) /home/ram/my/player3/speaker.cpp:296
 #11 0x55ef09511626 in fillBuffer(AVCodecContext*, unsigned char*, int) /home/ram/my/player3/speaker.cpp:251
 #12 0x55ef09511294 in process(AVCodecContext*, unsigned char*, int) /home/ram/my/player3/speaker.cpp:194
 #13 0x55ef095105b9 in audio_callback(void*, unsigned char*, int) /home/ram/my/player3/speaker.cpp:69
 #14 0x2b3e7815cc31 (/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0+0x1fc31)
 #15 0x2b3e781bcf8b (/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0+0x7ff8b)
 #16 0x2b3e7820c6c8 (/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0+0xcf6c8)
 #17 0x2b3e77be74a3 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x74a3)
 #18 0x2b3e7940ed0e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8d0e)

SUMMARY: AddressSanitizer: stack-overflow celt/bands.c:1403 in quant_all_bands
Thread T2 (SDLAudioDev2) created by T0 here:
 #0 0x2b3e74d0df59 in __interceptor_pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f59)
 #1 0x2b3e7820c732 (/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0+0xcf732)




I also tried to increase stack size using ulimit -s unlimited and tried to increase stack size for the thread that starts decoding, didn't work.


In main.cpp file I have this :


#include <iostream>
#include <memory>
#include <mutex>
#include "speaker.h"
#include "SDL2/SDL.h"

extern "C"{
#include <libavutil></libavutil>opt.h>
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h>
#include <libswresample></libswresample>swresample.h>
}

static int decode_audio_file(const char* path) {
 
 av_register_all();

 // get format from audio file
 AVFormatContext* format = avformat_alloc_context();
 if (avformat_open_input(&format, path, NULL, NULL) != 0) {
 std::cout << "Could not open file" << std::endl;
 return -1;
 }
 if (avformat_find_stream_info(format, NULL) < 0) {
 std::cout << "Could not retrieve stream info from file" << std::endl;
 return -1;
 }

 // Find the index of the first audio stream
 int stream_index =- 1;
 for (int i=0; i< format->nb_streams; i++) {
 if (format->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
 stream_index = i;
 break;
 }
 }
 if (stream_index == -1) {
 std::cout << "Could not retrieve audio stream from file" << std::endl;
 return -1;
 }
 AVStream* stream = format->streams[stream_index];

 // Initialize speaker
 init_Speaker("OPUS",
 48000,
 2,
 15,
 3,
 av_get_channel_layout("stereo"),
 av_get_sample_fmt("s16"));

 // prepare to read data
 AVPacket* packet;
 packet = av_packet_alloc();
 av_init_packet(packet);

 // iterate through frames
 while (av_read_frame(format, packet) >= 0) {
 play(packet->data, packet->size, std::chrono::microseconds{packet->pts},
 std::chrono::microseconds{packet->dts});
 av_packet_unref(packet);
 }

 // clean up
 avformat_free_context(format);
 close_Speaker();

 // success
 return 0;
}

int main(int argc, char const *argv[]) {
 // check parameters
 if (argc < 2) {
 std::cout << "Please provide the path to an audio file as first command-line argument.\n";
 return -1;
 }

 // Init Audio
 SDL_Init(SDL_INIT_AUDIO);

 // decode data
 if (decode_audio_file(argv[1]) != 0) {
 return -1;
 }

 std::cout << "Finish" << std::endl;
 return 0;
}

</mutex></memory></iostream>


In speaker.cpp :


#include "speaker.h"
#include "pthread.h"
#include "avcodec.h"
#include "common.h"
#include <iostream>

extern "C"
{
#include <libswresample></libswresample>swresample.h>
#include <libavutil></libavutil>hwcontext.h>
}

using std::chrono::microseconds;

SDL_AudioDeviceID m_id;

AVCodecParserContext *parser = nullptr;

//
constexpr static auto buffer_size{1024}; // 2048
constexpr static auto buffer_max_size{AVCODEC_MAX_AUDIO_FRAME_SIZE * 4};
uint32_t m_samplerate;
uint32_t m_queue_limit;
uint32_t m_queue_dropfactor;
int64_t m_channel_layout;
AVSampleFormat m_device_format;
AVCodecID audio_codec_id{AV_CODEC_ID_NONE};
AVCodecContext* adecoder;

player::PacketQueue queue(0, true); 


static uint8_t* buf = nullptr;
uint32_t absize{};
uint32_t abpos{};
int32_t max_decoder_size{};
// need a converter?
uint8_t* convbuf{};
SwrContext* swrctx{};
int32_t sframes{};
AVCodec* codec{};

uint8_t * audio_buffer_init() {
 if(buf == nullptr) {
 buf = (uint8_t*) malloc(buffer_max_size);
 if(buf == nullptr) {
 return nullptr;
 }
 }
 return buf;
}

void audio_callback(void* userdata, uint8_t* stream, int len) {
 AVCodecContext* decoder = (AVCodecContext*)userdata;
 process(decoder, stream, len);
};

void init_Speaker(const std::string& codecName,
 int32_t samplerate,
 uint8_t channels,
 uint32_t queue_limit,
 uint32_t queue_dropfactor,
 int64_t channel_layout,
 AVSampleFormat format)
{
 m_samplerate = samplerate;
 m_queue_limit = queue_limit;
 m_queue_dropfactor = queue_dropfactor;
 m_device_format = format;
 m_channel_layout = channel_layout;


 SDL_SetHint(SDL_HINT_THREAD_STACK_SIZE, "8388608");

 if(codecName.empty())
 throw std::runtime_error("audio decoder: no codec specified.");

 auto names = player::lookup_ffmpeg_decoders(codecName);
 if(names == nullptr)
 throw std::runtime_error("audio decoder: cannot find decoder names for {}"+codecName);

 audio_codec_id = player::lookup_codec_id(codecName);
 codec = player::avcodec_find_decoder(names, AV_CODEC_ID_NONE);
 if(codec == nullptr)
 throw std::runtime_error("audio decoder: cannot find the decoder for {}"+codecName);

 adecoder = avcodec_alloc_context3(codec);
 if(adecoder == nullptr)
 throw std::runtime_error("audio decoder: cannot allocate context");

 adecoder->channels = channels;
 adecoder->sample_rate = samplerate;
 if(adecoder->channels == 1)
 {
 adecoder->channel_layout = AV_CH_LAYOUT_MONO;
 }
 else if(adecoder->channels == 2)
 {
 adecoder->channel_layout = AV_CH_LAYOUT_STEREO;
 }
 else
 throw std::runtime_error("audio decoder: unsupported number of channels ({})"+ adecoder->channels);
 

 if(avcodec_open2(adecoder, codec, nullptr) != 0)
 throw std::runtime_error("audio decoder: cannot open decoder");

 parser = av_parser_init(codec->id);

 SDL_AudioSpec wanted, spec;
 wanted.freq = samplerate;
 wanted.format = AUDIO_S16SYS;
 wanted.channels = channels;
 wanted.silence = 0;
 wanted.samples = buffer_size;
 wanted.userdata = adecoder;
 wanted.callback = audio_callback;
 

 m_id = SDL_OpenAudioDevice(nullptr, 0, &wanted, &spec, 0);
 if(m_id == 0)
 throw std::runtime_error(SDL_GetError());

 SDL_PauseAudioDevice(m_id, 0);
}

void close_Speaker()
{
 SDL_CloseAudioDevice(m_id);
 
 if(adecoder != nullptr)
 player::avcodec_close(adecoder);

}

void play(uint8_t* buffer, size_t bufsize, microseconds pts, microseconds dts)
{
 if(!buffer || !bufsize) {
 return;
 }
 
 AVPacket* avpkt;
 avpkt = av_packet_alloc();
 av_init_packet(avpkt);
 uint8_t bf[bufsize + 64];
 memcpy(bf, buffer, bufsize);

 av_parser_parse2(parser, adecoder, &avpkt->data, &avpkt->size,
 bf, bufsize,
 pts.count(), dts.count(), 0);

 queue.put(av_packet_clone(avpkt));
 queue.drop(m_queue_limit, m_queue_dropfactor); 

}

//

void process(AVCodecContext* decoder, uint8_t* stream, int ssize)
{
 auto filled = fillBuffer(decoder, stream, ssize);

 auto unfilled{(ssize - filled) / 4};
 auto dummy{sframes};

 sframes = unfilled == 0 ? 0 : sframes + unfilled;
 memset(stream + filled, 0, unfilled * 4);
 
 if(sframes != dummy)
 queue.add_silence((int64_t)sframes * 1000000 / m_samplerate);
}

int fillBuffer(AVCodecContext* decoder, uint8_t* stream, int ssize)
{
 int filled{};
 AVPacket avpkt;
 audio_buffer_init();
 while(filled < ssize)
 {
 int dsize{}, delta{};

 // buffer has enough data
 if(absize - abpos >= static_cast<unsigned int="int">(ssize - filled))
 {
 delta = ssize - filled;
 std::copy(buf + abpos, buf + abpos + delta, stream);
 abpos += delta;
 filled += delta;
 return ssize;
 }
 else if(absize - abpos > 0)
 {
 delta = absize - abpos;
 std::copy(buf + abpos, buf + abpos + delta, stream);
 stream += delta;
 filled += delta;
 abpos = absize = 0;
 }
 // move data to head, leave more ab buffers
 if(abpos != 0)
 {
 std::copy(buf + abpos, buf + abpos + absize - abpos, buf);
 absize -= abpos;
 abpos = 0;
 }
 // decode more packets
 if(!queue.get(&avpkt, false))
 break;
 if((dsize = decode(decoder, &avpkt, buf + absize, buffer_max_size - absize)) < 0)
 break;
 absize += dsize;
 }

 return filled;
}

int decode(AVCodecContext* decoder, AVPacket* pkt, uint8_t* dstbuf, int dstlen)
{
 const uint8_t* srcplanes[SWR_CH_MAX];
 uint8_t* dstplanes[SWR_CH_MAX];
 int filled{};

 AVFrame* aframe = av_frame_alloc();

 auto saveptr = pkt->data;

 while(pkt->size > 0)
 {
 int len{}, got_frame{};
 unsigned char* srcbuf{};
 int datalen{};

 if((len = avcodec_decode_audio4(decoder, aframe, &got_frame, pkt)) < 0)
 {
 return -1;
 }
 if(got_frame == 0)
 {
 pkt->size -= len;
 pkt->data += len;
 continue;
 }

 if(aframe->format == m_device_format)
 {
 datalen = av_samples_get_buffer_size(nullptr,
 aframe->channels /*rtspconf->audio_channels*/,
 aframe->nb_samples,
 (AVSampleFormat)aframe->format,
 1 /*no-alignment*/);
 srcbuf = aframe->data[0];
 }
 else
 {
 // need conversion!
 if(swrctx == nullptr)
 {
 if((swrctx = swr_alloc_set_opts(nullptr,
 m_channel_layout,
 m_device_format,
 m_samplerate,
 aframe->channel_layout,
 (AVSampleFormat)aframe->format,
 aframe->sample_rate,
 0,
 nullptr)) == nullptr)
 {
 return -1;
 }
 auto err = swr_init(swrctx);
 if(err < 0)
 {
 char msg[1024];
 av_strerror(err, msg, 1024);
 return -1;
 }
 max_decoder_size = av_samples_get_buffer_size(nullptr,
 2, 
 m_samplerate,
 m_device_format,
 1 /*no-alignment*/);
 if((convbuf = (unsigned char*)::malloc(max_decoder_size)) == nullptr)
 {
 return -1;
 }
 }
 datalen = av_samples_get_buffer_size(nullptr,
 2,
 aframe->nb_samples,
 m_device_format,
 1 /*no-alignment*/);
 if(datalen > max_decoder_size)
 {
 return -1;
 }
 srcplanes[0] = aframe->data[0];
 if(av_sample_fmt_is_planar((AVSampleFormat)aframe->format) != 0)
 {
 // planar
 int i;
 for(i = 1; i < aframe->channels; i++)
 {
 srcplanes[i] = aframe->data[i];
 }
 srcplanes[i] = nullptr;
 }
 else
 {
 srcplanes[1] = nullptr;
 }
 dstplanes[0] = convbuf;
 dstplanes[1] = nullptr;

 swr_convert(swrctx, dstplanes, aframe->nb_samples, srcplanes, aframe->nb_samples);
 srcbuf = convbuf;
 }
 if(datalen > dstlen)
 {
 datalen = dstlen;
 }

 std::copy(srcbuf, srcbuf + datalen, dstbuf);
 dstbuf += datalen;
 dstlen -= datalen;
 filled += datalen;

 pkt->size -= len;
 pkt->data += len;
 av_frame_unref(aframe);
 }
 pkt->data = saveptr;
 if(pkt->data)
 av_packet_unref(pkt);
 if(aframe != nullptr)
 av_frame_free(&aframe);
 
 return filled;
}
</unsigned></iostream>


In packet_queue.cpp :


#include "packet_queue.h"

using player::PacketQueue;
using lock_guard = std::lock_guard;
using unique_lock = std::unique_lock;
using std::chrono::milliseconds;

PacketQueue::PacketQueue(uint32_t playback_queue_silence, bool playback_queue_debug) :
 m_playback_queue_debug(playback_queue_debug), m_playback_queue_silence(playback_queue_silence)
{
}

void PacketQueue::clear()
{
 lock_guard lk{m_mtx};
 for(auto& pkt : queue)
 av_packet_unref(pkt);

 m_size = 0;
 queue.clear();
}

void PacketQueue::add_silence(int64_t silence_pts)
{
 if(m_playback_queue_silence == 0)
 {
 return;
 }

 lock_guard lk{m_mtx};
 silence_pts = filtered_packets > 0 ? silence_pts : last_pts + silence_pts;

 auto tv = std::chrono::microseconds{last_pts};
 auto tv2 = std::chrono::microseconds{silence_pts};
}

bool PacketQueue::put(AVPacket* pkt)
{
 if(pkt == nullptr)
 {
 return false;
 }

 lock_guard lk{m_mtx};
 if((silence_pts - pkt->pts) > (m_playback_queue_silence * 1000))
 {
 auto tv = std::chrono::microseconds{pkt->pts};
 filtered_packets++;
 if(m_playback_queue_debug)
 return true;
 }

 queue.push_back(pkt);
 filtered_packets = 0;
 return true;
}

bool PacketQueue::get(AVPacket* pkt, bool block, milliseconds timeout)
{
 unique_lock lk{m_mtx};

 for(;;)
 {
 if(queue.size() > 0)
 {
 auto ptr = queue.front();
 queue.pop_front();
 m_size -= ptr->size;
 last_pts = ptr->pts;
 av_packet_move_ref(pkt, ptr);
 return true;
 }
 else if(!block)
 {
 return false;
 }
 else if(!m_cv.wait_for(lk, timeout, [&] { return !queue.empty(); }))
 {
 return false;
 }

 }
 return false;
}

bool PacketQueue::drop(size_t limit, size_t dropfactor)
{
 int dropped, count = 0;

 lock_guard lk{m_mtx};

 // queue size exceeded?
 if(queue.size() <= limit)
 {
 return false;
 }

 // start dropping
 dropped = queue.size() / dropfactor;
 // keep at least one
 if(dropped == queue.size())
 dropped--;

 AVPacket* pkt;
 while(dropped-- > 0 && !queue.empty())
 {
 pkt = queue.front();

 if(pkt->flags != AV_PKT_FLAG_KEY)
 {
 queue.pop_front();
 m_size -= pkt->size;
 av_packet_unref(pkt);
 ++count;
 }
 }

 return true; // count;
}

int PacketQueue::drop2(size_t limit, bool error)
{
 int count = 0;

 // dropping enabled?
 if(limit <= 0 && !error)
 return 0;

 lock_guard lk{m_mtx};
 // queue size exceeded?
 if(queue.size() <= limit && !error)
 return false;

 for(auto i = queue.begin(); i != queue.end();)
 {
 AVPacket* pkt = *i;
 if(pkt->flags != AV_PKT_FLAG_KEY)
 {
 m_size -= pkt->size;
 av_packet_unref(pkt);
 i = queue.erase(i);
 count++;
 }
 else
 ++i;
 }

 return count;
}



1403 line of celt/bands.c :
screenshot


Versions of libraries that I tried on Debian 9 :
libavcodec.so.57.64.101 and libopus.so.0.5.3


also I built manually libavcodec.so.57.107.100 and libopus.so.0.8.0 and tried to use them - the same error appears.


As I already mentioned, everything works fine on Windows 10 and Ubuntu 18.04. So I have no clue what could be the reason of the issue. Any help is appreciated.


-
Ffmpeg Showfreqs with Custom Frequency Ranges, Is It Possible ?
17 février 2023, par lonewolvianI need to display showfreqs with 32 or 64 bands, but with custom frequency ranges, just like an old equalizer indicator.


In this case, win_size is not what I want because the frequency distribution doesn't look balanced where the treble section is too wide and the bass section is to narrow.


Is it possible ? If so then how to do it ?


I've looked at showfreqs documentation but I didn't find any clue about this.


Thank you.


-
Script error logging and filtering leads to truncated inputs [duplicate]
11 septembre 2023, par Alex IxerasI have a short script to log the output of an
ffmpeg
error output. I want to suppress logging a particular error message, but log any other.

while IFS= read -r file; do
 if [[ "$file" == *.mov ]]; then
 error=$(ffmpeg -v error -i "$file" -f null - 2>&1)
 if [[ "$error" != *"Application provided invalid, non monotonically increasing dts"* ]]; then
 echo "File: $file" >> error.log
 echo "$error" >> error.log
 echo "\n" >> error.log
 fi
 fi
done < /dir/to/list_of_files.txt



On running this I get some output working well, some other however, seems to be truncated or seemingly providing truncated input. Below is some sample output.


There are two truncated inputs (
mes/bar/media/040F4F7F-7555-42C0-A8BE-F00C2240B1E9.mov
andolumes/bar/media/05DD1E0E-3AA6-4803-9FE3-95101CF69AC7.mov
) and one .heic file, which is sitting in the same folder, seemingly causing an issue (r/media/06D46531-B088-46D6-AEEA-7192845D09E0.heic
). None of the files and their paths listed in/dir/to/list_of_files.txt
is listed incomplete, meaninglist_of_files.txt
shows

- 

/Volmes/bar/media/040F4F7F-7555-42C0-A8BE-F00C2240B1E9.mov
/Volumes/bar/media/05DD1E0E-3AA6-4803-9FE3-95101CF69AC7.mov
/Volumes/bar/media/06D46531-B088-46D6-AEEA-7192845D09E0.heic








Here is the sample output :


File: /Volumes/bar/media/006BE123-DA3F-46AA-A7DB-4FB747ECE3A8.mov
[h264 @ 0x126f1acf0] cabac decode of qscale diff failed at 44 1
[h264 @ 0x126f1acf0] error while decoding MB 44 1, bytestream 74947


File: /Volumes/bar/media/026B2681-840E-4B5E-945B-3CD485C74DA4.mov
[h264 @ 0x150e46e10] cabac decode of qscale diff failed at 51 24
[h264 @ 0x150e46e10] error while decoding MB 51 24, bytestream 29149
[h264 @ 0x150e50220] cabac decode of qscale diff failed at 56 33
[h264 @ 0x150e50220] error while decoding MB 56 33, bytestream 26749
[h264 @ 0x150e3da00] cabac decode of qscale diff failed at 71 42
[h264 @ 0x150e3da00] error while decoding MB 71 42, bytestream 22012
[h264 @ 0x150e62a40] cabac decode of qscale diff failed at 64 52
[h264 @ 0x150e62a40] error while decoding MB 64 52, bytestream 15091


File: mes/bar/media/040F4F7F-7555-42C0-A8BE-F00C2240B1E9.mov
mes/bar/media/040F4F7F-7555-42C0-A8BE-F00C2240B1E9.mov: No such file or directory


File: olumes/bar/media/05DD1E0E-3AA6-4803-9FE3-95101CF69AC7.mov
olumes/bar/media/05DD1E0E-3AA6-4803-9FE3-95101CF69AC7.mov: No such file or directory


File: /Volumes/bar/media/06C7E26A-C494-498A-8B57-BBC6E6CB7848.mov
[NULL @ 0x1246059c0] Invalid NAL unit size (1206193094 > 73032).
[NULL @ 0x1246059c0] missing picture in access unit with size 73036
[h264 @ 0x124646d10] Invalid NAL unit size (1206193094 > 73032).
[h264 @ 0x124646d10] Error splitting the input into NAL units.
[h264 @ 0x12463d900] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x12463d900] error while decoding MB 0 12, bytestream 49336
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x124659530] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x124659530] error while decoding MB 0 4, bytestream 67241
[NULL @ 0x1246059c0] Invalid NAL unit size (385154995 > 70401).
[NULL @ 0x1246059c0] missing picture in access unit with size 70405
[h264 @ 0x124662940] cabac decode of qscale diff failed at 78 12
[h264 @ 0x124662940] error while decoding MB 78 12, bytestream 56219
[h264 @ 0x12466bd50] cabac decode of qscale diff failed at 86 9
[h264 @ 0x12466bd50] error while decoding MB 86 9, bytestream 61798
[h264 @ 0x124662940] Invalid NAL unit size (385154995 > 70401).
[h264 @ 0x124662940] Error splitting the input into NAL units.
[h264 @ 0x124621cd0] cabac decode of qscale diff failed at 107 5
[h264 @ 0x124621cd0] error while decoding MB 107 5, bytestream 60244
[h264 @ 0x1246188c0] top block unavailable for requested intra mode
[h264 @ 0x1246188c0] error while decoding MB 30 0, bytestream 70310
[h264 @ 0x124621cd0] cabac decode of qscale diff failed at 96 9
[h264 @ 0x124621cd0] error while decoding MB 96 9, bytestream 61611
Error while decoding stream #0:0: Invalid data found when processing input
[h264 @ 0x12463d900] cabac decode of qscale diff failed at 35 6
[h264 @ 0x12463d900] error while decoding MB 35 6, bytestream 54803
[h264 @ 0x124646d10] cabac decode of qscale diff failed at 57 10
[h264 @ 0x124646d10] error while decoding MB 57 10, bytestream 58139
[h264 @ 0x12466bd50] cabac decode of qscale diff failed at 78 4
[h264 @ 0x12466bd50] error while decoding MB 78 4, bytestream 66779
[h264 @ 0x1246188c0] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x1246188c0] error while decoding MB 0 2, bytestream 199872
[h264 @ 0x124650120] cabac decode of qscale diff failed at 111 1
[h264 @ 0x124650120] error while decoding MB 111 1, bytestream 59299
[h264 @ 0x124646d10] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x124646d10] error while decoding MB 0 15, bytestream 60124
[h264 @ 0x124659530] cabac decode of qscale diff failed at 114 5
[h264 @ 0x124659530] error while decoding MB 114 5, bytestream 56033
[h264 @ 0x124621cd0] cabac decode of qscale diff failed at 40 11
[h264 @ 0x124621cd0] error while decoding MB 40 11, bytestream 60838
[h264 @ 0x12463d900] left block unavailable for requested intra mode
[h264 @ 0x12463d900] error while decoding MB 0 8, bytestream 53862
[h264 @ 0x124646d10] cabac decode of qscale diff failed at 37 10
[h264 @ 0x124646d10] error while decoding MB 37 10, bytestream 51872
[h264 @ 0x124650120] cabac decode of qscale diff failed at 116 13
[h264 @ 0x124650120] error while decoding MB 116 13, bytestream 48950
[h264 @ 0x124659530] top block unavailable for requested intra mode -1
[h264 @ 0x124659530] error while decoding MB 61 0, bytestream 59379
[h264 @ 0x124662940] cabac decode of qscale diff failed at 101 5
[h264 @ 0x124662940] error while decoding MB 101 5, bytestream 52129
[h264 @ 0x12466bd50] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x12466bd50] error while decoding MB 0 12, bytestream 60271
[h264 @ 0x1246188c0] top block unavailable for requested intra mode
[h264 @ 0x1246188c0] error while decoding MB 95 0, bytestream 75286
[h264 @ 0x1246344f0] cabac decode of qscale diff failed at 43 11
[h264 @ 0x1246344f0] error while decoding MB 43 11, bytestream 52247
[NULL @ 0x1246059c0] Invalid NAL unit size (274069289 > 199826).
[NULL @ 0x1246059c0] missing picture in access unit with size 199830
[h264 @ 0x124662940] Invalid NAL unit size (274069289 > 199826).
[h264 @ 0x124662940] Error splitting the input into NAL units.
[h264 @ 0x124621cd0] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x124621cd0] error while decoding MB 0 2, bytestream 69812
[h264 @ 0x124650120] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x124650120] error while decoding MB 0 63, bytestream 5884

Enter command: <target>|all <time>|-1 <command>[ <argument>]

Parse error, at least 3 arguments were expected, only 1 given in string 'r/media/06D46531-B088-46D6-AEEA-7192845D09E0.heic'
Error while decoding stream #0:0: Invalid data found when processing input
[NULL @ 0x1246059c0] Invalid NAL unit size (-1948339868 > 63994).
[NULL @ 0x1246059c0] missing picture in access unit with size 63998
[h264 @ 0x12466bd50] Invalid NAL unit size (-1948339868 > 63994).
[h264 @ 0x12466bd50] Error splitting the input into NAL units.
[NULL @ 0x1246059c0] Invalid NAL unit size (-632247255 > 62292).
[NULL @ 0x1246059c0] missing picture in access unit with size 62296
[h264 @ 0x12460bc20] Invalid NAL unit size (-632247255 > 62292).
[h264 @ 0x12460bc20] Error splitting the input into NAL units.
[h264 @ 0x1246344f0] cabac decode of qscale diff failed at 46 2
[h264 @ 0x1246344f0] error while decoding MB 46 2, bytestream 63786
[h264 @ 0x12463d900] left block unavailable for requested intra mode
[h264 @ 0x12463d900] error while decoding MB 0 1, bytestream 62099
[h264 @ 0x124646d10] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x124646d10] error while decoding MB 0 4, bytestream 56879
[h264 @ 0x1246188c0] cabac decode of qscale diff failed at 38 4
[h264 @ 0x1246188c0] error while decoding MB 38 4, bytestream 57286
[h264 @ 0x124621cd0] top block unavailable for requested intra mode
[h264 @ 0x124621cd0] error while decoding MB 24 0, bytestream 75479
Error while decoding stream #0:0: Invalid data found when processing input
 Last message repeated 1 times
[aac @ 0x1246081f0] Pulse data corrupt or invalid.
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1246081f0] Reserved bit set.
[aac @ 0x1246081f0] Number of bands (48) exceeds limit (39).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1246081f0] Reserved bit set.
[aac @ 0x1246081f0] Number of bands (7) exceeds limit (4).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1246081f0] Reserved bit set.
[aac @ 0x1246081f0] Prediction is not allowed in AAC-LC.
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1246081f0] Reserved bit set.
[aac @ 0x1246081f0] Number of bands (43) exceeds limit (40).
Error while decoding stream #0:1: Invalid data found when processing input
[aac @ 0x1246081f0] Reserved bit set.
[aac @ 0x1246081f0] ms_present = 3 is reserved.
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 0x124646d10] top block unavailable for requested intra mode -1
[h264 @ 0x124646d10] error while decoding MB 83 0, bytestream 200857
[h264 @ 0x1246188c0] top block unavailable for requested intra mode -1
[h264 @ 0x1246188c0] error while decoding MB 74 0, bytestream 72661
[h264 @ 0x124621cd0] cabac decode of qscale diff failed at 63 8
[h264 @ 0x124621cd0] error while decoding MB 63 8, bytestream 62599
[h264 @ 0x1246344f0] left block unavailable for requested intra mode
[h264 @ 0x1246344f0] error while decoding MB 0 8, bytestream 64506
[h264 @ 0x12463d900] top block unavailable for requested intra mode
[h264 @ 0x12463d900] error while decoding MB 85 0, bytestream 73041
[h264 @ 0x124659530] top block unavailable for requested intra mode -1
[h264 @ 0x124659530] error while decoding MB 36 0, bytestream 64753
[h264 @ 0x124650120] left block unavailable for requested intra mode
[h264 @ 0x124650120] error while decoding MB 0 12, bytestream 63916
[h264 @ 0x12460bc20] cabac decode of qscale diff failed at 85 8
[h264 @ 0x12460bc20] error while decoding MB 85 8, bytestream 55869
[h264 @ 0x124621cd0] left block unavailable for requested intra mode
[h264 @ 0x124621cd0] error while decoding MB 0 9, bytestream 55282
[h264 @ 0x12463d900] left block unavailable for requested intra mode
[h264 @ 0x12463d900] error while decoding MB 0 12, bytestream 50989
[h264 @ 0x124650120] top block unavailable for requested intra mode
[h264 @ 0x124650120] error while decoding MB 38 0, bytestream 63979
[h264 @ 0x124659530] cabac decode of qscale diff failed at 77 1
[h264 @ 0x124659530] error while decoding MB 77 1, bytestream 60749
[h264 @ 0x124662940] left block unavailable for requested intra4x4 mode -1
[h264 @ 0x124662940] error while decoding MB 0 4, bytestream 58098
[h264 @ 0x12466bd50] top block unavailable for requested intra mode
[h264 @ 0x12466bd50] error while decoding MB 12 0, bytestream 63853
[h264 @ 0x12460bc20] left block unavailable for requested intra mode
[h264 @ 0x12460bc20] error while decoding MB 0 3, bytestream 55763
[h264 @ 0x1246188c0] cabac decode of qscale diff failed at 64 8
[h264 @ 0x1246188c0] error while decoding MB 64 8, bytestream 51798
[h264 @ 0x124646d10] left block unavailable for requested intra mode
[h264 @ 0x124646d10] error while decoding MB 0 20, bytestream 43042
[h264 @ 0x12460bc20] left block unavailable for requested intra mode
[h264 @ 0x12460bc20] error while decoding MB 0 33, bytestream 35359
</argument></command></time></target>


When I try running the commands individually line by line from the input file, they all work as expected, e.g.


- 

ffmpeg -v error -i "/Volumes/bar/media/006BE123-DA3F-46AA-A7DB-4FB747ECE3A8.mov" -f null -
ffmpeg -v error -i "/Volumes/bar/media/026B2681-840E-4B5E-945B-3CD485C74DA4.mov" -f null -
ffmpeg -v error -i "/Volumes/bar/media/040C2C65-7643-4432-9C73-3B4A74861908.mov" -f null -
ffmpeg -v error -i "/Volumes/bar/media/040F4F7F-7555-42C0-A8BE-F00C2240B1E9.mov" -f null -
ffmpeg -v error -i "/Volumes/bar/media/042561B3-A732-457D-8ED4-A81A9EB3A5A7.mov" -f null -
ffmpeg -v error -i "/Volumes/bar/media/05DD1E0E-3AA6-4803-9FE3-95101CF69AC7.mov" -f null -














I've also tried initialising the
error
variable after every output, but without any success.

I'm running this under macOS 13.5 using ffmpeg version 6.0.


Why is the log output truncated or why does this script use truncated input ? Or, where does the script fail leading to these errors ?