Recherche avancée

Médias (0)

Mot : - Tags -/signalement

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

Autres articles (59)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (6105)

  • How do I run two indefinite loops simultaneously, while also changing variables within them ?

    11 octobre 2016, par Nyalmo

    I’m trying to write a script in Python that records a stream of an IP camera in realtime. It only keeps about a minute worth of recording, constantly overwriting the same files. Whenever an external sensor is triggered I want a variable to be set (event variable) which merges the recording with an extra 30 seconds it records after the sensor is triggered. The combined 90 seconds are then saved as the date and time for later review.

    The idea was to have 2 indefinite while loops, the first containing both the real time recording and the event. The second one would constantly read input and activate the ’event’ function. Initially I though I could just have a software version of the hardware interrupt I’ve learned before, though after some research it seems that’s only for exceptions. I’m currently using TkInter, simulating the external input with keypresses.

    When I tried it out the input wouldn’t cause the event to be triggered. So my question is : How do I run the two indefinite loops simultaneously, while also having the input loop change variables in the main loop so that the ’event’ can actually occur in real-time ?

    Since I’m using ffmpeg to record the stream, once the command is called to record it can’t be stopped, but I want the event variable to be changed as soon as possible.

    I’ve looked at several similar questions regarding multiple loops, and have tried multiprocessing(though this only seems to be used for performance, which is not that important here), making two separate files(not sure how to have them work together) and lastly, threads. None of these seem to work in my situation as I can’t get them running in the way that I want.

    Here is my latest attempt, using threads :

    i = 0
    event = False
    aboutToQuit = False
    someVar = 'Event Deactivated'
    lastVar = False

    def process(frame):
       print "Thread"
       i = 0    
       frame = frame
       frame.bind("<space>", switch)
       frame.bind("<escape>", exit)
       frame.pack()
       frame.focus_set()

    def switch(eventl):
       print(['Activating','Deactivating'][event])
       event = eventl
       event = not(event)

    def exit(eventl):
       print'Exiting Application'
       global aboutToQuit
       #aboutToQuit = True
       root.destroy()

    print("the imported file is", tkinter.__file__)
    def GetTime(): #function opens a script which saves the final merged file as date and time.
       time = datetime.datetime.now()
       subprocess.call("./GetTime.sh", shell = True)
       return (time)

    def main(root):
       global event, aboutToQuit, someVar,lastVar      
       while (not aboutToQuit):
           root.update() # always process new events

           if event == False:
               someVar = 'Event Deactivated'
               subprocess.call(Last30S_Command) #records last 30 seconds overwriting itself.
               print "Merge now"
               subprocess.call(Merge_Command) #merges last 30 seconds with the old 30 seconds      
               print "Shift now"
               subprocess.call(Shift_Command) #copies the last30s recording to the old 30 seconds, overwriting it.
               if lastVar == True: #Triggers only when lastVar state changes
                   print someVar
                   lastVar = False
               time.sleep(.1)

           if event == True:
                someVar = 'Event Activated'
               print"Record Event"
               subprocess.call(EventRecord_Command) #records 30 seconds after event is triggered.
               print"EventMerge Now"
               subprocess.call(EventMerge_Command) # merges the 1 minute recording of Merge_Command with 30 seconds of EventRecord_Command
               if lastVar == False:
                   print someVar
                   lastVar = True
               time.sleep(.1)
               GetTime() #Saves 90 seconds of EventMerge_Command as date and time.
               subprocess.call(EventShift_Command) #Copies EventRecord file to the old 30 second recording, overwriting it

           if aboutToQuit:
              break


    if __name__ == "__main__":
       root = Tk()
       frame = Frame(root, width=100, height=100)  
    #   maintthread = threading.Thread(target=main(root))
    #   inputthread = threading.Thread(target=process(frame))
    #   inputthread.daemon = True
    #   inputthread.start()
    #   maintthread.daemon = True
    #   maintthread.start()
    #   maintthread.join()
       Process(target=process(frame)).start()
       Process(target=main(root)).start()
       print "MainLoop"
    </escape></space>
  • avfilter : add allrgb

    16 août 2015, par Clément Bœsch
    avfilter : add allrgb
    

    Signed-off-by : Nicolas George <george@nsup.org>
    Signed-off-by : Clément Bœsch <u@pkh.me>

    • [DH] Changelog
    • [DH] doc/filters.texi
    • [DH] libavfilter/Makefile
    • [DH] libavfilter/allfilters.c
    • [DH] libavfilter/version.h
    • [DH] libavfilter/vsrc_testsrc.c
  • Coverting mp4 Stream's Audio to MP3 Instead of AAC [on hold]

    15 janvier 2019, par user3763099

    I’ve written 2 programs : one records streams that I’m getting via video encoders, and another plays back all of the streams synchronized to each other. I’m having an issue with audio however. The recorded streams are getting encoded by default into AAC - the playback tool is unable to find a codec to decode this format, so audio is not ideal.

    I don’t really have any control over what the stream looks like, but when I go to record the frames is there any way to tell it to record in a different format ? If not it looks like I’ll need to compile FFMPEG myself with AAC support, but I was hoping to avoid that.

    This was flagged as being "too broad," but I’m not sure how, it’s pretty darn specific. I am asking if there is a way to record a stream via C++ that is coming across with AAC audio as MP3 audio instead. Does that clarify ? I literally cannot get anymore specific than that.