
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (79)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (13876)
-
4xm : Check that the read track value is non-negative
3 septembre 2013, par Martin Storsjö -
Split h.264 stream into multiple parts in python
31 janvier 2023, par BillPlayzMy objective is to split an h.264 stream into multiple parts, meaning while reading the stream from a pipe i would like to save it into x second long packages (in my case 10).


I am using a libcamera-vid subprocess on my Raspberry Pi that outputs the h.264 stream into stdout.

Might be irrelevant, depends : libcamera-vid outputs a message every frame and I am able to locate it at isFrameStopLine
To convert the stream, I use an ffmpeg subprocess, as you can see in the code below.

Imagine it like that :

Stream is running...

- Start recording to a file

- Sleep x seconds

- Finish recording to file

- Start recording a new file

- Sleep x seconds

- Finish recording the new file

- and so on...

Here is my current code, however upon running the first export succeeds, and after the second or third the ffmpeg-subprocess is terminating with the error :

pipe:: Invalid data found when processing input

And shortly after, the python process, because of the ffmpeg termination i believe.
Traceback (most recent call last): File "/home/survpi-camera/main.py", line 56, in <module> processStreamLine(readData) File "/home/survpi-camera/main.py", line 16, in processStreamLine streamInfo["process"].stdin.write(data) BrokenPipeError: [Errno 32] Broken pipe</module>


recentStreamProcesses = []
streamInfo = {
 "lastStreamStart": -1,
 "process": None
}

def processStreamLine(data):
 isInfoLine = ((data.startswith(b"[") and (b"INFO" in data)) or (data == b"Preview window unavailable"))
 isFrameStopLine = (data.startswith(b"#") and (b" fps) exp" in data))
 if ((not isInfoLine) and (not isFrameStopLine)):
 streamInfo["process"].stdin.write(data)
 
 if (isFrameStopLine):
 if (time.time() - streamInfo["lastStreamStart"] >= 10):
 print("10 seconds passed, exporting...")
 exportStream()
 createNewStream()

def createNewStream():
 streamInfo["lastStreamStart"] = time.time()
 streamInfo["process"] = subprocess.Popen([
 "ffmpeg",
 "-r","30",
 "-i","-",
 "-c","copy",("/home/survpi-camera/" + str(round(time.time())) + ".mp4")
 ],stdin=subprocess.PIPE,stderr=subprocess.STDOUT)
 print("Created new streamProcess.")

def exportStream():
 print("Exporting...")
 streamInfo["process"].stdin.close()
 recentStreamProcesses.append(streamInfo["process"])


cameraProcess = subprocess.Popen([
 "libcamera-vid",
 "-t","0",
 "--width","1920",
 "--height","1080",
 "--codec","h264",
 "--inline",
 "--listen",
 "-o","-"
],stdout=subprocess.PIPE,stdin=subprocess.PIPE,stderr=subprocess.STDOUT)

createNewStream()

while True:
 readData = cameraProcess.stdout.readline()
 
 processStreamLine(readData)



Thank you in advance !


-
avformat/4xm : Check for duplicate track ids
7 décembre 2021, par Michael Niedermayer