Advanced search

Medias (1)

Tag: - Tags -/publishing

Other articles (94)

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

    5 September 2013, by

    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;

  • Ecrire une actualité

    21 June 2013, by

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Soumettre améliorations et plugins supplémentaires

    10 April 2011

    Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
    Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...)

On other websites (10478)

  • Fatal error detected by JRE: libavcodec involved

    16 November 2015, by hdf

    I’m experiencing this issue whenever I’m trying to run my java program. Could someone give me a clues on how to fix it?

    EDIT: the issue only occurs after a new environment has been set up.

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #
    #
    # JRE version: OpenJDK Runtime Environment (7.0_85-b01) (build 1.7.0_85-b01)
    # Java VM: OpenJDK 64-Bit Server VM (24.85-b03 mixed mode linux-amd64 compressed oops)
    # Derivative: IcedTea 2.6.1
    # Distribution: Ubuntu 14.04 LTS, package 7u85-2.6.1-5ubuntu0.14.04.1
    # Problematic frame:
    # C  [libavcodec.so.52.123.0+0x442060]
    #
    # Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    #
    # If you would like to submit a bug report, please include
    # instructions on how to reproduce the bug and visit:
    #   http://icedtea.classpath.org/bugzilla
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #

    ---------------  T H R E A D  ---------------

    Current thread (0x00007f8f70141800):  JavaThread "threadpool-14" daemon [_thread_in_native, id=14508, stack(0x00007f8fa73a0000,0x00007f8fa74a1000)]

    siginfo:si_signo=SIGSEGV: si_errno=0, si_code=128 (), si_addr=0x0000000000000000

    Registers:
    RAX=0x00007f8f701d2110, RBX=0x00007f8fa65030d0, RCX=0x00007f8fa688efd0, RDX=0x00007f8fa68904b0
    RSP=0x00007f8fa749f380, RBP=0x00007f8fa749f3d8, RSI=0x000000000000000c, RDI=0x00007f8f701d2110
    R8 =0x0000000000000000, R9 =0x0000000000000000, R10=0x00007f8fc5eb56e0, R11=0x00007f8fc591af50
    R12=0x0000000000000000, R13=0x00007f8f701419d8, R14=0x00007f8fa749f578, R15=0x00007f8f70141800
    RIP=0x00007f8fa688f060, EFLAGS=0x0000000000010202, CSGSFS=0x0000000000000033, ERR=0x0000000000000000
    TRAPNO=0x000000000000000d

    Top of Stack: (sp=0x00007f8fa749f380)
    0x00007f8fa749f380:   00007f8fa688f1a5 00007f8fa688ffe5
    0x00007f8fa749f390:   00007f8fa6890025 00007f8fa6890065
    0x00007f8fa749f3a0:   00007f8fa68900a5 00007f8fa68900e5
    0x00007f8fa749f3b0:   00007f8fa6890125 00007f8fa68904b5
    0x00007f8fa749f3c0:   00007f8fa6890678 00007f8fa7198f31
    0x00007f8fa749f3d0:   0000000000000000 00007f8f70158540
    0x00007f8fa749f3e0:   00007f8fa749f468 00007f8fa71966ae
    0x00007f8fa749f3f0:   0000000776cfa560 0000000776cfa560

    ...

    Instructions: (pc=0x00007f8fa688f060)
    0x00007f8fa688f040:   c4 e3 5d 0c c0 55 c5 e4 5c c8 c5 e4 58 c0 c5 fc
    0x00007f8fa688f050:   29 07 c5 fc 29 4f 20 c3 0f 1f 84 00 00 00 00 00
    0x00007f8fa688f060:   c5 fc 28 57 40 c5 fc 28 5f 60 c5 ec 5c fb c5 ec
    0x00007f8fa688f070:   58 d3 c5 c4 57 3d 26 e0 13 00 c5 ec c6 df be c5

    Register to memory mapping:

    RAX=0x00007f8f701d2110 is an unknown value
    RBX=0x00007f8fa65030d0: av_fft_calc+0 in /usr/local/lib/libavcodec.so.52.123.0 at 0x00007f8fa644d000
    RCX=0x00007f8fa688efd0: <offset 0x441fd0="0x441fd0"> in /usr/local/lib/libavcodec.so.52.123.0 at 0x00007f8fa644d000
    RDX=0x00007f8fa68904b0: <offset 0x4434b0="0x4434b0"> in /usr/local/lib/libavcodec.so.52.123.0 at 0x00007f8fa644d000
    RSP=0x00007f8fa749f380 is pointing into the stack for thread: 0x00007f8f70141800
    RBP=0x00007f8fa749f3d8 is pointing into the stack for thread: 0x00007f8f70141800
    RSI=0x000000000000000c is an unknown value
    RDI=0x00007f8f701d2110 is an unknown value
    R8 =0x0000000000000000 is an unknown value
    R9 =0x0000000000000000 is an unknown value
    R10=0x00007f8fc5eb56e0: <offset 0xe006e0="0xe006e0"> in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so at 0x00007f8fc50b5000
    R11=0x00007f8fc591af50: <offset 0x865f50="0x865f50"> in /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server/libjvm.so at 0x00007f8fc50b5000
    R12=0x0000000000000000 is an unknown value
    R13=0x00007f8f701419d8 is an unknown value
    R14=0x00007f8fa749f578 is pointing into the stack for thread: 0x00007f8f70141800
    R15=0x00007f8f70141800 is a thread


    Stack: [0x00007f8fa73a0000,0x00007f8fa74a1000],  sp=0x00007f8fa749f380,  free space=1020k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C  [libavcodec.so.52.123.0+0x442060]
    </offset></offset></offset></offset>

    This occurs on different physical instances so chances are pretty low it’s hardware issue. Thanks!

  • avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup

    30 September 2015, by Michael Niedermayer
    avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
    

    The variable is not a constant and can lead to race conditions

    Fixes: repro.webm (not reproducable with FFmpeg alone)

    Found-by: Dale Curtis <dalecurtis@google.com>
    Tested-by: Dale Curtis <dalecurtis@google.com>
    Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/vp8.c
  • My python script using ffmpeg captures video content, but the captured content freezes in the middle and jumps frames

    11 November 2022, by Supriyo Mitra

    I am new to ffmpeg and I am trying to use it through a python script. The python functions that captures the video content is given below. The problem I am facing is that the captured content freezes at (uneven) intervals and skips a few frames every time it happens.

    &#xA;

    `    def capturelivestream(self, argslist):&#xA;        streamurl, outnum, feedid, outfilename = argslist[0], argslist[1], argslist[2], argslist[3]&#xA;        try:&#xA;            info = ffmpeg.probe(streamurl, select_streams=&#x27;a&#x27;)&#xA;            streams = info.get(&#x27;streams&#x27;, [])&#xA;        except:&#xA;            streams = []&#xA;        if len(streams) == 0:&#xA;            print(&#x27;There are no streams available&#x27;)&#xA;            stream = {}&#xA;        else:&#xA;            stream = streams[0]&#xA;            for stream in streams:&#xA;                if stream.get(&#x27;codec_type&#x27;) != &#x27;audio&#x27;:&#xA;                    continue&#xA;                else:&#xA;                    break&#xA;        if &#x27;channels&#x27; in stream.keys():&#xA;            channels = stream[&#x27;channels&#x27;]&#xA;            samplerate = float(stream[&#x27;sample_rate&#x27;])&#xA;        else:&#xA;            channels = None&#xA;            samplerate = 44100&#xA;        process = ffmpeg.input(streamurl).output(&#x27;pipe:&#x27;, pix_fmt=&#x27;yuv420p&#x27;, format=&#x27;avi&#x27;, vcodec=&#x27;libx264&#x27;, acodec=&#x27;pcm_s16le&#x27;, ac=channels, ar=samplerate, vsync=0, loglevel=&#x27;quiet&#x27;).run_async(pipe_stdout=True)&#xA;        fpath = os.path.dirname(outfilename)&#xA;        fnamefext = os.path.basename(outfilename)&#xA;        fname = fnamefext.split(".")[0]&#xA;        read_size = 320 * 180 * 3 # This is width * height * 3&#xA;        lastcaptured = time.time()&#xA;        maxtries = 12&#xA;        ntries = 0&#xA;        while True:&#xA;            if process:&#xA;                inbytes = process.stdout.read(read_size)&#xA;                if inbytes is not None and inbytes.__len__() > 0:&#xA;                    try:&#xA;                        frame = (np.frombuffer(inbytes, np.uint8).reshape([180, 320, 3]))&#xA;                    except:&#xA;                        print("Failed to reshape frame: %s"%sys.exc_info()[1].__str__())&#xA;                        continue # This could be an issue if there is a continuous supply of frames that cannot be reshaped&#xA;                    self.processq.put([outnum, frame])&#xA;                    lastcaptured = time.time()&#xA;                    ntries = 0&#xA;                else:&#xA;                    if self.DEBUG:&#xA;                        print("Could not read frame for feed ID %s"%feedid)&#xA;                    t = time.time()&#xA;                    if t - lastcaptured > 30: # If the frames can&#x27;t be read for more than 30 seconds...&#xA;                        print("Reopening feed identified by feed ID %s"%feedid)&#xA;                        process = ffmpeg.input(streamurl).output(&#x27;pipe:&#x27;, pix_fmt=&#x27;yuv420p&#x27;, format=&#x27;avi&#x27;, vcodec=&#x27;libx264&#x27;, acodec=&#x27;pcm_s16le&#x27;, ac=channels, ar=samplerate, vsync=0, loglevel=&#x27;quiet&#x27;).run_async(pipe_stdout=True)&#xA;                        ntries &#x2B;= 1&#xA;                    if ntries > maxtries:&#xA;                        if self.DEBUG:&#xA;                            print("Stream %s is no longer available."%streamurl)&#xA;                        # DB statements removed here&#xA;                        &#xA;                        break # Break out of infinite loop.&#xA;                    continue&#xA;        &#xA;        return None`&#xA;&#xA;

    &#xA;

    The function that captures the frames is as follows:

    &#xA;

    &#xA;`    def framewriter(self, outlist):&#xA;        isempty = False&#xA;        endofrun = False&#xA;        while True:&#xA;            frame = None&#xA;            try:&#xA;                args = self.processq.get()&#xA;            except: # Sometimes, the program crashes at this point due to lack of memory...&#xA;                print("Error in framewriter while reading from queue: %s"%sys.exc_info()[1].__str__())&#xA;                continue&#xA;            outnum = args[0]&#xA;            frame = args[1]&#xA;            if outlist.__len__() > outnum:&#xA;                out = outlist[outnum]&#xA;            else:&#xA;                if self.DEBUG == 2:&#xA;                    print("Could not get writer %s"%outnum)&#xA;                continue&#xA;            if frame is not None and out is not None:&#xA;                out.write(frame)&#xA;                isempty = False&#xA;                endofrun = False&#xA;            else:&#xA;                if self.processq.empty() and not isempty:&#xA;                    isempty = True&#xA;                elif self.processq.empty() and isempty: # processq queue is empty now and was empty last time&#xA;                    print("processq is empty")&#xA;                    endofrun = True&#xA;                elif endofrun and isempty:&#xA;                    print("Could not find any frames to process. Quitting")&#xA;                    break&#xA;        print("Done writing feeds. Quitting.")&#xA;        return None`&#xA;

    &#xA;

    The scenario is as follows: There are multiple video streams from a certain website at any time during the day, and the program containing these functions has to capture them as they get streamed. The memory available to this program is 6GB and there could be upto 3 streams running at any instant. Given below is the relevant main section of the script that uses the functions given above.

    &#xA;

    &#xA;

    &#xA;

    `itftennis = VideoBot(siteurl)&#xA;outlist = []&#xA;t = Thread(target=itftennis.framewriter, args=(outlist,))&#xA;t.daemon = True&#xA;t.start()&#xA;tp = Thread(target=handleprocesstermination, args=())&#xA;tp.daemon = True&#xA;tp.start()&#xA;# Create a database connection and as associated cursor object. We will handle database operations from main thread only.&#xA;# DB statements removed from here...&#xA;feedidlist = []&#xA;vidsdict = {}&#xA;streampattern = re.compile("\?vid=(\d&#x2B;)$")&#xA;while True:&#xA;    streampageurls = itftennis.checkforlivestream()&#xA;    if itftennis.DEBUG:&#xA;        print("Checking for new urls...")&#xA;        print(streampageurls.__len__())&#xA;    if streampageurls.__len__() > 0:&#xA;        argslist = []&#xA;        newurlscount = 0&#xA;        for streampageurl in streampageurls:&#xA;            newstream = False&#xA;            sps = re.search(streampattern, streampageurl)&#xA;            if sps:&#xA;                streamnum = sps.groups()[0]&#xA;                if streamnum not in vidsdict.keys(): # Check if this stream has already been processed.&#xA;                    vidsdict[streamnum] = 1&#xA;                    newstream = True&#xA;                else:&#xA;                    continue&#xA;            else:&#xA;                continue&#xA;            print("Detected new live stream... Getting it.")&#xA;            streamurl = itftennis.getstreamurlfrompage(streampageurl)&#xA;            print("Adding %s to list..."%streamurl)&#xA;            if streamurl is not None:&#xA;                # Now, get feed metadata...&#xA;                metadata = itftennis.getfeedmetadata(streampageurl)&#xA;                if metadata is None:&#xA;                    continue&#xA;                # lines to get matchescounter omitted here...&#xA;                if matchescounter >= itftennis.__class__.MAX_CONCURRENT_MATCHES:&#xA;                    break&#xA;                if newstream is True:&#xA;                    newurlscount &#x2B;= 1&#xA;                outfilename = time.strftime("./videodump/" &#x2B; "%Y%m%d%H%M%S",time.localtime())&#x2B;".avi"&#xA;                out = open(outfilename, "wb")&#xA;                outlist.append(out) # Save it in the list and take down the number for usage in framewriter&#xA;                outnum = outlist.__len__() - 1&#xA;                # Save metadata in DB&#xA;                # lines omitted here....&#xA;                argslist.append([streamurl, outnum, feedid, outfilename])   &#xA;            else:&#xA;                print("Couldn&#x27;t get the stream url from page")&#xA;        if newurlscount > 0:&#xA;            for args in argslist:&#xA;                try:&#xA;                    p = Process(target=itftennis.capturelivestream, args=(args,))&#xA;                    p.start()&#xA;                    processeslist.append(p)&#xA;                    if itftennis.DEBUG:&#xA;                        print("Started process with args %s"%args)&#xA;                except:&#xA;                    print("Could not start process due to error: %s"%sys.exc_info()[1].__str__())&#xA;            print("Created processes, continuing now...")&#xA;            continue&#xA;    time.sleep(itftennis.livestreamcheckinterval)&#xA;t.join()&#xA;tp.join()&#xA;for out in outlist:&#xA;    out.close()`&#xA;

    &#xA;

    &#xA;

    &#xA;

    Please accept my apologies for swamping with this amount of code. I wanted to provide maximum context to my problem. I have removed the absolutely irrelevant DB statements, but apart from that this is what the code looks like.

    &#xA;

    If you need to know anything else about the code, please let me know. What I would really like to know is if I am using the ffmpeg streams capturing statements correctly. The stream contains both video and audio components and I need to capture both. Hence I am making the following call:

    &#xA;

    process = ffmpeg.input(streamurl).output(&#x27;pipe:&#x27;, pix_fmt=&#x27;yuv420p&#x27;, format=&#x27;avi&#x27;, vcodec=&#x27;libx264&#x27;, acodec=&#x27;pcm_s16le&#x27;, ac=channels, ar=samplerate, vsync=0, loglevel=&#x27;quiet&#x27;).run_async(pipe_stdout=True)&#xA;

    &#xA;

    Is this how it is supposed to be done? More importantly, why do I keep getting the freezes in the output video. I have monitored the streams manually, and they are quite consistent. Frame losses do not happen when I view them on the website (at least it is not obviously noticeable). Also, I have run 'top' command on the host running the program. The CPU usage sometimes go over 100% (which, I came to understand from some answers on SO, is to be expected when running ffmpeg) but the memory usage usually remain below 30%. So what is the issue here. What do I need to do in order to fix this problem (other than learn more about how ffmpeg works).

    &#xA;

    Thanks

    &#xA;

    I have tried using various ffmpeg options (while trying to find similar issues that others encountered). I also tried running ffmpeg from command line for a limited period of time (11 mins), using the same options as used in the python code, and the captured content came out quite well. No freezes. No jumps in frames. But I need to use it in an automated way and there would be multiple streams at any time. Also, when I try playing the captured content using ffplay, I sometimes get the message "co located POCs unavailable" when these freezes happen. What does it mean?

    &#xA;