Recherche avancée

Médias (0)

Mot : - Tags -/diogene

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

Autres articles (57)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • Soumettre bugs et patchs

    10 avril 2011

    Un logiciel n’est malheureusement jamais parfait...
    Si vous pensez avoir mis la main sur un bug, reportez le dans notre système de tickets en prenant bien soin de nous remonter certaines informations pertinentes : le type de navigateur et sa version exacte avec lequel vous avez l’anomalie ; une explication la plus précise possible du problème rencontré ; si possibles les étapes pour reproduire le problème ; un lien vers le site / la page en question ;
    Si vous pensez avoir résolu vous même le bug (...)

Sur d’autres sites (9109)

  • FFmpeg, access violation on av_frame_free when running though Unity

    27 octobre 2016, par Mockarutan

    I’m working on a video recording plugin for Unity using ffmpeg. I’m new to the video encoding domain and just got my code to work today. But I think a might have a few memory leaks and trying to fix them crashes Unity.

    The plugin is written i c++ (as external "C" code) and imported in a c# script in unity with a simple DllImport. Again, this is not my comfort area either, but it works.

    When a screen buffer is rendered, I put in a RGB24 buffer and send it to my c++ function, this one :

    int encode_frame(uint8_t* rgb24Data)
    {
       AVFrame *frame = av_frame_alloc();
       if (!frame)
           return COULD_NOT_ALLOCATE_FRAME;

       frame->format = codec_context->pix_fmt;
       frame->width = codec_context->width;
       frame->height = codec_context->height;

       int ret = av_image_alloc(frame->data, frame->linesize, codec_context->width, codec_context->height, codec_context->pix_fmt, 32);
       if (ret < 0)
           return COULD_NOT_ALLOCATE_PIC_BUF;

       SwsContext * ctx = sws_getContext(codec_context->width, codec_context->height,
           AV_PIX_FMT_RGB24, codec_context->width, codec_context->height,
           AV_PIX_FMT_YUV420P, 0, 0, 0, 0);


       uint8_t * inData[1] = { rgb24Data };
       int inLinesize[1] = { 3 * codec_context->width };

       sws_scale(ctx, inData, inLinesize, 0, codec_context->height, frame->data, frame->linesize); // From RGB to YUV

       frame->pts = frame_counter++;

       ret = avcodec_send_frame(codec_context, frame);
       if (ret < 0)
           return ERROR_ENCODING_FRAME_SEND;

       AVPacket pkt;
       av_init_packet(&pkt);
       pkt.data = NULL;
       pkt.size = 0;

       while (true)
       {
           ret = avcodec_receive_packet(codec_context, &pkt);
           if (!ret)
           {
               if (pkt.pts != AV_NOPTS_VALUE)
                   pkt.pts = av_rescale_q(pkt.pts, codec_context->time_base, video_st->time_base);
               if (pkt.dts != AV_NOPTS_VALUE)
                   pkt.dts = av_rescale_q(pkt.dts, codec_context->time_base, video_st->time_base);

               av_write_frame(outctx, &pkt);
               av_packet_unref(&pkt);
           }
           else if (ret == AVERROR(EAGAIN))
           {
               frame->pts = frame_counter++;
               ret = avcodec_send_frame(codec_context, frame);
               if (ret < 0)
                   return ERROR_ENCODING_FRAME_SEND;
           }
           else if (ret < 0)
               return ERROR_ENCODING_FRAME_RECEIVE;
           else
               break;
       }

       // This one
       av_frame_free(&frame);
    }

    Now, this code might have a lot of issues that I’m not aware of, and you are free to point them out if you like. But the line that gives me error is av_frame_free(&frame);.

    If I run this in a synthetic test app in c++ that I made, it works. I can even run it in a c# synthetic test app (exactly like the c++ one), and it works. But if I run it though Unity, it crashes on the first frame. The log says "Read from location fe7f8097 caused an access violation.".

    I have tried with av_freep() and av_free(). Not sure exactly what makes them different (different example codes use different ones), but none work.

    So, what I’m I missing ? The frame is leaking if I don’t free it right ? But why does it crash in Unity ?

    The whole thing works great in Unity if I don’t have the av_frame_free(&frame);. Resulting video looks great !

    PS. I’m aware (as far as I know) that the frame also leaks if something fails and returns an error code. But one thing at a time.

  • Specifying FFMPEG in the requirements section of 'buildozer.spec' causing [libavformat/network.o] Error 1

    18 juillet 2022, par GJ78

    My question relates to how to mitigate an ffmpeg requirement listed in a buildozer.spec that is causing compile errors using buildozer.

    



    GOAL :

    



    Using buildozer to ensure FFMPEG can be embedded within a small Kivy app so i can utilise youtube_dl functionality on my android phone.

    



    THE ISSUE :
Specifying FFMPEG in the requirements section of 'buildozer.spec' causes the following error message :
    
common.mak:60 : recipe for target 'libavformat/network.o' failed
    
make : [libavformat/network.o] Error 1
    
make : Waiting for unfinished jobs...

    



    What have I done to resolve myself :
    
1. Ensured LOG LEVEL 2 is specified.

    



      

    1. Upgraded cython from Version 21 to 27. Then downgraded to 25, then 21 then 20 to see if this resolved anything. It didn't.

    2. 


    3. In BUILDOZER.SPEC, switched between Android NDK crystax-ndk-10.3.2 and android-ndk-r16b. (Note have reverted back to Crystax 10.3.2) in my NDK PATH.

    4. 


    5. In BUILDOZER.SPEC, changed android.api from 19 to 15 (just to see if this has any positive effects).

    6. 


    7. executed : rm -Rf .buildozer between each compiling attempt.

    8. 


    9. Part extract of Buildozer.log :

      



      In file included from libavformat/dump.c:37:0 :
      
libavformat/avformat.h:893:21 : note : declared here
      
 AVCodecContext codec ;
 ^
      
CC libavformat/format.o
      
CC libavformat/golomb_tab.o
      
CC libavformat/h264dec.o
      
CC libavformat/hevc.o
      
CC libavformat/http.o
      
CC libavformat/httpauth.o
      
CC libavformat/id3v1.o
      
CC libavformat/id3v2.o
      
CC libavformat/img2.o
      
CC libavformat/isom.o
      
CC libavformat/log2_tab.o
      
CC libavformat/m4vdec.o
      
CC libavformat/metadata.o
CC libavformat/mov_chan.o
      
CC libavformat/mov.o
      
CC libavformat/movenc.o
      
CC libavformat/movenccenc.o
      
CC libavformat/movenchint.o
      
CC libavformat/mpegvideodec.o
      
CC libavformat/mux.o
      
CC libavformat/network.o
      
In file included from libavformat/network.h:29:0,
      
 from libavformat/network.c:22 :
      
libavformat/os_support.h:67:32 : error : expected declaration specifiers or '...' before '(' token
      
 # define lseek(f,p,w) lseek64((f), (p), (w))
      
 ^
libavformat/os_support.h:67:37 : error : expected declaration specifiers or '...' before '(' token
      
 # define lseek(f,p,w) lseek64((f), (p), (w))
      
 ^
libavformat/os_support.h:67:42 : error : expected declaration specifiers or '...' before '(' token
      
 # define lseek(f,p,w) lseek64((f), (p), (w))
      
 ^
common.mak:60 : recipe for target 'libavformat/network.o' failed
      
make :
      [libavformat/network.o] Error 1
      
make : * Waiting for unfinished jobs....

    10. 


    11. Part extract of Buildozer.spec

      



      (str) Title of your application

      



      title = myapplication

      



      (str) Package name

      



      package.name = myapp

      



      (str) Package domain (needed for android/ios packaging)

      



      package.domain = org.test

      



      (str) Source code where the main.py live

      



      source.dir = .

      



      (list) Source files to include (let empty to include all the files)

      



      source.include_exts = py,png,jpg,kv,atlas

      



      (list) List of inclusions using pattern matching

      



      source.include_patterns = assets/,images/.png

      



      (list) Source files to exclude (let empty to not exclude anything)

      



      source.exclude_exts = spec

      



      (list) List of directory to exclude (let empty to not exclude anything)

      



      source.exclude_dirs = tests, bin

      



      (list) List of exclusions using pattern matching

      



      source.exclude_patterns = license,images//.jpg

      



      (str) Application versioning (method 1)

      



      version = 0.1

      



      (str) Application versioning (method 2)

      



      version.regex = version = '"['"]

      



      version.filename = %(source.dir)s/main.py

      



      (list) Application requirements

      



      comma seperated e.g. requirements = sqlite3,kivy

      



      requirements = ffmpeg,python2,hostpython2,kivy,youtube-dl

      



      (str) Custom source folders for requirements

      



      Sets custom source for any requirements with recipes

      



      requirements.source.kivy = ../../kivy

      



      (list) Garden requirements

      



      garden_requirements =

      



      (str) Presplash of the application

      



      presplash.filename = %(source.dir)s/data/presplash.png

      



      (str) Icon of the application

      



      icon.filename = %(source.dir)s/data/icon.png

      



      (str) Supported orientation (one of landscape, portrait or all)

      



      orientation = portrait

      



      (list) List of service to declare

      



      services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY

      



      OSX Specific

      



      author = © Copyright Info

      



      change the major version of python used by the app

      



      osx.python_version = 3

      



      Kivy version to use

      



      osx.kivy_version = 1.9.1

      



      Android specific

      



      (bool) Indicate if the application should be fullscreen or not

      



      fullscreen = 0

      



      (string) Presplash background color (for new android toolchain)

      



      Supported formats are : #RRGGBB #AARRGGBB or one of the following names :

      



      red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray,

      



      darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy,

      



      olive, purple, silver, teal.

      



      android.presplash_color = #FFFFFF

      



      (list) Permissions

      



      android.permissions = INTERNET

      



      (int) Android API to use

      



      android.api = 19

      



      (int) Minimum API required

      



      android.minapi = 9

      



      (int) Android SDK version to use

      



      android.sdk = 20

      



      (str) Android NDK version to use

      



      android.ndk = 10.3.2

      



      (bool) Use —private data storage (True) or —dir public storage (False)

      



      android.private_storage = True

      



      (str) Android NDK directory (if empty, it will be automatically downloaded.)

      



      android.ndk_path = /home/gjones/Downloads/crystax-ndk-10.3.2

      



      (str) Android SDK directory (if empty, it will be automatically downloaded.)

      



      android.sdk_path =

      



      (str) ANT directory (if empty, it will be automatically downloaded.)

      



      android.ant_path =

    12. 


    13. Lastly, when I remove ffmpeg from requirements in buildozer.spec, the .APK compiles successfully and i can deploy it on to my phone with the KIVY GUI. Obviously, ffmpeg functionality is not present.

    14. 


    



    Current Environment Specs :

    



      

    1. Running Linux Mint 17.2 as a Virtual Box VM
    2. 


    3. Buildozer Version : 0.35dev
    4. 


    5. Cython Version : 0.25
    6. 


    



    Any advice would be greatly appreciated.

    



    Lastly, if there is no obvious solution via buildozer, do i need to compile ffmpeg for Android separately and somehow include this somewhere in the buildozer spec file to prevent this error message ?

    



    Thanks in advance.

    


  • Sending periodic metadata in fragmented live MP4 stream ?

    20 septembre 2022, par El Sampsa

    As suggested by the topic, I'm wondering if it's possible to send metadata about the stream contents periodically in a fragmented MP4 live stream.

    



    I'm using the following command (1) to get fragmented MP4 :

    



    ffmpeg -i rtsp://admin:12345@192.168.0.157 -c:v copy -an -movflags empty_moov+omit_tfhd_offset+frag_keyframe+default_base_moof -f mp4 ...


    



    My main program reads the fragments from this command from either stdout or from a (unix domain) socket and gets :

    



    ftyp
moov
moof
mdat
moof
mdat
moof
mdat 
...


    



    So, the first fragments I get are ftyp and moov which are metadata and describe the stream contents.

    



    Now a client program connects at a later time to the main program. The problem is, that at that point, the ftype and moov fragments are long gone.

    



    Is there a way (=ffmpeg command option) to make this work similar to MPEGTS (aka mpeg transport stream), and resend metadata periodically with the stream ? Like this :

    



    ftyp
moov
moof
mdat
moof
mdat
moof
mdat 
ftyp
moov
moof
mdat
moof
mdat
moof
mdat 
...


    



    .. or is my only option to cache the ftyp and moov packets in my main program and re-send them to the client program when it requests the stream ?

    



    A related link : What exactly is Fragmented mp4(fMP4) ? How is it different from normal mp4 ?

    



    Caching and resending ftyp and moov each time a new client connects is not that straightforward either .. as it somehow brokes the stream (at least the browser MSE extensions don't like such a stream). There seems to be lots of sequence numbers and stuff in the moof packets that should be modified. (+)

    



    Another option is to pass the stream through another FFmpeg process that does the remuxing (and corrects moof packets). Things are further complicated by the fact that command (1) does not give cleanly-separated ftyp, moov, moof, etc. packets.

    



    Any thoughts / solutions appreciated.

    



    EDIT : regarding (+), MSE seems to have problems playing fragmented MP4 with gaps : https://bugs.chromium.org/p/chromium/issues/detail?id=516114