Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (78)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (14703)

  • Process terminates by signal calling ffmpeg part in Android NDK project

    6 juillet 2023, par Álvaro

    According to this blog post I've build my Android ffmpeg project. I've written the native code from my Java code with the static library and the jni functions.
When I run this part of code I obtain the next logcat, any idea of why my process terminates by signal ?

    


    03-14 11:16:06.488: I/DEBUG(31): *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-14 11:16:06.488: I/DEBUG(31): Build fingerprint: generic/google_sdk/generic:2.3.4/GINGERBREAD/123630:eng/test-keys'
03-14 11:16:06.488: I/DEBUG(31): pid: 377, tid: 377  >>> com.testffmpeg <<<
03-14 11:16:06.488: I/DEBUG(31): signal 4 (SIGILL), code 1 (ILL_ILLOPC), fault addr 80a98f10
03-14 11:16:06.488: I/DEBUG(31):  r0 002b0030  r1 80b1c410  r2 00030d40  r3 00000000
03-14 11:16:06.488: I/DEBUG(31):  r4 00000000  r5 002b0030  r6 00000010  r7 00000010
03-14 11:16:06.488: I/DEBUG(31):  r8 be877308  r9 7fffffff  10 80b1bea0  fp 00000000
03-14 11:16:06.488: I/DEBUG(31):  ip be8772f0  sp be8772d0  lr 80a99d64  pc 80a98f10  cpsr 60000010
03-14 11:16:06.568: I/DEBUG(31):          #00  pc 00298f10  /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.568: I/DEBUG(31):          #01  lr 80a99d64  /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.568: I/DEBUG(31): code around pc:
03-14 11:16:06.568: I/DEBUG(31): 80a98ef0 eaffff9e 0009304c fffeffe4 e92d4010 
03-14 11:16:06.568: I/DEBUG(31): 80a98f00 e24dd020 e28dc020 e3a04000 e1cd20f8 
03-14 11:16:06.568: I/DEBUG(31): 80a98f10 e3003000 e52c4004 e3a02000 e3433ff0 
03-14 11:16:06.568: I/DEBUG(31): 80a98f20 e58dc010 e3a0c001 e58dc000 ebffff77 
03-14 11:16:06.568: I/DEBUG(31): 80a98f30 e1500004 b1a00004 a59d001c e28dd020 
03-14 11:16:06.568: I/DEBUG(31): code around lr:
03-14 11:16:06.568: I/DEBUG(31): 80a99d44 ed947b04 e1a00005 e5941000 eefd7bc7 
03-14 11:16:06.568: I/DEBUG(31): 80a99d54 ee17ca90 e1a0200c e1a03fc2 ebfffc65 
03-14 11:16:06.568: I/DEBUG(31): 80a99d64 eaffffb8 e1c421d0 e1a00008 e58d9000 
03-14 11:16:06.568: I/DEBUG(31): 80a99d74 eb0008cc e1a00005 e5941000 e898000c 
03-14 11:16:06.568: I/DEBUG(31): 80a99d84 ebfffc6e eaffffaf e1a00005 e3a01030 
03-14 11:16:06.568: I/DEBUG(31): stack:
03-14 11:16:06.568: I/DEBUG(31):     be877290  001f9a98  [heap]
03-14 11:16:06.568: I/DEBUG(31):     be877294  0008ced8  [heap]
03-14 11:16:06.568: I/DEBUG(31):     be877298  00000005  
03-14 11:16:06.578: I/DEBUG(31):     be87729c  a8114ca9  /system/lib/libutils.so
03-14 11:16:06.578: I/DEBUG(31):     be8772a0  001f9a48  [heap]
03-14 11:16:06.578: I/DEBUG(31):     be8772a4  be8772cc  
03-14 11:16:06.578: I/DEBUG(31):     be8772a8  fffffffc  
03-14 11:16:06.578: I/DEBUG(31):     be8772ac  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be8772b0  be8772cc  
03-14 11:16:06.578: I/DEBUG(31):     be8772b4  a821a33d  /system/lib/libbinder.so
03-14 11:16:06.578: I/DEBUG(31):     be8772b8  00271270  [heap]
03-14 11:16:06.578: I/DEBUG(31):     be8772bc  a821a9d5  /system/lib/libbinder.so
03-14 11:16:06.578: I/DEBUG(31):     be8772c0  00000030  
03-14 11:16:06.578: I/DEBUG(31):     be8772c4  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be8772c8  df002777  
03-14 11:16:06.578: I/DEBUG(31):     be8772cc  e3a070ad  
03-14 11:16:06.578: I/DEBUG(31): #00 be8772d0  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be8772d4  afd10f08  /system/lib/libc.so
03-14 11:16:06.578: I/DEBUG(31):     be8772d8  00030d40  [heap]
03-14 11:16:06.578: I/DEBUG(31):     be8772dc  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be8772e0  000000da  
03-14 11:16:06.578: I/DEBUG(31):     be8772e4  00000008  
03-14 11:16:06.578: I/DEBUG(31):     be8772e8  000001b4  
03-14 11:16:06.578: I/DEBUG(31):     be8772ec  c0000000  
03-14 11:16:06.578: I/DEBUG(31):     be8772f0  80b24938  /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.578: I/DEBUG(31):     be8772f4  80a99d64  /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.578: I/DEBUG(31):     be8772f8  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be8772fc  afd1386d  /system/lib/libc.so
03-14 11:16:06.578: I/DEBUG(31):     be877300  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be877304  80b1be7c  /data/data/com.testffmpeg/lib/libffmpeg.so
03-14 11:16:06.578: I/DEBUG(31):     be877308  002b0028  [heap]
03-14 11:16:06.578: I/DEBUG(31):     be87730c  00000000  
03-14 11:16:06.578: I/DEBUG(31):     be877310  00000003  
03-14 11:16:06.578: I/DEBUG(31):     be877314  00000000  
03-14 11:16:07.118: D/Zygote(33): Process 377 terminated by signal (4)


    


  • libavformat : calling avformat_open_input 2 times results in decoding white frames

    25 avril 2017, par explodus
    • pre build ffmpeg libs format/util/scale
    • version 57.56.101
    • don’t use any deprecated function
    • use the actual style
      • av_read_frame -> avcodec_send_packet -> avcodec_receive_frame -> sws_scale

    Everything is fine on the first run, but when i wanna load/open another file i only get white frames.

    void video::app::flush_cached_frames() {
       if (nullptr == avcontext)
           return;
       if (nullptr == avpicture)
           return;

       // send an empty packet which instructs the codec to start flushing
       AVPacket pkt;
       av_init_packet(&pkt);
       pkt.data = NULL;
       pkt.size = 0;
       avcodec_send_packet(avcontext, &pkt);

       // drain the codec
       while (true) {
           int r = avcodec_receive_frame(avcontext, avpicture);
           if (r != 0)
               break;
       }
    }

    void video::app::close_avi() {
       flush_cached_frames();

       if (avformat && avstream)
           seek_to_frame(0);
       avstream = nullptr;

       if (avfile)
           fclose(avfile);
       avfile = nullptr;

       if (avcontext)
           avcodec_close(avcontext);
       avcontext = nullptr;

       if (avformat)
           avformat_free_context(avformat);
       avformat = nullptr;

       if (sws_ctx)
           sws_freeContext(sws_ctx);
       sws_ctx = nullptr;

       if (avparser)
           av_parser_close(avparser);
       avparser = nullptr;

       if (avinbuf)
           av_free(avinbuf);
       avinbuf = nullptr;
    }

    I think i close anything perfectly. Has anyone an idea ?

    edit1 : init/load

    unsigned video::app::load(const std::string& name) {
       _file = name_;

       close_avi();

       av_register_all();
       avcodec_register_all();

       av_init_packet(&avpkt);

       AVCodecID codec_id = AV_CODEC_ID_H264;
       int64_t duration = 0;
       double fps = .0;
       int ret = 0;
       {
           av_log_set_level(1);

           avfile = fopen(name_.c_str(), "rb");

           avformat = avformat_alloc_context();
           ret = avformat_open_input(&avformat, name_.c_str(), nullptr, nullptr);
           ret = avformat_find_stream_info(avformat, nullptr);
           duration = avformat->duration;

           avstream = nullptr;
           if (avformat->nb_streams == 1) {
               avstream = avformat->streams[0];
           } else {
               avstream = avformat->streams[av_find_default_stream_index(avformat)];
           }

           if (avstream) {
               fps = (double(avstream->avg_frame_rate.num) / double(avstream->avg_frame_rate.den));
               codec_id = avstream->codecpar->codec_id;
               duration = avstream->duration;

               _vid.v_width = avstream->codecpar->width;
               _vid.v_height = avstream->codecpar->height;

               _vid.lastframe = duration / fps;
               _vid.lastframe = avstream->nb_frames;
           }

           avcodec = avcodec_find_decoder(avstream->codecpar->codec_id);
           avparser = av_parser_init(avcodec->id);
           avcontext = avcodec_alloc_context3(avcodec);

           avcontext->flags |= AVFMT_FLAG_NONBLOCK;
           avcontext->flags |= AVFMT_FLAG_FLUSH_PACKETS;
           avcontext->flags |= AVFMT_FLAG_DISCARD_CORRUPT;
           avcontext->flags |= AVFMT_FLAG_NOBUFFER;

           ret = avcodec_parameters_to_context(avcontext, avstream->codecpar);
           ret = avcodec_open2(avcontext, avcodec, nullptr);


           // Determine required buffer size and allocate buffer
           auto numBytes = av_image_get_buffer_size(
                 AV_PIX_FMT_BGRA
               , avcontext->width
               , avcontext->height
               , 1);
           if (avinbuf)
               av_free(avinbuf);
           avinbuf = nullptr;
           avinbuf = (uint8_t *)av_malloc(numBytes * sizeof(uint8_t));
           ret = av_image_fill_arrays(
                 avrgb->data
               , avrgb->linesize
               , avinbuf
               , AV_PIX_FMT_BGRA
               , avcontext->width
               , avcontext->height
               , 1);

           sws_ctx = sws_getContext(
                   avcontext->width
               , avcontext->height
               , avcontext->pix_fmt
               , avcontext->width
               , avcontext->height
               , AV_PIX_FMT_BGRA
               , SWS_BILINEAR
               , nullptr
               , nullptr
               , nullptr
           );
       }

       int err = (sws_ctx && avcontext && avformat) ? 0 : 1;
       // ...
    }

    getting the frame :

    uint8_t * video::app::get_frame(uint32_t frame) {
       if (!avcontext)
           return nullptr;
       if (!avformat)
           return nullptr;
       if (!avpicture)
           return nullptr;
       if (!avfile)
           return nullptr;

       try {
           int ret = 0;

           if (avpicture->data)
               av_frame_unref(avpicture);

           while (true) {
               if ((ret = av_read_frame(avformat, &avpkt)) < 0)
                   break;

               if (avpkt.stream_index == avstream->index) {
                   ret = avcodec_send_packet(avcontext, &avpkt);
                   if (ret < 0)
                       break;

                   while (ret >= 0) {
                       ret = avcodec_receive_frame(avcontext, avpicture);
                       if (ret == AVERROR_EOF) {
                           return nullptr;
                       } else if (ret == -11) {
                           avpkt.data = nullptr;
                           avpkt.size = 0;
                           break;
                       } else if (ret < 0) {
                           return nullptr;
                       }

                       if (ret == AVERROR(EAGAIN)) {
                           avpkt.data = nullptr;
                           avpkt.size = 0;
                           break;
                       }

                       if (ret >= 0) {
                           int linesize[AV_NUM_DATA_POINTERS] = {
                                 avpicture->linesize[0]
                               , avpicture->linesize[1]
                               , avpicture->linesize[2]
                               , avpicture->linesize[3]
                               , avpicture->linesize[4]
                               , avpicture->linesize[5]
                               , avpicture->linesize[6]
                               , avpicture->linesize[7]
                           };
                           uint8_t * data[AV_NUM_DATA_POINTERS] = {
                                 avpicture->data[0]
                               , avpicture->data[1]
                               , avpicture->data[2]
                               , avpicture->data[3]
                               , avpicture->data[4]
                               , avpicture->data[5]
                               , avpicture->data[6]
                               , avpicture->data[7]
                           };

                           {
                               // flip the frame, never ever touch this thing again!
                               // If the planes in the image are unequal size(e.g.YUV420) you need to adapt the height.
                               auto h = avcontext->height;
                               for (int i = 0; i < 4; i++) {
                                   if (i)
                                       data[i] += linesize[i] * ((h >> 1) - 1);
                                   else
                                       data[i] += linesize[i] * (h - 1);
                                   linesize[i] = -linesize[i];
                               }
                           }

                           ret = sws_scale(
                                 sws_ctx
                               , (uint8_t const * const *)data
                               , linesize
                               , 0
                               , avcontext->height
                               , avrgb->data
                               , avrgb->linesize);

                           av_packet_unref(&avpkt);

                           currPts = avpkt.dts;
                           currPts *= av_q2d(avstream->time_base);

                           usleep(1000000 * (currPts - prevPts));
                           prevPts = currPts;

                           return avrgb->data[0];
                       }
                   }
               }
               av_packet_unref(&avpkt);
           }

       } catch (...) {
       }

       return nullptr;
    }
  • FFmpeg uses all memory and crashes when inputs used multiple times in filter_complex

    28 octobre 2020, par ed22

    If I define some dummy filter_complex say :

    


    [3:v]split=2[3_1][3_2]
[3_1]format=yuv420p,scale='640:360',setsar='1/1'[1]
[3_2]format=yuv420p,scale='640:360',setsar='1/1'[2]
[4:v]split=2[4_1][4_2]
[4_1]format=yuv420p,scale='640:360',setsar='1/1'[3]
[4_2]format=yuv420p,scale='640:360',setsar='1/1'[4]
[1][2][3][4]concat=n=4:v=1:a=0[video_out]


    


    FFmpeg uses all the memory and crashes. What might be the reason ?
The same happens for :

    


    [3:v]format=yuv420p,scale='640:360',setsar='1/1'[1]
[3:v]format=yuv420p,scale='640:360',setsar='1/1'[2]
[4:v]format=yuv420p,scale='640:360',setsar='1/1'[3]
[4:v]format=yuv420p,scale='640:360',setsar='1/1'[4]
[1][2][3][4]concat=n=4:v=1:a=0[video_out]


    


    I know the examples are silly but I am here asking about why this uses all my RAM ? (and how to work around this)

    


    This works great by the way (inputs used once) :

    


    [3:v]format=yuv420p,scale='640:360',setsar='1/1'[1]
[4:v]format=yuv420p,scale='640:360',setsar='1/1'[2]
[1][2]concat=n=2:v=1:a=0[video_out]


    


    UPDATE :
The full log. While it runs it reaches 2GB memory usage in about 5s and continues to grow.

    


    ffmpeg.exe -y -f lavfi -i nullsrc=s=640x360 -i 1000211803.mp4 -i 220710.mp4 -i 223157.mp4 -i 232365.mp4 -i 1000000046.mp4 -i 1000238585.mp4 -filter_complex_script "c:\Users\wojtek\Desktop\Development\video_grid_ffmpeg_nodejs\filter_complex_param.txt" -vsync 2 -map "[video_out]" out.mp4
ffmpeg version n4.3.1-20-g8a2acdc6da Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3-win32 (GCC) 20200320
  configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-version3 --disable-debug --enable-iconv --enable-zlib --enable-libxml2 --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-opencl --enable-libvmaf --disable-vulkan --enable-libvorbis --enable-amf --enable-libaom --disable-avisynth --enable-libdav1d --disable-libdavs2 --enable-ffnvcodec --enable-cuda-llvm --disable-libglslang --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvpx --enable-libwebp --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librav1e --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libtwolame --disable-libvidstab --disable-libx264 --disable-libx265 --disable-libxavs2 --disable-libxvid --enable-libzimg --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-libs=-lgomp
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
Input #0, lavfi, from 'nullsrc=s=640x360':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '1000211803.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 00:55:35.33, start: 0.000000, bitrate: 136 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 376x210 [SAR 1:1 DAR 188:105], 134 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '220710.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 00:57:21.43, start: 0.000000, bitrate: 102 kb/s
    Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 376x210 [SAR 1:1 DAR 188:105], 99 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '223157.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 01:01:11.27, start: 0.000000, bitrate: 156 kb/s
    Stream #3:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 376x210 [SAR 1:1 DAR 188:105], 153 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #4, mov,mp4,m4a,3gp,3g2,mj2, from '232365.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 01:01:07.20, start: 0.000000, bitrate: 127 kb/s
    Stream #4:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 376x210 [SAR 1:1 DAR 188:105], 124 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #5, mov,mp4,m4a,3gp,3g2,mj2, from '1000000046.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 00:52:17.23, start: 0.000000, bitrate: 190 kb/s
    Stream #5:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 376x210 [SAR 1:1 DAR 188:105], 188 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Input #6, mov,mp4,m4a,3gp,3g2,mj2, from '1000238585.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.33.100
  Duration: 00:50:58.77, start: 0.000000, bitrate: 106 kb/s
    Stream #6:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 376x210 [SAR 1:1 DAR 188:105], 103 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #3:0 (h264) -> format
  Stream #3:0 (h264) -> format
  Stream #4:0 (h264) -> format
  Stream #4:0 (h264) -> format
  concat -> Stream #0:0 (mpeg4)
Press [q] to stop, [?] for help
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 30 fps, 15360 tbn, 30 tbc (default)
    Metadata:
      encoder         : Lavc58.91.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame= 6130 fps=610 q=20.6 Lsize=    5334kB time=00:03:24.30 bitrate= 213.9kbits/s speed=20.3x
video:5307kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.507003%


    


    The above has been produced using this filter_complex parameter value :

    


    [3:v]format=yuv420p,scale='-1:360',crop='640:in_h',setsar='1/1'[i2_640_360]
[3:v]format=yuv420p,scale='-1:360',crop='640:in_h',setsar='1/1'[i2_320_360]
[4:v]format=yuv420p,scale='-1:360',crop='640:in_h',setsar='1/1'[i3_320_360]
[4:v]format=yuv420p,scale='-1:360',crop='640:in_h',setsar='1/1'[i3_640_360]
[i2_640_360][i2_320_360][i3_320_360][i3_640_360]concat=n=4:v=1:a=0[video_out]


    


    I did not wait for it to give the out of memory error.