Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (49)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Les vidéos

    21 avril 2011, par

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (7285)

  • FFmpeg on android is crashing in avcodec_decode_video2 function

    6 juin 2015, par Matt Wolfe

    FFmpeg is crashing on : libavcodec/utils.c avcodec_decode_video2 around line 2400

    ret = avctx->codec->decode(avctx, picture, got_picture_ptr, &tmp);

    So I’ve compiled ffmpeg on android using the following configure script (based from here ) :

    prefix=${src_root}/ffmpeg/android/arm

    addi_cflags="-marm -Os -fpic"
    addi_ldflags=""

    ./configure \
    --prefix=${prefix} \
    --target-os=linux \
    --arch=arm \
    --enable-shared \
    --disable-doc \
    --disable-programs \
    --disable-symver \
    --cross-prefix=${TOOLCHAIN}/bin/arm-linux-androideabi- \
    --enable-cross-compile \
    --enable-decoder=aac \
    --enable-decoder=mpeg4 \
    --enable-decoder=h263 \
    --enable-decoder=flv \
    --enable-decoder=mpegvideo \
    --enable-decoder=mpeg2video \
    --sysroot=${SYSROOT} \
    --extra-cflags="${addi_cflags}" \
    --pkg-config=$(which pkg-config) >> ${build_log} 2>&1 || die "Couldn't configure ffmpeg"

    The *.so files get copied over into my projects which I reference from my Android.mk script :

    LOCAL_PATH := $(call my-dir)
    FFMPEG_PATH=/path/to/android-ffmpeg-with-rtmp/build/dist

    include $(CLEAR_VARS)
    LOCAL_MODULE := libavcodec
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libavcodec-56.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := libavdevice
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libavdevice-56.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := libavfilter
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libavfilter-5.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := libavformat
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libavformat-56.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := libavutil
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libavutil-54.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := libswresample
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libswresample-1.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_MODULE := libswscale
    LOCAL_SRC_FILES :=$(FFMPEG_PATH)/lib/libswscale-3.so
    include $(PREBUILT_SHARED_LIBRARY)

    include $(CLEAR_VARS)
    LOCAL_LDLIBS := -llog
    LOCAL_C_INCLUDES := $(FFMPEG_PATH)/include
    #LOCAL_PRELINK_MODULE := false
    LOCAL_MODULE    := axonffmpeg
    LOCAL_SRC_FILES := libffmpeg.c
    LOCAL_CFLAGS := -g
    LOCAL_SHARED_LIBRARIES := libavcodec libavdevice libavfilter libavformat libavutil libswresample libswscale
    include $(BUILD_SHARED_LIBRARY)

    I’m building a little wrapper to decode frames (mpeg4 video,part 2 simple profile) that come from an external camera :

    #include
    #include
    #include <android></android>log.h>

    #include <libavutil></libavutil>opt.h>
    #include <libavcodec></libavcodec>avcodec.h>
    #include <libavutil></libavutil>channel_layout.h>
    #include <libavutil></libavutil>common.h>
    #include <libavutil></libavutil>imgutils.h>
    #include <libavutil></libavutil>mathematics.h>
    #include <libavutil></libavutil>samplefmt.h>

    #define DEBUG_TAG "LibFFMpeg:NDK"

    AVCodec *codec;
    AVFrame *current_frame;
    AVCodecContext *context;

    int resWidth, resHeight, bitRate;

    void my_log_callback(void *ptr, int level, const char *fmt, va_list vargs);

    jint Java_com_mycompany_axonv2_LibFFMpeg_initDecoder(JNIEnv * env, jobject this,
     jint _resWidth, jint _resHeight, jint _bitRate)
    {
        __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "initDecoder called");

       int len;

       resWidth = _resWidth;
       resHeight = _resHeight;
       bitRate = _bitRate;
       av_log_set_callback(my_log_callback);
       av_log_set_level(AV_LOG_VERBOSE);
       avcodec_register_all();
       codec = avcodec_find_encoder(AV_CODEC_ID_MPEG4);
       if (!codec) {
         __android_log_print(ANDROID_LOG_ERROR, DEBUG_TAG, "codec %d not found", AV_CODEC_ID_MPEG4);
         return -1;
       }
       context = avcodec_alloc_context3(codec);    
       if (!context) {
         __android_log_print(ANDROID_LOG_ERROR, DEBUG_TAG,  "Could not allocate codec context");
         return -1;
       }

       context->width = resWidth;
       context->height = resHeight;
       context->bit_rate = bitRate;
       context->pix_fmt = AV_PIX_FMT_YUV420P;
       context->time_base.den = 6;
       context->time_base.num = 1;
       int openRet = avcodec_open2(context, codec, NULL);
       if (openRet &lt; 0) {
         __android_log_print(ANDROID_LOG_ERROR, DEBUG_TAG,  "Could not open codec, error:%d", openRet);
         return -1;
       }
       current_frame = av_frame_alloc();    
       if (!current_frame) {
         __android_log_print(ANDROID_LOG_ERROR, DEBUG_TAG,  "Could not allocate video frame");
         return -1;
       }    
       return 0;    
    }


    void my_log_callback(void *ptr, int level, const char *fmt, va_list vargs) {

     __android_log_print (level, DEBUG_TAG, fmt, vargs);

    }

    jint Java_com_mycompany_axonv2_LibFFMpeg_queueFrameForDecoding(JNIEnv * env, jobject this,
     jlong pts, jbyteArray jBuffer)
    {

       __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "queueFrameForDecoding called");

       AVPacket avpkt;
       av_init_packet(&amp;avpkt);
       int buffer_len = (*env)->GetArrayLength(env, jBuffer);
       uint8_t* buffer = (uint8_t *) (*env)->GetByteArrayElements(env, jBuffer,0);
       int got_frame = 0;
       __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "copied %d bytes into uint8_t* buffer", buffer_len);

       av_packet_from_data(&amp;avpkt, buffer, buffer_len);
       __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "av_packet_from_data called");

       avpkt.pts = pts;
       int ret = avcodec_decode_video2(context, current_frame, &amp;got_frame, &amp;avpkt);

       __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "avcodec_decode_video2 returned %d" , ret);

       (*env)->ReleaseByteArrayElements(env, jBuffer, (jbyte*) buffer, 0);
       __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "ReleaseByteArrayElements()");

       return 0;
    }

    Alright so the init function above works fine and the queueFrameForDecoding works up until the avcodec_decode_video2 function. I’m not expecting it to work just quite yet however as I’ve been logging output as to where we get in that function, I’ve found that there is a call (in avutil.c) :
    (around line 2400 in the latest code)

    avcodec_decode_video2(...) {
      ....
           ret = avctx->codec->decode(avctx, picture, got_picture_ptr, &amp;tmp);

    init runs fine and finds the codec and all that. Everything works great up until the avcodec_decode_video2 call :

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Build fingerprint: 'samsung/klteuc/klteatt:4.4.2/KOT49H/G900AUCU2ANG3:user/release-keys'
    Revision: '14'
    pid: 19355, tid: 22584, name: BluetoothReadTh  >>> com.mycompany.axonv2 &lt;&lt;&lt;
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
    r0 79308400  r1 79491710  r2 7b0b4a70  r3 7b0b49e8
    r4 79308400  r5 79491710  r6 00000000  r7 7b0b49e8
    r8 7b0b4a70  r9 7b0b4a80  sl 795106d8  fp 00000000
    ip 00000000  sp 7b0b49b8  lr 7ba05c18  pc 00000000  cpsr 600f0010
    d0  206c616768616c62  d1  6564206365646f63
    d2  756f722065646f63  d3  20736920656e6974
    d4  0b0a01000a0a0a0b  d5  0a630a01000a0a0a
    d6  0a630a011a00f80a  d7  0b130a011a00f90a
    d8  0000000000000000  d9  0000000000000000
    d10 0000000000000000  d11 0000000000000000
    d12 0000000000000000  d13 0000000000000000
    d14 0000000000000000  d15 0000000000000000
    d16 6369705f746f6720  d17 7274705f65727574
    d18 8000000000000000  d19 00000b9e42bd5730
    d20 0000000000000000  d21 0000000000000000
    d22 7b4fd10400000000  d23 773b894877483b68
    d24 0000000000000000  d25 3fc2f112df3e5244
    d26 40026bb1bbb55516  d27 0000000000000000
    d28 0000000000000000  d29 0000000000000000
    d30 0000000000000000  d31 0000000000000000
    scr 60000010
    backtrace:
    #00  pc 00000000  <unknown>
    #01  pc 00635c14  /data/app-lib/com.mycompany.axonv2-6/libavcodec-56.so (avcodec_decode_video2+1128)
    </unknown>

    I don’t understand why it’s crashing when trying to call the decode function. I’ve looked into the codec function pointer list and this should be calling ff_h263_decode_frame (source, libavcodec/mpeg4videodec.c) :

    AVCodec ff_mpeg4_decoder = {
       .name                  = "mpeg4",
       .long_name             = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
       .type                  = AVMEDIA_TYPE_VIDEO,
       .id                    = AV_CODEC_ID_MPEG4,
       .priv_data_size        = sizeof(Mpeg4DecContext),
       .init                  = decode_init,
       .close                 = ff_h263_decode_end,
       .decode                = ff_h263_decode_frame,
       .capabilities          = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 |
                                CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY |
                                CODEC_CAP_FRAME_THREADS,
       .flush                 = ff_mpeg_flush,
       .max_lowres            = 3,
       .pix_fmts              = ff_h263_hwaccel_pixfmt_list_420,
       .profiles              = NULL_IF_CONFIG_SMALL(mpeg4_video_profiles),
       .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context),
       .priv_class = &amp;mpeg4_class,
    };

    I know that the ff_h263_decode_frame function isn’t being called because I added logging to it and none of that gets printed.
    However, if I just call ff_h263_decode_frame directly from avcodec_decode_video2 then my logging gets output. I don’t want to call this function directly though and would rather get the ffmpeg framework working correctly. Is there something wrong with how I’ve configured ffmpeg ? I have added mpegvideo, mpeg2video, flv, h263, to the configure script but none have them have helped (they should be included automatically by —enable-decoder=mpeg4).

    Any help would be greatly appreciated.

  • FFMPEG crash while cropping video

    18 octobre 2022, par Khawar Raza

    I am using FFMPEG to crop a video. I am using ffmpeg-kit as a ffmpeg wrapper in my android app where the user can select any output size irrespective of the original video aspect ratio. Below is the problematic command :

    &#xA;

    -i "/storage/emulated/0/Download/83a2f6_1080p~2.mp4" -filter_complex "[0:v]crop=304:236:2:2[cropped]" -map "[cropped]" "/storage/emulated/0/DCIM/appname/vid_d8ee328d-ec7a-468b-9313-4561dceea33e.mp4"&#xA;

    &#xA;

    When the execution starts, the application crashes.

    &#xA;

    Logs :

    &#xA;

    I/ffmpeg-kit: Loading ffmpeg-kit.&#xA;I/ffmpeg-kit: Loaded ffmpeg-kit-min-gpl-arm64-v8a-4.5.1-20220101.&#xA;D/ffmpeg-kit: Async callback block started.&#xA;D/VideoEditor:  ffmpeg version v4.5-dev-3393-g30322ebe3c&#xA;D/VideoEditor:   Copyright (c) 2000-2021 the FFmpeg developers&#xA;D/VideoEditor:  &#xA;D/VideoEditor:    built with Android (7155654, based on r399163b1) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)&#xA;D/VideoEditor:    configuration: --cross-prefix=aarch64-linux-android- --sysroot=/files/android-sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/linux-x86_64/sysroot --prefix=/storage/light/projects/ffmpeg-kit/prebuilt/android-arm64/ffmpeg --pkg-config=/usr/bin/pkg-config --enable-version3 --arch=aarch64 --cpu=armv8-a --target-os=android --enable-neon --enable-asm --enable-inline-asm --ar=aarch64-linux-android-ar --cc=aarch64-linux-android24-clang --cxx=aarch64-linux-android24-clang&#x2B;&#x2B; --ranlib=aarch64-linux-android-ranlib --strip=aarch64-linux-android-strip --nm=aarch64-linux-android-nm --extra-libs=&#x27;-L/storage/light/projects/ffmpeg-kit/prebuilt/android-arm64/cpu-features/lib -lndk_compat&#x27; --disable-autodetect --enable-cross-compile --enable-pic --enable-jni --enable-optimizations --enable-swscale --disable-static --enable-shared --enable-pthreads --enable-v4l2-m2m --disable-outdev=fbdev --disable-indev=fbdev --enable-small --disable-xmm-clobber-test --disable-debug --enable-lto --disable-neon-clobber-test --disable-programs --disable-postproc --disable-doc --disable-htmlpages --disable-manpages --disable-podpages --disable-txtpages --disable-sndio --disable-schannel --disable-securetransport --disable-xlib --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --disable-videotoolbox --disable-audiotoolbox --disable-appkit --disable-alsa --disable-cuda --disable-cuvid --disable-nvenc --disable-vaapi --disable-vdpau --enable-libx264 --enable-libxvid --enable-libx265 --enable-libvidstab --disable-sdl2 --disable-openssl --enable-zlib --enable-mediacodec --enable-gpl&#xA;D/VideoEditor:    libavutil      57. 13.100 / 57. 13.100&#xA;D/VideoEditor:    libavcodec     59. 15.102 / 59. 15.102&#xA;D/VideoEditor:    libavformat    59. 10.100 / 59. 10.100&#xA;D/VideoEditor:    libavdevice    59.  1.100 / 59.  1.100&#xA;D/VideoEditor:    libavfilter     8. 21.100 /  8. 21.100&#xA;D/VideoEditor:    libswscale      6.  1.102 /  6.  1.102&#xA;D/VideoEditor:    libswresample   4.  0.100 /  4.  0.100&#xA;D/VideoEditor:  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/storage/emulated/0/Download/83a2f6_1080p~2.mp4&#x27;:&#xA;D/VideoEditor:    Metadata:&#xA;D/VideoEditor:      major_brand     : &#xA;D/VideoEditor:  mp42&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      minor_version   : &#xA;D/VideoEditor:  0&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      compatible_brands: &#xA;D/VideoEditor:  isommp42&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      com.android.version: &#xA;D/VideoEditor:  12&#xA;D/VideoEditor:  &#xA;D/VideoEditor:    Duration: &#xA;D/VideoEditor:  00:02:18.11&#xA;D/VideoEditor:  , start: &#xA;D/VideoEditor:  0.000000&#xA;D/VideoEditor:  , bitrate: &#xA;D/VideoEditor:  1929 kb/s&#xA;D/VideoEditor:  &#xA;D/VideoEditor:    Stream #0:0&#xA;D/VideoEditor:  [0x1]&#xA;D/VideoEditor:  (eng)&#xA;D/VideoEditor:  : Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1080x808, 1864 kb/s&#xA;D/VideoEditor:  , &#xA;D/VideoEditor:  18 fps, &#xA;D/VideoEditor:  18 tbr, &#xA;D/VideoEditor:  90k tbn&#xA;D/VideoEditor:   (default)&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      Metadata:&#xA;D/VideoEditor:        creation_time   : &#xA;D/VideoEditor:  2022-10-06T11:47:07.000000Z&#xA;D/VideoEditor:  &#xA;D/VideoEditor:        handler_name    : &#xA;D/VideoEditor:  VideoHandle&#xA;D/VideoEditor:  &#xA;D/VideoEditor:        vendor_id       : &#xA;D/VideoEditor:  [0][0][0][0]&#xA;D/VideoEditor:  &#xA;D/VideoEditor:    Stream #0:1&#xA;D/VideoEditor:  [0x2]&#xA;D/VideoEditor:  (und)&#xA;D/VideoEditor:  : Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 64 kb/s&#xA;D/VideoEditor:   (default)&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      Metadata:&#xA;D/VideoEditor:        creation_time   : &#xA;D/VideoEditor:  2022-10-06T11:47:07.000000Z&#xA;D/VideoEditor:  &#xA;D/VideoEditor:        handler_name    : &#xA;D/VideoEditor:  SoundHandle&#xA;D/VideoEditor:  &#xA;D/VideoEditor:        vendor_id       : &#xA;D/VideoEditor:  [0][0][0][0]&#xA;D/VideoEditor:  &#xA;&#xA;&#xA;D/VideoEditor:  [h264 @ 0x7654fe8500] The "sub_text_format" option is deprecated: Deprecated, does nothing&#xA;D/VideoEditor:  Stream mapping:&#xA;D/VideoEditor:    Stream #0:0 (h264) -> crop&#xA;D/VideoEditor:  &#xA;D/VideoEditor:    crop&#xA;D/VideoEditor:   -> Stream #0:0 (libx264)&#xA;D/VideoEditor:  Press [q] to stop, [?] for help&#xA;&#xA;&#xA;D/VideoEditor:  [libx264 @ 0x7654fb9af0] using cpu capabilities: ARMv8 NEON&#xA;D/VideoEditor:  [libx264 @ 0x7654fb9af0] profile High, level 1.2, 4:2:0, 8-bit&#xA;D/VideoEditor:  [libx264 @ 0x7654fb9af0] 264 - core 163 - H.264/MPEG-4 AVC codec - Copyleft 2003-2021 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=7 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=18 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;D/VideoEditor:  Output #0, mp4, to &#x27;/storage/emulated/0/DCIM/appname/vid_d8ee328d-ec7a-468b-9313-4561dceea33e.mp4&#x27;:&#xA;D/VideoEditor:    Metadata:&#xA;D/VideoEditor:      major_brand     : &#xA;D/VideoEditor:  mp42&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      minor_version   : &#xA;D/VideoEditor:  0&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      compatible_brands: &#xA;D/VideoEditor:  isommp42&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      com.android.version: &#xA;D/VideoEditor:  12&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      encoder         : &#xA;D/VideoEditor:  Lavf59.10.100&#xA;D/VideoEditor:  &#xA;D/VideoEditor:    Stream #0:0&#xA;D/VideoEditor:  : Video: h264 (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 304x236, q=2-31&#xA;D/VideoEditor:  , &#xA;D/VideoEditor:  18 fps, &#xA;D/VideoEditor:  18432 tbn&#xA;D/VideoEditor:   (default)&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      Metadata:&#xA;D/VideoEditor:        encoder         : &#xA;D/VideoEditor:  Lavc59.15.102 libx264&#xA;D/VideoEditor:  &#xA;D/VideoEditor:      Side data:&#xA;D/VideoEditor:        &#xA;D/VideoEditor:  cpb: &#xA;D/VideoEditor:  bitrate max/min/avg: 0/0/0 buffer size: 0 &#xA;D/VideoEditor:  vbv_delay: N/A&#xA;D/VideoEditor:  &#xA;D/VideoEditor:  frame=    1 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    &#xA;&#xA;A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x745d9ff000 in tid 16893 (pool-15-thread-), pid 16696 (videocompressor)&#xA;&#xA;&#xA;A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***&#xA;Build fingerprint: &#x27;samsung/x1sxx/x1s:12/SP1A.210812.016/G980FXXSFFVH7:user/release-keys&#x27;&#xA;Revision: &#x27;22&#x27;&#xA;ABI: &#x27;arm64&#x27;&#xA;Processor: &#x27;5&#x27;&#xA;A/DEBUG: Timestamp: 2022-10-09 18:57:38.882598912&#x2B;0500&#xA;A/DEBUG: Process uptime: 1086s&#xA;A/DEBUG: Cmdline: com.app.packagename&#xA;A/DEBUG: pid: 16939, tid: 20568, name: pool-15-thread-  >>> com.app.packagename &lt;&lt;&lt;&#xA;A/DEBUG: uid: 11091&#xA;A/DEBUG: signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x74640ce000&#xA;A/DEBUG:     x0  0000007594f30960  x1  00000074640c9a60  x2  00000074640c9eb4  x3  00000074640cac34&#xA;A/DEBUG:     x4  00000074640cdff4  x5  00000074671bb2dc  x6  00000000fffffffb  x7  0000000000000013&#xA;A/DEBUG:     x8  000000000000000e  x9  00000074640cddc0  x10 0000000000000013  x11 0000007488459ffc&#xA;A/DEBUG:     x12 00000074640c9c70  x13 000000000000000e  x14 0000000000007fff  x15 0000000000000013&#xA;A/DEBUG:     x16 00000074640cac04  x17 00000074640c7a58  x18 000000746626e000  x19 0000000000000027&#xA;A/DEBUG:     x20 000000776541c3b0  x21 00000074671bc4f8  x22 00000074640ca9f0  x23 0000007765422300&#xA;A/DEBUG:     x24 0000000000000027  x25 00000074640cac04  x26 0000000000000028  x27 00000074640c9a30&#xA;A/DEBUG:     x28 0000007594f30940  x29 000000000000010a&#xA;A/DEBUG:     lr  000000748841a960  sp  00000074671bb290  pc  000000748845a010  pst 0000000080000000&#xA;A/DEBUG: backtrace:&#xA;A/DEBUG:       #00 pc 0000000000359010  /data/app/~~IBCbjRbZBpQ00ORNDFZdxg==/com.app.packagename-5sdOCmN82SjJJTibcsYMpQ==/base.apk!libavcodec.so&#xA;

    &#xA;

    I don't know what is wrong with the output width and height parameters. If I change [0:v]crop=304:236:2:2[cropped] to [0:v]crop=304:304:2:2[cropped] with change in height, the process completes successfully. The original video (1080x808) is not smaller than the output size. It does not seem to be a problem in the video as I have tried different videos. Any tips on what is missing from my command ?

    &#xA;

  • Unplayable video after running FFmpeg command

    25 mai 2020, par HB.

    I asked this question last year. I resolved the issue I had and I implemented the same logic for merging an image with a video, instead of two images. This is running on Android.

    &#xA;&#xA;

    Here is the command I'm using currently :

    &#xA;&#xA;

    "-i", mFilePath, "-i", drawingPath, "-filter_complex", "[0:v]scale=iw*sar:ih,setsar=1,pad=&#x27;max(iw\\,2*trunc(ih*47/80/2))&#x27;:&#x27;max(ih\\,2*trunc(ow*80/47/2))&#x27;:(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", outputFPS, outputPath}&#xA;

    &#xA;&#xA;

    47/80/2 is calculated by getting a device's screen dimensions - 1128 x 1920.

    &#xA;&#xA;

    When running this on certain devices, it results in an unplayable video.

    &#xA;&#xA;

    But running the following command works perfectly fine :

    &#xA;&#xA;

    "-i", mFilePath, "-crf", "18", "-c:v", "libx264", "-preset", "ultrafast", outputPath};&#xA;

    &#xA;&#xA;

    I think the issue is with the filter being applied ?

    &#xA;&#xA;


    &#xA;&#xA;

    I compared running the first command on two different devices.

    &#xA;&#xA;

      &#xA;
    • On the first device (Samsung J7 Pro), I was able to run the command successfully and play the video afterward. I tested the output on both devices and it is working.
    • &#xA;

    • On the second device (Sony Xperia Tablet Z), I was able to run the command successfully but could not play the video. I tested the output on both devices and it doesn't play on either. It does play on my computer.
    • &#xA;

    &#xA;&#xA;

    I compared the original video with the one not working and the one without a filter and the only difference I could find is that the one that is not working profile is Baseline@L4.2 and the one without a filter profile is Baseline@L4.0. The original video profile is High@L4.0.

    &#xA;&#xA;

    Here are all the videos. The original, the one without a filter (working) and the one with the filter(no working).

    &#xA;&#xA;

    I have no idea why this is happening ? Any help would be appreciated.

    &#xA;&#xA;


    &#xA;&#xA;

    Edit 1 :

    &#xA;&#xA;

    Here is the actual log as requested :

    &#xA;&#xA;

    "-i", "/storage/emulated/0/Android/data/com.my.package/files/CameraTemp/2020_05_24_09_17_53.mp4", "-i", "/storage/emulated/0/Android/data/com.my.package/files/MyVideos/tempShapes.png", "-filter_complex", "[0:v]scale=iw*sar:ih,setsar=1,pad=&#x27;max(iw\\,2*trunc(ih*47/80/2))&#x27;:&#x27;max(ih\\,2*trunc(ow*80/47/2))&#x27;:(ow-iw)/2:(oh-ih)/2[v0];[1:v][v0]scale2ref[v1][v0];[v0][v1]overlay=x=(W-w)/2:y=(H-h)/2[v]", "-map", "[v]", "-map", "0:a", "-c:v", "libx264", "-preset", "ultrafast", "-r", "30", "/storage/emulated/0/Android/data/com.my.package/files/MyVideos/video with line.mp4"&#xA;

    &#xA;&#xA;

    and here is the complete log :

    &#xA;&#xA;

    ffmpeg version n4.0-39-gda39990 Copyright (c) 2000-2018 the FFmpeg developers&#xA;  built with gcc 4.9.x (GCC) 20150123 (prerelease)&#xA;  configuration: --target-os=linux --cross-prefix=/root/bravobit/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/root/bravobit/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-ffprobe --enable-libopus --enable-libvorbis --enable-libfdk-aac --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-libvpx --enable-libass --enable-yasm --enable-pthreads --disable-debug --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-linux-perf --disable-doc --disable-shared --enable-static --enable-runtime-cpudetect --enable-nonfree --enable-network --enable-avresample --enable-avformat --enable-avcodec --enable-indev=lavfi --enable-hwaccels --enable-ffmpeg --enable-zlib --enable-gpl --enable-small --enable-nonfree --pkg-config=pkg-config --pkg-config-flags=--static --prefix=/root/bravobit/ffmpeg-android/build/armeabi-v7a --extra-cflags=&#x27;-I/root/bravobit/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all&#x27; --extra-ldflags=&#x27;-L/root/bravobit/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie&#x27; --extra-cxxflags=&#xA;  libavutil      56. 14.100 / 56. 14.100&#xA;  libavcodec     58. 18.100 / 58. 18.100&#xA;  libavformat    58. 12.100 / 58. 12.100&#xA;  libavdevice    58.  3.100 / 58.  3.100&#xA;  libavfilter     7. 16.100 /  7. 16.100&#xA;  libavresample   4.  0.  0 /  4.  0.  0&#xA;  libswscale      5.  1.100 /  5.  1.100&#xA;  libswresample   3.  1.100 /  3.  1.100&#xA;  libpostproc    55.  1.100 / 55.  1.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;/storage/emulated/0/Android/data/com.my.package/files/CameraTemp/2020_05_24_09_17_53.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: isommp42&#xA;    creation_time   : 2020-05-24T08:18:02.000000Z&#xA;  Duration: 00:00:01.64, start: 0.000000, bitrate: 20750 kb/s&#xA;    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 1920x1080, 18056 kb/s, SAR 1:1 DAR 16:9, 29.70 fps, 29.67 tbr, 90k tbn, 180k tbc (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-05-24T08:18:02.000000Z&#xA;      handler_name    : VideoHandle&#xA;    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 155 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-05-24T08:18:02.000000Z&#xA;      handler_name    : SoundHandle&#xA;Input #1, png_pipe, from &#x27;/storage/emulated/0/Android/data/com.my.package/files/MyVideos/tempShapes.png&#x27;:&#xA;  Duration: N/A, bitrate: N/A&#xA;    Stream #1:0: Video: png, rgba(pc), 1920x1128, 25 tbr, 25 tbn, 25 tbc&#xA;Stream mapping:&#xA;  Stream #0:0 (h264) -> scale (graph 0)&#xA;  Stream #1:0 (png) -> scale2ref:default (graph 0)&#xA;  overlay (graph 0) -> Stream #0:0 (libx264)&#xA;  Stream #0:1 -> #0:1 (aac (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    &#xA;frame=    0 fps=0.0 q=0.0 size=       0kB time=-577014:32:22.77 bitrate=  -0.0kbits/s speed=N/A    &#xA;[libx264 @ 0xb83fc8a0] using SAR=1/1&#xA;[libx264 @ 0xb83fc8a0] using cpu capabilities: ARMv6 NEON&#xA;[libx264 @ 0xb83fc8a0] profile Constrained Baseline, level 4.2&#xA;[libx264 @ 0xb83fc8a0] 264 - core 152 r2851M ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=2 keyint_min=1 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0&#xA;Output #0, mp4, to &#x27;/storage/emulated/0/Android/data/com.my.package/files/MyVideos/video with line.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : mp42&#xA;    minor_version   : 0&#xA;    compatible_brands: isommp42&#xA;    encoder         : Lavf58.12.100&#xA;    Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1920x1128 [SAR 1:1 DAR 80:47], q=-1--1, 29 fps, 14848 tbn, 29 tbc (default)&#xA;    Metadata:&#xA;      encoder         : Lavc58.18.100 libx264&#xA;    Side data:&#xA;      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1&#xA;    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-05-24T08:18:02.000000Z&#xA;      handler_name    : SoundHandle&#xA;      encoder         : Lavc58.18.100 aac&#xA;frame=    1 fps=0.4 q=0.0 size=       0kB time=00:00:01.01 bitrate=   0.4kbits/s speed=0.397x    &#xA;frame=    5 fps=1.6 q=0.0 size=       0kB time=00:00:01.01 bitrate=   0.4kbits/s speed=0.33x    &#xA;frame=    9 fps=2.5 q=24.0 size=     256kB time=00:00:01.01 bitrate=2075.0kbits/s speed=0.28x    &#xA;frame=   13 fps=3.1 q=25.0 size=    1024kB time=00:00:01.01 bitrate=8298.9kbits/s speed=0.243x    &#xA;frame=   18 fps=3.8 q=29.0 size=    2048kB time=00:00:01.01 bitrate=16597.5kbits/s speed=0.214x    &#xA;frame=   21 fps=3.9 q=25.0 size=    2560kB time=00:00:01.01 bitrate=20746.7kbits/s speed=0.19x    &#xA;frame=   23 fps=3.9 q=25.0 size=    2816kB time=00:00:01.01 bitrate=22821.4kbits/s speed=0.173x    &#xA;frame=   26 fps=4.0 q=29.0 size=    3584kB time=00:00:01.01 bitrate=29045.3kbits/s speed=0.156x    &#xA;Past duration 0.617577 too large&#xA;Past duration 0.639641 too large&#xA;frame=   28 fps=3.9 q=29.0 size=    3840kB time=00:00:01.01 bitrate=31119.9kbits/s speed=0.142x    &#xA;Past duration 0.665230 too large&#xA;frame=   29 fps=3.8 q=25.0 size=    3840kB time=00:00:01.01 bitrate=31119.9kbits/s speed=0.132x    &#xA;Past duration 0.690834 too large&#xA;Past duration 0.711281 too large&#xA;Past duration 0.736885 too large&#xA;frame=   32 fps=3.9 q=29.0 size=    4608kB time=00:00:01.01 bitrate=37343.8kbits/s speed=0.123x    &#xA;Past duration 0.762474 too large&#xA;Past duration 0.783577 too large&#xA;Past duration 0.807564 too large&#xA;frame=   35 fps=3.9 q=25.0 size=    4864kB time=00:00:01.01 bitrate=39418.4kbits/s speed=0.112x    &#xA;Past duration 0.831551 too large&#xA;Past duration 0.855537 too large&#xA;frame=   37 fps=3.5 q=25.0 size=    5376kB time=00:00:01.01 bitrate=43567.7kbits/s speed=0.0968x    &#xA;Past duration 0.879524 too large&#xA;Past duration 0.903511 too large&#xA;frame=   39 fps=3.4 q=25.0 size=    5376kB time=00:00:01.06 bitrate=41196.6kbits/s speed=0.0927x    &#xA;Past duration 0.927498 too large&#xA;Past duration 0.951500 too large&#xA;frame=   41 fps=3.4 q=25.0 size=    5376kB time=00:00:01.13 bitrate=38700.0kbits/s speed=0.0931x    &#xA;frame=   41 fps=3.2 q=25.0 size=    5376kB time=00:00:01.13 bitrate=38700.0kbits/s speed=0.0886x    &#xA;frame=   41 fps=3.1 q=25.0 size=    5888kB time=00:00:01.43 bitrate=33554.2kbits/s speed=0.108x    &#xA;Past duration 0.975487 too large&#xA;frame=   45 fps=3.2 q=26.0 size=    6656kB time=00:00:01.60 bitrate=33905.4kbits/s speed=0.114x    &#xA;frame=   45 fps=3.0 q=-1.0 Lsize=    8158kB time=00:00:01.65 bitrate=40480.7kbits/s speed=0.11x    &#xA;video:8127kB audio:28kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.032895%&#xA;[libx264 @ 0xb83fc8a0] frame I:23    Avg QP:24.70  size:337646&#xA;[libx264 @ 0xb83fc8a0] frame P:22    Avg QP:29.00  size: 25250&#xA;[libx264 @ 0xb83fc8a0] mb I  I16..4: 100.0%  0.0%  0.0%&#xA;[libx264 @ 0xb83fc8a0] mb P  I16..4:  0.4%  0.0%  0.0%  P16..4: 43.6%  0.0%  0.0%  0.0%  0.0%    skip:56.0%&#xA;[libx264 @ 0xb83fc8a0] coded y,uvDC,uvAC intra: 90.0% 84.7% 58.1% inter: 20.1% 6.2% 0.1%&#xA;[libx264 @ 0xb83fc8a0] i16 v,h,dc,p: 25% 28% 28% 20%&#xA;[libx264 @ 0xb83fc8a0] i8c dc,h,v,p: 39% 25% 20% 16%&#xA;[libx264 @ 0xb83fc8a0] kb/s:42901.20&#xA;[aac @ 0xb83d7d10] Qavg: 3517.779&#xA;

    &#xA;