Recherche avancée

Médias (0)

Mot : - Tags -/navigation

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

Autres articles (112)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • Personnaliser les catégories

    21 juin 2013, par

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

Sur d’autres sites (6935)

  • Android player, FFMPEG, JNI

    14 septembre 2022, par Nikita Pavlenko

    Can I use std::async with jni or I should throughstd::thread or pthread_create ? Because i'm writing android player with my C++ lib that uses std::async for demuxing, video and audio. I saw that every call CallVoidMethod(of course with attach and detach thread) create new thread (thread id in Java methods is increased). And in some time a big error occurres

    


    A/e.androidplaye: java_vm_ext.cc:594] JNI DETECTED ERROR IN APPLICATION: thread Thread[2,tid=3420,Native,Thread*=0xb400007bd4470c00,peer=0x12cc1510,"Thread-8687"] using JNIEnv* from thread Thread[3,tid=3419,Native,Thread*=0xb400007aadc2e400,peer=0x12d00000,"Thread-8688"]&#xA;    java_vm_ext.cc:594]     in call to CallVoidMethodV&#xA;A/e.androidplaye: runtime.cc:675] Runtime aborting...&#xA;    runtime.cc:675] Dumping all threads without mutator lock held&#xA;    runtime.cc:675] All threads:&#xA;    runtime.cc:675] DALVIK THREADS (23):&#xA;    runtime.cc:675] "Thread-8687" prio=10 tid=2 Runnable&#xA;    runtime.cc:675]   | group="" sCount=0 ucsCount=0 flags=0 obj=0x12d80000 self=0xb400007bd4470c00&#xA;    runtime.cc:675]   | sysTid=3420 nice=-10 cgrp=default sched=0/0 handle=0x7aa4166cb0&#xA;    runtime.cc:675]   | state=R schedstat=( 6040359820 215025421 9416 ) utm=498 stm=105 core=1 HZ=100&#xA;    runtime.cc:675]   | stack=0x7aa406f000-0x7aa4071000 stackSize=991KB&#xA;    runtime.cc:675]   | held mutexes= "abort lock" "mutator lock"(shared held)&#xA;    runtime.cc:675]   native: #00 pc 00000000005376cc  /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream >&amp;, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)&#x2B;128) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #01 pc 00000000006f0e24  /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream >&amp;, bool, BacktraceMap*, bool) const&#x2B;236) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #02 pc 00000000006fe6b0  /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)&#x2B;208) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #03 pc 0000000000364174  /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)&#x2B;440) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #04 pc 00000000006fce50  /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream >&amp;, bool)&#x2B;280) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #05 pc 00000000006d7ec4  /apex/com.android.art/lib64/libart.so (art::AbortState::Dump(std::__1::basic_ostream >&amp;) const&#x2B;212) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #06 pc 00000000006d2b24  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)&#x2B;1016) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #07 pc 0000000000016ea8  /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void>&amp;&amp;)::$_3::__invoke(char const*)&#x2B;80) (BuildId: b77c57f68a484ed93d5a7eda59d83bf9)&#xA;    runtime.cc:675]   native: #08 pc 0000000000016450  /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()&#x2B;352) (BuildId: b77c57f68a484ed93d5a7eda59d83bf9)&#xA;    runtime.cc:675]   native: #09 pc 0000000000445224  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)&#x2B;1612) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #10 pc 0000000000329258  /apex/com.android.art/lib64/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)&#x2B;108) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #11 pc 000000000048d59c  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const*, ...) (.__uniq.99033978352804627313491551960229047428)&#x2B;144) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #12 pc 0000000000453ad0  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&amp;, bool, char const*, art::(anonymous namespace)::JniValueType*) (.__uniq.99033978352804627313491551960229047428)&#x2B;4648) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #13 pc 0000000000475e2c  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CheckCallArgs(art::ScopedObjectAccess&amp;, art::(anonymous namespace)::ScopedCheck&amp;, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, art::InvokeType, art::(anonymous namespace)::VarArgs const*) (.__uniq.99033978352804627313491551960229047428)&#x2B;76) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;A/e.androidplaye: runtime.cc:675]   native: #14 pc 0000000000474d4c  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType) (.__uniq.99033978352804627313491551960229047428)&#x2B;268) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #15 pc 00000000005ca9ec  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list) (.__uniq.99033978352804627313491551960229047428.llvm.5591279935177935698)&#x2B;72) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #16 pc 0000000000024ad4  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)&#x2B;172) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #17 pc 000000000002173c  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (ffmpeg::AndroidPlayer::handleAudioFrame(ffmpeg::Frame const&amp;)&#x2B;184) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #18 pc 0000000000028488  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (???) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #19 pc 00000000000283c0  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (???) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #20 pc 000000000002835c  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (std::__ndk1::__bind_return<void> >, std::__ndk1::tuple, __is_valid_bind_return<void> >, std::__ndk1::tuple >::value>::type std::__ndk1::__bind<void> const&amp;>::operator()(ffmpeg::Frame const&amp;)&#x2B;76) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #21 pc 00000000000282ec  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (???) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #22 pc 0000000000028288  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (void std::__ndk1::__invoke_void_return_wrapper<void>::__call const&amp;>&amp;, ffmpeg::Frame const&amp;>(std::__ndk1::__bind<void> const&amp;>&amp;, ffmpeg::Frame const&amp;)&#x2B;48) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #23 pc 0000000000028234  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (???) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;A/e.androidplaye: runtime.cc:675]   native: #24 pc 000000000002725c  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 174000) (std::__ndk1::__function::__func const&amp;>, std::__ndk1::allocator const&amp;> >, void (ffmpeg::Frame const&amp;)>::operator()(ffmpeg::Frame const&amp;)&#x2B;48) (BuildId: 2f8cba1fdcec13c03a15bf3de18a4ddd1c91325d)&#xA;    runtime.cc:675]   native: #25 pc 000000000004039c  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #26 pc 000000000003b1f8  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (std::__ndk1::function<void>::operator()(ffmpeg::Frame const&amp;) const&#x2B;44) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #27 pc 0000000000039dd4  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (ffmpeg::Player::playAudio()&#x2B;164) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #28 pc 000000000003db90  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #29 pc 000000000003db1c  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #30 pc 000000000003dacc  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #31 pc 000000000003da10  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #32 pc 000000000003e6cc  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #33 pc 000000000003e5e0  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #34 pc 000000000003df50  /data/app/~~kWvaZj7JOt9YyFawweYvtw==/com.example.androidplayer-_Vqw2zfb57LpijMAPW6U4w==/base.apk (offset 380000) (???) (BuildId: 9a9d303cb440eed7364800d0ead0962a65175480)&#xA;    runtime.cc:675]   native: #35 pc 00000000000efb14  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)&#x2B;264) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #36 pc 000000000008c35c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread&#x2B;68) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   (no managed stack frames)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "main" prio=10 tid=1 Native&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x71915d18 self=0xb400007bd4472800&#xA;    runtime.cc:675]   | sysTid=3241 nice=-10 cgrp=default sched=0/0 handle=0x7bd5ac64f8&#xA;    runtime.cc:675]   | state=S schedstat=( 20358355629 2398850818 13099 ) utm=1560 stm=474 core=5 HZ=100&#xA;    runtime.cc:675]   | stack=0x7ff2616000-0x7ff2618000 stackSize=8188KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 0000000000086f90  /apex/com.android.runtime/lib64/bionic/libc.so (syscall&#x2B;32) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;A/e.androidplaye: runtime.cc:675]   native: #01 pc 000000000047cc80  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)&#x2B;140) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #02 pc 00000000005c8cac  /apex/com.android.art/lib64/libart.so (art::(anonymous namespace)::CheckJNI::FindClass(_JNIEnv*, char const*) (.__uniq.99033978352804627313491551960229047428.llvm.5591279935177935698)&#x2B;1096) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #03 pc 000000000011aae0  /system/lib64/libandroid_runtime.so (android::NativeDisplayEventReceiver::dispatchVsync(long, android::PhysicalDisplayId, unsigned int, android::VsyncEventData)&#x2B;80) (BuildId: f73b7e7fab15dc5b96680181e111fb8f)&#xA;    runtime.cc:675]   native: #04 pc 00000000000af3f0  /system/lib64/libgui.so (android::DisplayEventDispatcher::handleEvent(int, int, void*)&#x2B;204) (BuildId: 3f01a4a30b5fa3a4804b8361ddccc4a3)&#xA;    runtime.cc:675]   native: #05 pc 0000000000018184  /system/lib64/libutils.so (android::Looper::pollInner(int)&#x2B;916) (BuildId: 16796d84bdcf185b2112267dbd820c19)&#xA;    runtime.cc:675]   native: #06 pc 0000000000017d84  /system/lib64/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)&#x2B;116) (BuildId: 16796d84bdcf185b2112267dbd820c19)&#xA;    runtime.cc:675]   native: #07 pc 0000000000154668  /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv*, _jobject*, long, int)&#x2B;48) (BuildId: f73b7e7fab15dc5b96680181e111fb8f)&#xA;    runtime.cc:675]   at android.os.MessageQueue.nativePollOnce(Native method)&#xA;    runtime.cc:675]   at android.os.MessageQueue.next(MessageQueue.java:337)&#xA;    runtime.cc:675]   at android.os.Looper.loopOnce(Looper.java:168)&#xA;    runtime.cc:675]   at android.os.Looper.loop(Looper.java:299)&#xA;    runtime.cc:675]   at android.app.ActivityThread.main(ActivityThread.java:8250)&#xA;    runtime.cc:675]   at java.lang.reflect.Method.invoke(Native method)&#xA;    runtime.cc:675]   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)&#xA;    runtime.cc:675]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "Signal Catcher" prio=10 tid=4 WaitingInMainSignalCatcherLoop&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x13340270 self=0xb400007b1f611800&#xA;    runtime.cc:675]   | sysTid=3247 nice=-20 cgrp=default sched=0/0 handle=0x7b209aecb0&#xA;    runtime.cc:675]   | state=S schedstat=( 300521 0 2 ) utm=0 stm=0 core=6 HZ=100&#xA;    runtime.cc:675]   | stack=0x7b208b7000-0x7b208b9000 stackSize=991KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 00000000000db77c  /apex/com.android.runtime/lib64/bionic/libc.so (__rt_sigtimedwait&#x2B;12) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #01 pc 000000000009a1b8  /apex/com.android.runtime/lib64/bionic/libc.so (sigwait64&#x2B;92) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #02 pc 000000000057420c  /apex/com.android.art/lib64/libart.so (art::SignalCatcher::WaitForSignal(art::Thread*, art::SignalSet&amp;)&#x2B;108) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #03 pc 0000000000573e1c  /apex/com.android.art/lib64/libart.so (art::SignalCatcher::Run(void*)&#x2B;228) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #04 pc 00000000000efb14  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)&#x2B;264) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #05 pc 000000000008c35c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread&#x2B;68) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   (no managed stack frames)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "perfetto_hprof_listener" prio=10 tid=7 Native (still starting up)&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x0 self=0xb400007b138a8800&#xA;    runtime.cc:675]   | sysTid=3248 nice=-20 cgrp=default sched=0/0 handle=0x7b208b0cb0&#xA;    runtime.cc:675]   | state=S schedstat=( 175052 0 3 ) utm=0 stm=0 core=6 HZ=100&#xA;A/e.androidplaye: runtime.cc:675]   | stack=0x7b207b9000-0x7b207bb000 stackSize=991KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 00000000000daad8  /apex/com.android.runtime/lib64/bionic/libc.so (read&#x2B;8) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #01 pc 000000000001d840  /apex/com.android.art/lib64/libperfetto_hprof.so (void* std::__1::__thread_proxy >, ArtPlugin_Initialize::$_34> >(void*)&#x2B;260) (BuildId: d60314cb99f035c98d20ab286d52fc6d)&#xA;    runtime.cc:675]   native: #02 pc 00000000000efb14  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)&#x2B;264) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #03 pc 000000000008c35c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread&#x2B;68) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   (no managed stack frames)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "ADB-JDWP Connection Control Thread" prio=10 tid=8 WaitingInMainDebuggerLoop&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x133402e8 self=0xb400007b1f64d800&#xA;    runtime.cc:675]   | sysTid=3249 nice=-20 cgrp=default sched=0/0 handle=0x7b207b2cb0&#xA;    runtime.cc:675]   | state=S schedstat=( 935055 0 13 ) utm=0 stm=0 core=4 HZ=100&#xA;    runtime.cc:675]   | stack=0x7b206bb000-0x7b206bd000 stackSize=991KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 00000000000dbe3c  /apex/com.android.runtime/lib64/bionic/libc.so (__ppoll&#x2B;12) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #01 pc 00000000000973b4  /apex/com.android.runtime/lib64/bionic/libc.so (poll&#x2B;96) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #02 pc 00000000000099e4  /apex/com.android.art/lib64/libadbconnection.so (adbconnection::AdbConnectionState::RunPollLoop(art::Thread*)&#x2B;724) (BuildId: c4c03b03ed50414e876ae23cd04eae7e)&#xA;    runtime.cc:675]   native: #03 pc 00000000000080ac  /apex/com.android.art/lib64/libadbconnection.so (adbconnection::CallbackFunction(void*)&#x2B;1320) (BuildId: c4c03b03ed50414e876ae23cd04eae7e)&#xA;    runtime.cc:675]   native: #04 pc 00000000000efb14  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)&#x2B;264) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #05 pc 000000000008c35c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread&#x2B;68) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   (no managed stack frames)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "Jit thread pool worker thread 0" prio=5 tid=9 Native&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x13340360 self=0xb400007b138c4000&#xA;    runtime.cc:675]   | sysTid=3250 nice=9 cgrp=default sched=0/0 handle=0x7b206b4cb0&#xA;    runtime.cc:675]   | state=S schedstat=( 1384418878 710723029 1368 ) utm=118 stm=20 core=1 HZ=100&#xA;    runtime.cc:675]   | stack=0x7b205b5000-0x7b205b7000 stackSize=1023KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 0000000000086f90  /apex/com.android.runtime/lib64/bionic/libc.so (syscall&#x2B;32) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #01 pc 000000000047cc80  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)&#x2B;140) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #02 pc 000000000047cb18  /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)&#x2B;120) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #03 pc 0000000000619810  /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()&#x2B;136) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #04 pc 00000000006196f0  /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)&#x2B;160) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;A/e.androidplaye: runtime.cc:675]   native: #05 pc 00000000000efb14  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)&#x2B;264) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #06 pc 000000000008c35c  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread&#x2B;68) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   (no managed stack frames)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "HeapTaskDaemon" prio=5 tid=10 Native&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x13340d60 self=0xb400007b138d5800&#xA;    runtime.cc:675]   | sysTid=3256 nice=4 cgrp=default sched=0/0 handle=0x7b205aecb0&#xA;    runtime.cc:675]   | state=S schedstat=( 12936736517 2503386925 3722 ) utm=1074 stm=219 core=4 HZ=100&#xA;    runtime.cc:675]   | stack=0x7b204ab000-0x7b204ad000 stackSize=1039KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 0000000000086f90  /apex/com.android.runtime/lib64/bionic/libc.so (syscall&#x2B;32) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #01 pc 000000000047cc80  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)&#x2B;140) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #02 pc 000000000056bbb8  /apex/com.android.art/lib64/libart.so (art::gc::Heap::TrimIndirectReferenceTables(art::Thread*)&#x2B;1364) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #03 pc 000000000056b468  /apex/com.android.art/lib64/libart.so (art::gc::Heap::Trim(art::Thread*)&#x2B;68) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #04 pc 000000000056b3cc  /apex/com.android.art/lib64/libart.so (art::gc::Heap::HeapTrimTask::Run(art::Thread*)&#x2B;32) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #05 pc 000000000046ce28  /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)&#x2B;56) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   at dalvik.system.VMRuntime.runHeapTasks(Native method)&#xA;    runtime.cc:675]   at java.lang.Daemons$HeapTaskDaemon.runInternal(Daemons.java:609)&#xA;    runtime.cc:675]   at java.lang.Daemons$Daemon.run(Daemons.java:140)&#xA;    runtime.cc:675]   at java.lang.Thread.run(Thread.java:1012)&#xA;    runtime.cc:675] &#xA;    runtime.cc:675] "ReferenceQueueDaemon" prio=5 tid=11 Waiting&#xA;    runtime.cc:675]   | group="" sCount=1 ucsCount=0 flags=1 obj=0x133403d8 self=0xb400007b138d7400&#xA;    runtime.cc:675]   | sysTid=3259 nice=4 cgrp=default sched=0/0 handle=0x7b204a4cb0&#xA;    runtime.cc:675]   | state=S schedstat=( 2230226662 207087138 1228 ) utm=26 stm=196 core=4 HZ=100&#xA;    runtime.cc:675]   | stack=0x7b203a1000-0x7b203a3000 stackSize=1039KB&#xA;    runtime.cc:675]   | held mutexes=&#xA;    runtime.cc:675]   native: #00 pc 0000000000086f90  /apex/com.android.runtime/lib64/bionic/libc.so (syscall&#x2B;32) (BuildId: 94065bf91428f6ae9fb310c478171302)&#xA;    runtime.cc:675]   native: #01 pc 000000000047cc80  /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)&#x2B;140) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   native: #02 pc 0000000000486588  /apex/com.android.art/lib64/libart.so (art::Monitor::Wait(art::Thread*, art::ObjPtr, long, int, bool, art::ThreadState)&#x2B;2520) (BuildId: 56e704c544e6c624201be2ab4933e853)&#xA;    runtime.cc:675]   at java.lang.Object.wait(Native method)&#xA;    runtime.cc:675]   - waiting on &lt;0x0483c441> (a java.lang.Class)&#xA;    runtime.cc:675]   at java.lang.Object.wait(Object.java:442)&#xA;    runtime.cc:675]   at java.lang.Object.wait(Object.java:568)&#xA;    runtime.cc:675]   at java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:232)&#xA;    runtime.cc:675]   - locked &lt;0x0483c441> (a java.lang.Class)&#xA;    runtime.cc:675]   at java.lang.Daemons$Daemon.run(Daemons.java:140)&#xA;    runtime.cc:675]   at java.lang.Thread.run(Thread.java:1012)&#xA;    runtime.cc:675] &#xA;...(this part i missed because so big)&#xA;W/e.androidplaye: Suspending all threads took: 10.935ms&#xA;A/e.androidplaye: runtime.cc:683] JNI DETECTED ERROR IN APPLICATION: thread Thread[2,tid=3420,Native,Thread*=0xb400007bd4470c00,peer=0x12cc1510,"Thread-8687"] using JNIEnv* from thread Thread[3,tid=3419,Native,Thread*=0xb400007aadc2e400,peer=0x12d00000,"Thread-8688"]&#xA;    runtime.cc:683]     in call to CallVoidMethodV&#xA;A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 3420 (Thread-8687), pid 3241 (e.androidplayer)&#xA;</void></void></void></void></void></void></void>

    &#xA;

  • How to handle metadatas in the Chromium FFmpegDecodingLoop with custom Avfilter ?

    14 septembre 2020, par michal-b

    I'm trying to add a deinterlacing filter to the decoding loop of ffmpeg in Chromium by using a custom avFilter.

    &#xA;

    What I have now :
    &#xA;I made alll the changes required for ffmpeg to work with the yadif filter.
    &#xA;I created an avFilter graph :

    &#xA;

    void FFmpegDecodingLoop::InitFilterGraph(AVFrame *frame) {&#xA;    if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "entering InitFilterGraph : " &lt;&lt; filter_initialised;&#xA;    if (filter_initialised) return;&#xA;&#xA;    int result;&#xA;&#xA;    const AVFilter *buffer_src   = avfilter_get_by_name("buffer");&#xA;    const AVFilter *buffer_sink  = avfilter_get_by_name("buffersink");&#xA;    AVFilterInOut *inputs  = avfilter_inout_alloc();&#xA;    AVFilterInOut *outputs = avfilter_inout_alloc();&#xA;&#xA;    AVCodecContext *ctx = context_;&#xA;    char args[512];&#xA;&#xA;    int frame_fix = 0; // fix bad width on some streams&#xA;    if (frame->width &lt; 704) frame_fix = 2;&#xA;    else if (frame->width > 704) frame_fix = -16;&#xA;&#xA;    snprintf(args, sizeof(args),&#xA;         "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",&#xA;         frame->width &#x2B; frame_fix,&#xA;         frame->height,&#xA;         frame->format,// ctx->pix_fmt,&#xA;         ctx->time_base.num,&#xA;         ctx->time_base.den,&#xA;         ctx->sample_aspect_ratio.num,&#xA;         ctx->sample_aspect_ratio.den);&#xA;&#xA;    const char *description = "yadif";&#xA;&#xA;    filter_graph = avfilter_graph_alloc();&#xA;    if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "Filter graph - args : " &lt;&lt; args;&#xA;    result = avfilter_graph_create_filter(&amp;buffersrc_ctx_, buffer_src, "in", args, NULL, filter_graph);&#xA;    if (result &lt; 0) {&#xA;        if (media_log_) MEDIA_LOG(ERROR, media_log_) &lt;&lt; "Filter graph - Unable to create buffer source : " &lt;&lt; result;&#xA;        return;&#xA;    }&#xA;&#xA;    AVBufferSinkParams *params = av_buffersink_params_alloc();&#xA;    enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P9, AV_PIX_FMT_NONE };&#xA;&#xA;    params->pixel_fmts = pix_fmts;&#xA;    result = avfilter_graph_create_filter(&amp;buffersink_ctx_, buffer_sink, "out", NULL, params, filter_graph);&#xA;    av_free(params);&#xA;    if (result &lt; 0) {&#xA;        if (media_log_) MEDIA_LOG(ERROR, media_log_) &lt;&lt; "Filter graph - Unable to create buffer sink";&#xA;        return;&#xA;    }&#xA;&#xA;    inputs->name        = av_strdup("out");&#xA;    inputs->filter_ctx  = buffersink_ctx_;&#xA;    inputs->pad_idx     = 0;&#xA;    inputs->next        = NULL;&#xA;&#xA;    outputs->name       = av_strdup("in");&#xA;    outputs->filter_ctx = buffersrc_ctx_;&#xA;    outputs->pad_idx    = 0;&#xA;    outputs->next       = NULL;&#xA;&#xA;&#xA;    result = avfilter_graph_parse_ptr(filter_graph, description, &amp;inputs, &amp;outputs, NULL);&#xA;    if (result &lt; 0 &amp;&amp; media_log_) MEDIA_LOG(ERROR, media_log_) &lt;&lt; "Filter graph - avfilter_graph_parse_ptr ERROR : " &lt;&lt; result;&#xA;&#xA;    result = avfilter_graph_config(filter_graph, NULL);&#xA;    if (result &lt; 0 &amp;&amp; media_log_) MEDIA_LOG(ERROR, media_log_) &lt;&lt; "Filter graph - avfilter_graph_config error";&#xA;&#xA;    filter_initialised = true;&#xA;}&#xA;

    &#xA;

    And when I receive the frame, depending on the fact it's interlaced or not, I send it to the avFilter graph or straight to the frame_ready_cb.

    &#xA;

        ...&#xA;    bool frame_processing_success = false;&#xA;    if (!frame_.get()->interlaced_frame) {     // not interlaced&#xA;          if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "Detected not interlaced video frame";&#xA;          frame_processing_success = frame_ready_cb.Run(frame_.get());&#xA;    } else {&#xA;      if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "Detected interlaced video frame" &lt;&lt; frame_.get()->metadata;&#xA;&#xA;      if (!filter_initialised) {&#xA;        this->InitFilterGraph(frame_.get());&#xA;        if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "Media filter ok";&#xA;      } &#xA;&#xA;      if (av_buffersrc_add_frame_flags(buffersrc_ctx_, frame_.get(), AV_BUFFERSRC_FLAG_KEEP_REF) &lt; 0) {&#xA;        if (!continue_on_decoding_errors_)&#xA;          return DecodeStatus::kDecodeFrameFailed;&#xA;        decoder_error = true;&#xA;        continue;&#xA;      }&#xA;&#xA;      while (true) {&#xA;        const int ret = av_buffersink_get_frame(buffersink_ctx_, filter_frame_.get());&#xA;        if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "ret = " &lt;&lt; ret;&#xA;        if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF){&#xA;          if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "ret error but waiting for more frames" &lt;&lt; ret;&#xA;          frame_processing_success = true;&#xA;          if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "ret error but waitning for more frames ; filter description = " &lt;&lt; buffersink_ctx_->filter->description;&#xA;          break;&#xA;        }&#xA;        &#xA;        if (ret &lt; 0) {&#xA;          if (!continue_on_decoding_errors_)&#xA;            return DecodeStatus::kDecodeFrameFailed;&#xA;          decoder_error = true;&#xA;          frame_processing_success = true;&#xA;          break;&#xA;        }&#xA;        frame_processing_success = frame_ready_cb.Run(filter_frame_.get());&#xA;        if (media_log_) MEDIA_LOG(DEBUG, media_log_) &lt;&lt; "producing deinterlaced frame : " &lt;&lt; frame_processing_success;&#xA;        av_frame_unref(filter_frame_.get());&#xA;      }&#xA;    }&#xA;    av_frame_unref(frame_.get());&#xA;    if (!frame_processing_success)&#xA;      return DecodeStatus::kFrameProcessingFailed;&#xA;}&#xA;

    &#xA;

    This seems to work, I can send frames to the avFilter and get them back but I'm having an issue with the metadas (it seems).

    &#xA;

    The issue :
    &#xA;When I get a frame from the avFilter (av_buffersink_get_frame(buffersink_ctx_, filter_frame_.get())) and send it to the frame ready callback I have this kind of errors :

    &#xA;

        [36723:38755:0914/105148.322600:FATAL:values.cc(516)] Check failed: is_dict(). &#xA;0   libbase.dylib                       0x00000001052febff base::debug::CollectStackTrace(void**, unsigned long) &#x2B; 31&#xA;1   libbase.dylib                       0x0000000104f9717b base::debug::StackTrace::StackTrace(unsigned long) &#x2B; 75&#xA;2   libbase.dylib                       0x0000000104f971fd base::debug::StackTrace::StackTrace(unsigned long) &#x2B; 29&#xA;3   libbase.dylib                       0x0000000104f971d8 base::debug::StackTrace::StackTrace() &#x2B; 40&#xA;4   libbase.dylib                       0x0000000104fe4897 logging::LogMessage::~LogMessage() &#x2B; 183&#xA;5   libbase.dylib                       0x0000000104fe3515 logging::LogMessage::~LogMessage() &#x2B; 21&#xA;6   libbase.dylib                       0x00000001052df4dc base::Value::SetKey(std::__1::basic_string, std::__1::allocator<char> >&amp;&amp;, base::Value&amp;&amp;) &#x2B; 188&#xA;7   libmedia.dylib                      0x000000010eda0dea media::VideoFrameMetadata::SetBoolean(media::VideoFrameMetadata::Key, bool) &#x2B; 90&#xA;8   libmedia.dylib                      0x000000010efb6943 media::FFmpegVideoDecoder::OnNewFrame(AVFrame*) &#x2B; 403&#xA;9   libmedia.dylib                      0x000000010efb716b bool base::internal::FunctorTraits<bool void="void">::Invoke<bool>(bool (media::FFmpegVideoDecoder::*)(AVFrame*), media::FFmpegVideoDecoder*&amp;&amp;, AVFrame*&amp;&amp;) &#x2B; 155&#xA;10  libmedia.dylib                      0x000000010efb7046 bool base::internal::InvokeHelper::MakeItSo<bool>(bool (media::FFmpegVideoDecoder::* const&amp;)(AVFrame*), media::FFmpegVideoDecoder*&amp;&amp;, AVFrame*&amp;&amp;) &#x2B; 102&#xA;11  libmedia.dylib                      0x000000010efb6fa5 bool base::internal::Invoker&lt;base::internal::BindState<bool> >, bool (AVFrame*)>::RunImpl<bool> > const&amp;, 0ul>(bool (media::FFmpegVideoDecoder::* const&amp;)(AVFrame*), std::__1::tuple&lt;base::internal::UnretainedWrapper > const&amp;, std::__1::integer_sequence<unsigned 0ul="0ul">, AVFrame*&amp;&amp;) &#x2B; 101&#xA;12  libmedia.dylib                      0x000000010efb6f0a base::internal::Invoker&lt;base::internal::BindState<bool> >, bool (AVFrame*)>::Run(base::internal::BindStateBase*, AVFrame*) &#x2B; 106&#xA;13  libmedia.dylib                      0x000000010f127101 base::RepeatingCallback<bool>::Run(AVFrame*) const &amp; &#x2B; 113&#xA;14  libmedia.dylib                      0x000000010f126e70 media::FFmpegDecodingLoop::DecodePacket(AVPacket const*, base::RepeatingCallback<bool>) &#x2B; 2528&#xA;</bool></bool></bool></unsigned></bool></bool></bool></bool></bool></char>

    &#xA;

    So the error is in FFmpegVideoDecoder::OnNewFrame when it calls media::VideoFrameMetadata::SetBoolean.&#xA;I get the same kind of errors when void VideoFrameMetadata::SetTimeTicks gets called.

    &#xA;

    So obviously I have an issue with the metadatas of the video frame I get back from the avFilter which has just a yadif filter.

    &#xA;

    Is there something I missed with the metadas or otherwise ?

    &#xA;

  • The recorded video is distorted (FFMPEG)

    13 décembre 2017, par No Name

    The source is taken from here.

    I’m initializing this :

    private void initRecorder() {
       Log.i(LOG_TAG, "init mFrameRecorder");

       String recordedTime = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault())
               .format(new Date());
       mVideo = CameraHelper.getOutputMediaFile(recordedTime, CameraHelper.MEDIA_TYPE_VIDEO);
       Log.i(LOG_TAG, "Output Video: " + mVideo);

       mFrameRecorder = new FFmpegFrameRecorder(mVideo, videoWidth, videoHeight, 1);
       mFrameRecorder.setFormat("mp4");
       mFrameRecorder.setSampleRate(sampleAudioRateInHz);
       mFrameRecorder.setFrameRate(frameRate);
       // Use H264
       mFrameRecorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
       mFrameRecorder.setVideoQuality(2);

       mFrameRecorder.setVideoOption("crf", "20");
       mFrameRecorder.setVideoOption("preset", "superfast");
       mFrameRecorder.setVideoOption("tune", "zerolatency");

       Log.i(LOG_TAG, "mFrameRecorder initialize success");
    }

    where frameRate = 60 ;

    And video recording :

    class VideoRecordThread extends RunningThread {
       @Override
       public void run() {
           List<string> filters = new ArrayList&lt;>();
           // Transpose
           String transpose = null;
           android.hardware.Camera.CameraInfo info =
                   new android.hardware.Camera.CameraInfo();
           android.hardware.Camera.getCameraInfo(mCameraId, info);
           if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
               switch (info.orientation) {
                   case 270:
                       transpose = "transpose=cclock"; // Mirrored horizontally as preview display
                       break;
                   case 90:
                       transpose = "transpose=clock"; // Mirrored horizontally as preview display
                       break;
               }
           } else {
               switch (info.orientation) {
                   case 270:
                       transpose = "transpose=cclock";
                       break;
                   case 90:
                       transpose = "transpose=clock";
                       break;
               }
           }
           if (transpose != null) {
               filters.add(transpose);
           }
           // Crop (only vertically)
           int width = previewHeight;
           int height = width * videoHeight / videoWidth;
           String crop = String.format(Locale.getDefault(),"crop=%d:%d:%d:%d",
                   width, height,
                   (previewHeight - width) / 2, (previewWidth - height) / 2);
           filters.add(crop);
           // Scale (to designated size)
           String scale = String.format(Locale.getDefault(),"scale=%d:%d", videoHeight, videoWidth);
           filters.add(scale);

           FFmpegFrameFilter frameFilter = new FFmpegFrameFilter(TextUtils.join(",", filters),
                   previewWidth, previewHeight);
           frameFilter.setPixelFormat(avutil.AV_PIX_FMT_NV21);
           frameFilter.setFrameRate(frameRate);
           try {
               frameFilter.start();
           } catch (FrameFilter.Exception e) {
               e.printStackTrace();
           }

           isRunning = true;
           FrameToRecord recordedFrame;

           while (isRunning || !mFrameToRecordQueue.isEmpty()) {
               try {
                   recordedFrame = mFrameToRecordQueue.take();
               } catch (InterruptedException ie) {
                   ie.printStackTrace();
                   try {
                       frameFilter.stop();
                   } catch (FrameFilter.Exception e) {
                       e.printStackTrace();
                   }
                   break;
               }

               if (mFrameRecorder != null) {
                   long timestamp = recordedFrame.getTimestamp();
                   if (timestamp > mFrameRecorder.getTimestamp()) {
                       mFrameRecorder.setTimestamp(timestamp);
                   }
                   long startTime = System.currentTimeMillis();
                   Frame filteredFrame = null;
                   try {
                       frameFilter.push(recordedFrame.getFrame());
                       filteredFrame = frameFilter.pull();
                   } catch (FrameFilter.Exception e) {
                       e.printStackTrace();
                   }
                   try {
                       mFrameRecorder.record(filteredFrame);
                   } catch (FFmpegFrameRecorder.Exception e) {
                       e.printStackTrace();
                   }
                   long endTime = System.currentTimeMillis();
                   long processTime = endTime - startTime;
                   mTotalProcessFrameTime += processTime;
                   Log.d(LOG_TAG, "This frame process time: " + processTime + "ms");
                   long totalAvg = mTotalProcessFrameTime / ++mFrameRecordedCount;
                   Log.d(LOG_TAG, "Avg frame process time: " + totalAvg + "ms");


               }
               Log.d(LOG_TAG, mFrameRecordedCount + " / " + mFrameToRecordCount);
               mRecycledFrameQueue.offer(recordedFrame);
           }
       }

       public void stopRunning() {
           super.stopRunning();
           if (getState() == WAITING) {
               interrupt();
           }
       }
    }
    </string>

    The fact is that when recording video no lags(freezes) are not noticeable. After recording the video, when you look carefully, the lags are noticeable, and if you move the phone quickly when recording, then after the recording you can see the freezes, as if you have glued several GIFs.

    I tried everything I could : the frame rate changed for 30, 60, 100. I changed the Video quality, pixelFormat (although I do not know why) and many things that

    I did not understand. But still no use. Maybe there is someone who understands. Tell me how to correct these distortions(freezes) ?

    UPD : LogCat :

    > 12-13 08:51:21.987 2968-2968/io.dev.videosample
    > D/FFmpegRecordActivity: Preview frame interval: 98ms
    > 12-13 08:51:22.056 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 69ms
    > 12-13 08:51:22.137 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 81ms
    >12-13 08:51:22.205 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 68ms
    >12-13 08:51:22.254 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 49ms
    >12-13 08:51:22.305 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 51ms
    >12-13 08:51:22.336 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 31ms
    >12-13 08:51:22.454 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 118ms
    >12-13 08:51:22.494 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 40ms
    >12-13 08:51:22.585 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 91ms
    >12-13 08:51:22.634 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 49ms
    >12-13 08:51:22.720 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 86ms
    >12-13 08:51:22.783 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 63ms
    >12-13 08:51:22.835 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 52ms
    >12-13 08:51:22.903 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 67ms
    >12-13 08:51:22.983 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 81ms
    >12-13 08:51:23.070 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 87ms
    >12-13 08:51:23.149 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 78ms
    >12-13 08:51:23.234 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 86ms
    >12-13 08:51:23.312 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 78ms
    >12-13 08:51:23.395 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 83ms
    >12-13 08:51:23.472 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 77ms
    >12-13 08:51:23.540 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 67ms
    >12-13 08:51:23.627 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 88ms
    >12-13 08:51:23.660 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 33ms
    >12-13 08:51:23.727 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 67ms
    >12-13 08:51:23.792 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 65ms
    >12-13 08:51:23.874 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 82ms
    >12-13 08:51:23.942 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 68ms
    >12-13 08:51:23.995 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 53ms
    >12-13 08:51:24.090 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 95ms
    >12-13 08:51:24.139 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 49ms
    >12-13 08:51:24.224 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 85ms
    >12-13 08:51:24.272 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 48ms
    >12-13 08:51:24.307 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 35ms
    >12-13 08:51:24.371 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 64ms
    >12-13 08:51:24.437 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 66ms
    >12-13 08:51:24.521 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 84ms
    >12-13 08:51:24.587 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 66ms
    >12-13 08:51:24.636 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 49ms
    >12-13 08:51:24.719 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 83ms
    >12-13 08:51:24.808 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 89ms
    >12-13 08:51:24.869 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 61ms
    >12-13 08:51:24.905 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 36ms
    >12-13 08:51:24.952 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 46ms
    >12-13 08:51:25.017 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 66ms
    >12-13 08:51:25.068 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 51ms
    >12-13 08:51:25.102 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 34ms
    >12-13 08:51:25.204 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 102ms
    >12-13 08:51:25.299 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 95ms
    >12-13 08:51:25.413 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 114ms
    >12-13 08:51:25.481 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 68ms
    >12-13 08:51:25.563 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 82ms
    >12-13 08:51:25.630 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 67ms
    >12-13 08:51:25.712 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 82ms
    >12-13 08:51:25.761 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 49ms
    >12-13 08:51:25.844 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 83ms
    >12-13 08:51:25.862 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 18ms
    >12-13 08:51:25.910 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 48ms
    >12-13 08:51:25.946 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 36ms
    >12-13 08:51:26.033 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 87ms
    >12-13 08:51:26.126 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 93ms
    >12-13 08:51:26.192 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 66ms
    >12-13 08:51:26.225 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 33ms
    >12-13 08:51:26.275 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 50ms
    >12-13 08:51:26.357 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 82ms
    >12-13 08:51:26.440 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 83ms
    >12-13 08:51:26.522 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 82ms
    >12-13 08:51:26.589 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 67ms
    >12-13 08:51:26.640 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 50ms
    >12-13 08:51:26.721 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 82ms
    >12-13 08:51:26.826 2968-2968/io.dev.videosample D/FFmpegRecordActivity: Preview frame interval: 105ms
    >12-13 08:51:28.408 1976-4266/? E/VDO_LOG: u4FrameTsInterval value is 0x411a, u4FrameTimingInfo 0xf000
    >12-13 08:51:28.421 1976-4266/? E/MtkOmxVdecEx: [0xb872bb60] ERROR: query VDEC_DRV_GET_TYPE_GET_FRAME_INTERVAL failed