Recherche avancée

Médias (0)

Mot : - Tags -/flash

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

Autres articles (79)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (13104)

  • Android : FFMpeg (video creation) crashes with no exception when loading binaries in lower APIs (18 in my case) but works in newer ones

    6 mai 2019, par Diego Perez

    I have an app that uses FFMpeg for video creation (these next lines are the relevant build.gradle plugin files) :

    //writingminds
    api 'com.writingminds:FFmpegAndroid:0.3.2'
    //JavaCV video
    api group: 'org.bytedeco', name: 'javacv', version: '1.4.4'
    api group: 'org.bytedeco.javacpp-presets', name: 'opencv', version: '4.0.1-1.4.4', classifier: 'android-arm'
    api group: 'org.bytedeco.javacpp-presets', name: 'ffmpeg', version: '4.1-1.4.4', classifier: 'android-arm'

    And my app is working (and creating video) just fine in my phone with a newer Android 8 version but I’m having weird problems in my old API 18 tablet (where, as a note, I had to install multidex).

    These next lines are the main part of FFMpeg video creation, where binaries are loaded, and, in fact, binaries load are where app crashes in my tablet in the line "ffmpeg.loadBinary(new LoadBinaryResponseHandler()..."

    As you can see, I have a try/catch where the app crashes, but it crashes with no aparent exception, as catch blocks are never hit.

    public static String recordVideo(JSONObject objJSON) {

       String strReturn = Enum.Result.OK;

       try {
           fileName = objJSON.has("file_name") ? String.valueOf(objJSON.getString("file_name")) : "";
           videoPath = objJSON.has("video_path") ? String.valueOf(objJSON.getString("video_path")) : "";
       } catch (JSONException e) {
           ExceptionHandler.logException(e);
       }

       FFmpeg ffmpeg = FFmpeg.getInstance(ApplicationContext.get());
       try {
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {}

               @Override
               public void onFailure() {}

               @Override
               public void onSuccess() {}

               @Override
               public void onFinish() {}
           });
       } catch (FFmpegNotSupportedException e) {
           // Handle if FFmpeg is not supported by device
       } catch (Exception e) {

       }
    ...

    These next lines are the relevant part of the LogCat, but I cannot figure out where the problem resides, maybe an out of memory problem ?

    Any help will be much appreciated.

    04-28 21:44:45.873 13743-13964/com.artandwords.thoughtoftheday A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 13964 (AsyncTask #4)
    04-28 21:44:45.973 144-144/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    04-28 21:44:45.983 144-144/? I/DEBUG: Build fingerprint: 'asus/WW_epad/ME302C:4.3/JSS15Q/WW_epad-V5.0.21-20140701:user/release-keys'
    04-28 21:44:45.983 144-144/? I/DEBUG: Revision: '0'
    04-28 21:44:45.983 144-144/? I/DEBUG: pid: 13743, tid: 13964, name: AsyncTask #4  >>> com.artandwords.thoughtoftheday <<<
    04-28 21:44:45.983 144-144/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
    04-28 21:44:46.003 144-144/? I/DEBUG:     eax 00000000  ebx 000000c6  ecx 00000000  edx 00000000
    04-28 21:44:46.003 144-144/? I/DEBUG:     esi 00000e59  edi 00000000
    04-28 21:44:46.003 144-144/? I/DEBUG:     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000043  xss 0000007b
    04-28 21:44:46.003 144-144/? I/DEBUG:     eip 784ed378  ebp 2200ff0c  esp 2200fec4  flags 00210246
    04-28 21:44:46.003 144-144/? I/DEBUG: backtrace:
    04-28 21:44:46.003 144-144/? I/DEBUG:     #00  pc 00087378  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.003 144-144/? I/DEBUG:     #01  pc 00085d0e  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.003 144-144/? I/DEBUG:     #02  pc 00073328  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.003 144-144/? I/DEBUG:     #03  pc 0006f7ff  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.003 144-144/? I/DEBUG:     #04  pc 0006f3bf  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.003 144-144/? I/DEBUG:     #05  pc 000b92de  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.003 144-144/? I/DEBUG:     #06  pc ffffffff  <unknown>
    04-28 21:44:46.003 144-144/? I/DEBUG:     #07  pc 001445aa  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.013 144-144/? I/DEBUG: stack:
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436850  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436854  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436858  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b43685c  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436860  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436864  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436868  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b43686c  3822676c  /system/lib/arm/libc.so
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436870  7b436a98  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436874  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436878  7b4368c8  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b43687c  7b436a98  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436880  383003a0  /system/lib/arm/libdl.so
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436884  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436888  7b4368c8  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b43688c  785aa5ab  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.013 144-144/? I/DEBUG:     #07  7b436890  7b4368a0  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436894  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b436898  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b43689c  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368a0  7b4368c8  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368a4  7b436890  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368a8  785aa59d  /system/lib/libhoudini.so.3.4.7.44914
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368ac  7b436a98  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368b0  7b437930  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368b4  220001d0  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368b8  7b436a70  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368bc  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368c0  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368c4  00000000  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368c8  7b436a88  
    04-28 21:44:46.013 144-144/? I/DEBUG:          7b4368cc  785f3141  /system/lib/libhoudini.so.3.4.7.44914


       --------- beginning of /dev/log/system
    04-28 21:44:46.063 450-470/? I/BootReceiver: Copying /data/tombstones/tombstone_03 to DropBox (SYSTEM_TOMBSTONE)
    04-28 21:44:46.063 450-13973/? W/ActivityManager:   Force finishing activity com.artandwords.thoughtoftheday/.activities.DisplayThoughtActivity
    04-28 21:44:46.073 145-862/? E/IMGSRV: :0: PVRDRMOpen: TP3, ret = 75
    04-28 21:44:46.093 450-13973/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!!
    04-28 21:44:46.093 450-483/? W/InputDispatcher: channel '21edd9e8 com.artandwords.thoughtoftheday/com.artandwords.thoughtoftheday.activities.main.MainActivity (server)' ~ Consumer closed input channel or an error occurred.  events=0x9
    04-28 21:44:46.093 450-483/? E/InputDispatcher: channel '21edd9e8 com.artandwords.thoughtoftheday/com.artandwords.thoughtoftheday.activities.main.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
    04-28 21:44:46.093 155-13945/? W/TimedEventQueue: Event 25 was not found in the queue, already cancelled?
    04-28 21:44:46.093 155-3134/? W/AudioFlinger: session id 324 not found for pid 155
    04-28 21:44:46.103 450-450/? W/InputDispatcher: Attempted to unregister already unregistered input channel '21edd9e8 com.artandwords.thoughtoftheday/com.artandwords.thoughtoftheday.activities.main.MainActivity (server)'
    04-28 21:44:46.103 450-755/? I/WindowState: WIN DEATH: Window{21b33a28 u0 com.artandwords.thoughtoftheday/com.artandwords.thoughtoftheday.activities.DisplayThoughtActivity}
    04-28 21:44:46.103 450-13973/? W/ActivityManager: Exception thrown during pause
       android.os.TransactionTooLargeException
           at android.os.BinderProxy.transact(Native Method)
           at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:642)
           at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1007)
           at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3905)
           at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3837)
           at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:8588)
           at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:8465)
           at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:9170)
           at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:8699)
           at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
    04-28 21:44:46.103 450-450/? I/WindowState: WIN DEATH: Window{21edd9e8 u0 com.artandwords.thoughtoftheday/com.artandwords.thoughtoftheday.activities.main.MainActivity}
    04-28 21:44:46.103 450-636/? I/WindowState: WIN DEATH: Window{21be0690 u0 com.artandwords.thoughtoftheday/com.artandwords.thoughtoftheday.activities.DisplayThoughtActivity}
    04-28 21:44:46.113 450-13973/? I/WindowManager: computeScreenConfigurationLocked() Enter {1.15 ?mcc?mnc ?locale ?layoutDir ?swdp ?wdp ?hdp ?density ?lsize ?long ?orien ?uimode ?night ?touch ?keyb/?/? ?nav/?}
    04-28 21:44:46.113 450-13973/? I/WindowManager: dw=1200, dh=1920
    04-28 21:44:46.113 450-13973/? I/WindowManager: appWidth=1200, appHeight=1848
    04-28 21:44:46.113 450-13973/? I/WindowManager: tempdm=DisplayMetrics{density=1.5, width=1200, height=1848, scaledDensity=1.5, xdpi=221.201, ydpi=220.591}
    04-28 21:44:46.113 450-13973/? I/WindowManager: dm=DisplayMetrics{density=1.5, width=1200, height=1848, scaledDensity=1.5, xdpi=221.201, ydpi=220.591}, ro.product.device=ME302C
    04-28 21:44:46.113 450-13973/? I/WindowManager: getConfigDisplayWidth=1200, getConfigDisplayHeight=1810
    04-28 21:44:46.113 450-13973/? I/WindowManager: screenWidthDp=800, screenHeightDp=1206
    04-28 21:44:46.113 450-13973/? I/WindowManager: computeScreenConfigurationLocked() Leave {1.15 ?mcc?mnc ?locale ?layoutDir sw800dp w800dp h1206dp 240dpi xlrg port ?uimode ?night finger -keyb/v/h -nav/h}
    04-28 21:44:46.113 450-13973/? I/ActivityManager: Restarting because process died: ActivityRecord{21ab1f80 u0 com.artandwords.thoughtoftheday/.activities.main.MainActivity}
    04-28 21:44:46.113 450-13973/? W/ActivityManager: Exception when starting activity com.artandwords.thoughtoftheday/.activities.main.MainActivity
       android.os.DeadObjectException
           at android.os.BinderProxy.transact(Native Method)
           at android.app.ApplicationThreadProxy.scheduleLaunchActivity(ApplicationThreadNative.java:730)
           at com.android.server.am.ActivityStack.realStartActivityLocked(ActivityStack.java:733)
           at com.android.server.am.ActivityStack.startSpecificActivityLocked(ActivityStack.java:840)
           at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1790)
           at com.android.server.am.ActivityStack.resumeTopActivityLocked(ActivityStack.java:1449)
           at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1058)
           at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3905)
           at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3837)
           at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:8588)
           at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:8465)
           at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:9170)
           at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:8699)
           at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)
    04-28 21:44:46.123 450-13973/? W/ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.startService:1396 com.android.server.am.ActivityStack.sendActivityBroadcastLocked:4923 com.android.server.am.ActivityStack.removeActivityFromHistoryLocked:4089 com.android.server.am.ActivityStack.removeHistoryRecordsForAppLocked:4346 com.android.server.am.ActivityManagerService.handleAppDiedLocked:3163
    04-28 21:44:46.123 450-13973/? I/ActivityManager: Start proc com.artandwords.thoughtoftheday for activity com.artandwords.thoughtoftheday/.activities.main.MainActivity: pid=13975
    </unknown>

    Edit 1 :

    Still investigating and entered FFmpeg.java to the method loadBinary while debugging, which code I’ll paste below and the line making the crash is switch (CpuArchHelper.getCpuArch())

    @Override
    public void loadBinary(FFmpegLoadBinaryResponseHandler ffmpegLoadBinaryResponseHandler) throws FFmpegNotSupportedException {
       String cpuArchNameFromAssets = null;
       switch (CpuArchHelper.getCpuArch()) {
           case x86:
               Log.i("Loading FFmpeg for x86 CPU");
               cpuArchNameFromAssets = "x86";
               break;
           case ARMv7:
               Log.i("Loading FFmpeg for armv7 CPU");
               cpuArchNameFromAssets = "armeabi-v7a";
               break;
           case NONE:
               throw new FFmpegNotSupportedException("Device not supported");
       }

       if (!TextUtils.isEmpty(cpuArchNameFromAssets)) {
           ffmpegLoadLibraryAsyncTask = new FFmpegLoadLibraryAsyncTask(context, cpuArchNameFromAssets, ffmpegLoadBinaryResponseHandler);
           ffmpegLoadLibraryAsyncTask.execute();
       } else {
           throw new FFmpegNotSupportedException("Device not supported");
       }
    }

    I’ll keep on investigating...

    Edit 2 :

    Further debugging has just lead me to the exact line where app crashes, and it’s CpuArchHelper.java from FFmpeg library :

    The line causing the crash is the next :

    String archInfo = cpuNativeArchHelper.cpuArchFromJNI();

    and I cannot even go inside cpuArchFromJNI() with F7 as it just crashes.

    package com.github.hiteshsondhi88.libffmpeg;

    import android.os.Build;

    class CpuArchHelper {

       static CpuArch getCpuArch() {
           Log.d("Build.CPU_ABI : " + Build.CPU_ABI);
           // check if device is x86 or x86_64
           if (Build.CPU_ABI.equals(getx86CpuAbi()) || Build.CPU_ABI.equals(getx86_64CpuAbi())) {
               return CpuArch.x86;
           } else {
               // check if device is armeabi
               if (Build.CPU_ABI.equals(getArmeabiv7CpuAbi())) {
                   ArmArchHelper cpuNativeArchHelper = new ArmArchHelper();
                   String archInfo = cpuNativeArchHelper.cpuArchFromJNI();
                   // check if device is arm v7
                   if (cpuNativeArchHelper.isARM_v7_CPU(archInfo)) {
                       // check if device is neon
                       return CpuArch.ARMv7;
                   }
                   // check if device is arm64 which is supported by ARMV7
               } else if (Build.CPU_ABI.equals(getArm64CpuAbi())) {
                   return CpuArch.ARMv7;
               }
           }
           return CpuArch.NONE;
       }

       static String getx86CpuAbi() {
           return "x86";
       }

       static String getx86_64CpuAbi() {
           return "x86_64";
       }

       static String getArm64CpuAbi() {
           return "arm64-v8a";
       }

       static String getArmeabiv7CpuAbi() {
           return "armeabi-v7a";
       }
    }

    This is ArmArchHelper.java class :

    package com.github.hiteshsondhi88.libffmpeg;

    class ArmArchHelper {
       static {
           System.loadLibrary("ARM_ARCH");
       }

       native String cpuArchFromJNI();

       boolean isARM_v7_CPU(String cpuInfoString) {
           return cpuInfoString.contains("v7");
       }

       boolean isNeonSupported(String cpuInfoString) {
           // check cpu arch for loading correct ffmpeg lib
           return cpuInfoString.contains("-neon");
       }

    }

    Edit 3 :

    Reading carefully LogCat I’ve noticed there is a TransactionTooLarge Exception :

    04-28 21:44:46.103 450-13973/? W/ActivityManager: Exception thrown during pause
       android.os.TransactionTooLargeException
           at android.os.BinderProxy.transact(Native Method)
           at android.app.ApplicationThreadProxy.schedulePauseActivity(ApplicationThreadNative.java:642)
           at com.android.server.am.ActivityStack.startPausingLocked(ActivityStack.java:1007)
           at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3905)
           at com.android.server.am.ActivityStack.finishActivityLocked(ActivityStack.java:3837)
           at com.android.server.am.ActivityManagerService.handleAppCrashLocked(ActivityManagerService.java:8588)
           at com.android.server.am.ActivityManagerService.makeAppCrashingLocked(ActivityManagerService.java:8465)
           at com.android.server.am.ActivityManagerService.crashApplication(ActivityManagerService.java:9170)
           at com.android.server.am.ActivityManagerService.handleApplicationCrashInner(ActivityManagerService.java:8699)
           at com.android.server.am.NativeCrashListener$NativeCrashReporter.run(NativeCrashListener.java:86)

    Maybe this is what makes my app to crash, but I don’t know what to do with that, as it happens inside the FFMpeg library :s

    Edit 3 :

    As a note, I’ve tried in an old Android 4.2.2 (API 17) phone I also own and it’s working just fine, the video is generated without crashing.

  • Anomalie #4360 (Nouveau) : Message d’erreur au début de l’installation d’un site web SPIP par spip...

    13 juillet 2019, par Vincent ROBERT

    Sur Xampp avec Apache 2.4.39 (Win64) & PHP 7.2.19
    En initiant une nouvelle installation avec spiploader, j’ai le message d’erreur suivant :

    "Warning : Use of undefined constant _DIR_TMP - assumed ’_DIR_TMP’ (this will throw an Error in a future version of PHP) in C :\xampp\htdocs\news-test\pclzip.php on line 28"

    Ce message apparaît juste avant le début de l’installation, sur la page "Téléchargement de SPIP - !Le programme va télécharger les fichiers de SPIP à l’intérieur de ce répertoire."

  • ffmpeg in C# (ScrCpy)

    23 janvier 2020, par RunicSheep

    I’m trying to access the screen of my android device like ScrCpy does (https://github.com/Genymobile/scrcpy) but in C#.
    What I’ve done so far is pushing the jar (server) to my device and receiving the input. (Device resolution etc.)
    But I can’t re implement the decoding process in c#, there has to be some sort of error so far.
    C# library used for ffmpeg is ffmpeg.AutoGen (https://github.com/Ruslan-B/FFmpeg.AutoGen)

    Here’s the decoding code :

       using System;
    using System.Drawing;
    using System.Drawing.Imaging;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Net.Sockets;
    using System.Runtime.InteropServices;
    using System.Runtime.InteropServices.ComTypes;
    using System.Threading;
    using FFmpeg.AutoGen;

    namespace Source.Android.Scrcpy
    {
       public unsafe class Decoder
       {
           private const string LD_LIBRARY_PATH = "LD_LIBRARY_PATH";

           private AVFrame* _decodingFrame;
           private AVCodec* _codec;
           private AVCodecContext* _codec_ctx;
           private AVFormatContext* _format_ctx;

           public Decoder()
           {
               RegisterFFmpegBinaries();
               SetupLogging();

               this.InitFormatContext();
           }

           private void InitFormatContext()
           {
               _decodingFrame = ffmpeg.av_frame_alloc();
               _codec = ffmpeg.avcodec_find_decoder(AVCodecID.AV_CODEC_ID_H264);
               if (_codec== null)
               {
                   throw new Exception("H.264 decoder not found");// run_end;
               }

               _codec_ctx = ffmpeg.avcodec_alloc_context3(_codec);
               if (_codec_ctx == null)
               {
                   throw new Exception("Could not allocate decoder context"); //run_end
               }

               if (ffmpeg.avcodec_open2(_codec_ctx, _codec, null) &lt; 0)
               {
                   throw new Exception("Could not open H.264 codec");// run_finally_free_codec_ctx
               }

               _format_ctx = ffmpeg.avformat_alloc_context();
               if (_format_ctx == null)
               {
                   throw new Exception("Could not allocate format context");// run_finally_close_codec;
               }
           }

           private void RegisterFFmpegBinaries()
           {
               switch (Environment.OSVersion.Platform)
               {
                   case PlatformID.Win32NT:
                   case PlatformID.Win32S:
                   case PlatformID.Win32Windows:
                       var current = Environment.CurrentDirectory;
                       var probe = Path.Combine("FFmpeg", Environment.Is64BitProcess ? "x64" : "x86");
                       while (current != null)
                       {
                           var ffmpegDirectory = Path.Combine(current, probe);
                           if (Directory.Exists(ffmpegDirectory))
                           {
                               Console.WriteLine($"FFmpeg binaries found in: {ffmpegDirectory}");
                               RegisterLibrariesSearchPath(ffmpegDirectory);
                               return;
                           }
                           current = Directory.GetParent(current)?.FullName;
                       }
                       break;
                   case PlatformID.Unix:
                   case PlatformID.MacOSX:
                       var libraryPath = Environment.GetEnvironmentVariable(LD_LIBRARY_PATH);
                       RegisterLibrariesSearchPath(libraryPath);
                       break;
               }
           }
           private static void RegisterLibrariesSearchPath(string path)
           {
               switch (Environment.OSVersion.Platform)
               {
                   case PlatformID.Win32NT:
                   case PlatformID.Win32S:
                   case PlatformID.Win32Windows:
                       SetDllDirectory(path);
                       break;
                   case PlatformID.Unix:
                   case PlatformID.MacOSX:
                       string currentValue = Environment.GetEnvironmentVariable(LD_LIBRARY_PATH);
                       if (string.IsNullOrWhiteSpace(currentValue) == false &amp;&amp; currentValue.Contains(path) == false)
                       {
                           string newValue = currentValue + Path.PathSeparator + path;
                           Environment.SetEnvironmentVariable(LD_LIBRARY_PATH, newValue);
                       }
                       break;
               }
           }

           [DllImport("kernel32", SetLastError = true)]
           private static extern bool SetDllDirectory(string lpPathName);

           private AVPacket GetPacket()
           {
               var packet = ffmpeg.av_packet_alloc();
               ffmpeg.av_init_packet(packet);

               packet->data = null;
               packet->size = 0;

               return *packet;
           }

           private static int read_raw_packet(void* opaque, ushort* buffer, int bufSize)
           {
               var buffSize = 1024;
               var remaining = dt.Length - dtp - 1;
               var written = 0;
               for (var i = 0; i &lt; buffSize &amp;&amp; i+dtp &lt; dt.Length; i++)
               {
                   buffer[i] = dt[i+dtp];
                   written++;
               }

               dtp += written;

               if (written &lt;= 0)
               {
                   return ffmpeg.AVERROR_EOF;
               }

               return written;
           }

           [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
           public delegate int av_read_function_callback(void* opaque, ushort* endData, int bufSize);

           private static byte[] dt;
           private static int dtp;

           public Bitmap DecodeScrCpy(byte[] data)
           {
               if (data.Length == 0)
               {
                   return null;
               }

               byte* _buffer;
               ulong _bufferSize = 1024*2;
               _buffer = (byte*)ffmpeg.av_malloc(_bufferSize);
               if (_buffer == null)
               {
                   throw new Exception("Could not allocate buffer"); // run_finally_free_format_ctx;
               }

               fixed (byte* dataPtr = data)
               {
                   dt = data;
                   dtp = 0;
                   fixed (AVFormatContext** formatCtxPtr = &amp;_format_ctx)
                   {
                       var mReadCallbackFunc = new av_read_function_callback(read_raw_packet);
                       AVIOContext* avio_ctx = ffmpeg.avio_alloc_context(_buffer, (int)_bufferSize, 0, null, //TODO: IntPtr.Zero nutzen?
                           new avio_alloc_context_read_packet_func{Pointer = Marshal.GetFunctionPointerForDelegate(mReadCallbackFunc) },
                           null, null);
                       if (avio_ctx == null)
                       {
                           ffmpeg.av_free(dataPtr);
                           throw new Exception("Could not allocate avio context"); //goto run_finally_free_format_ctx;
                       }

                       _format_ctx->pb = avio_ctx;

                       if (ffmpeg.avformat_open_input(formatCtxPtr, null, null, null) &lt; 0)
                       {
                           throw new Exception("Could not open video stream"); // goto run_finally_free_avio_ctx;
                       }

                       var packet = GetPacket();

                       while (ffmpeg.av_read_frame(_format_ctx, &amp;packet) == 0)
                       {
                           if (ffmpeg.LIBAVDEVICE_VERSION_INT >= ffmpeg.AV_VERSION_INT(57, 37, 0))
                           {
                               int ret;
                               if ((ret = ffmpeg.avcodec_send_packet(_codec_ctx, &amp;packet)) &lt; 0)
                               {
                                   throw new Exception($"Could not send video packet: {ret}"); //goto run_quit
                               }

                               ret = ffmpeg.avcodec_receive_frame(_codec_ctx, _decodingFrame);
                               if (ret == 0)
                               {
                                   // a frame was received
                               }
                               else if (ret != ffmpeg.AVERROR(ffmpeg.EAGAIN))
                               {
                                   ffmpeg.av_packet_unref(&amp;packet);
                                   throw new Exception($"Could not receive video frame: {ret}"); //goto run_quit;
                               }
                           }
                       }
                   }
               }

               return null;
           }
       }
    }

    Entry is DecodeScrCpy with read data from network stream.
    Things I noticed :

    • read_raw_packet is called again after ffmpeg.AVERROR_EOF is returned
    • ffmpeg.avformat_open_input fails

    Question is, did I miss anything ?