
Recherche avancée
Autres articles (65)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...)
Sur d’autres sites (9998)
-
Python : Strange hanging behavior when piping large stdout of a subprocess
7 septembre 2017, par Victor OdouardI am currently calling
ffmpeg
to extract a binary data stream from a video file, and then putting that binary data into a list. There is a lot of data in this data stream, about 4,000 kb. Here is the code# write and call ffmpeg command, piping stdout
cmd = "ffmpeg -i video.mpg -map 0:1 -c copy -f data -"
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
# read from stdout, byte by byte
li = []
for char in iter(lambda: proc.stdout.read(1), ""):
li.append(char)This works fine. However, if I take out the part where I am reading from
stdout
, it starts working but then hangs :cmd = "ffmpeg -i video.mpg -map 0:1 -c copy -f data -"
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
time.sleep(10)I had to add
time.sleep(10)
at the end or else the process would end before thesubprocess
, causing this error :av_interleaved_write_frame(): Invalid argument
Error writing trailer of pipe:: Invalid argument
size= 0kB time=00:00:00.00 bitrate=N/A speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing ove
rhead: 0.000000%
Conversion failed!Calling either
subprocess.call(cmd, stdout=subprocess.PIPE)
orsubprocess.call(cmd)
also cause hanging (the latter just displays thestdout
in the console while the former doesn’t).Is there something about reading from
stdout
that prevents this hanging (like perhaps the buffer getting cleared), or am I unknowingly introducing a bug elsewhere ? I’m worried that such a small change causes the program to break ; it doesn’t inspire very much confidence.The other issue with this code is that I need to read from the list from another thread. This might mean I need to use a
Queue
. But when I execute the below code, it takes 11 seconds as opposed to 3 seconds with the list equivalent :cmd = "ffmpeg -i video.mpg -loglevel panic -hide_banner -map 0:1 -c copy -f data -"
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
q = Queue()
for char in iter(lambda: proc.stdout.read(1), ""):
q.put(char)Should I be using another data structure ?
-
h264_sei : Add namespace prefix to all SEI values
15 mai 2017, par Mark Thompsonh264_sei : Add namespace prefix to all SEI values
This avoids confusion with equivalent H.265 SEI values when both are
being used at the same time.(cherry picked from commit 6ea220cbeec8863e2006a03b73bed52db2b13ee7)
-
avcodec/frame_thread_encoder : Fix AV_OPT_TYPE_STRING handling in avctx
13 septembre 2017, par Reimar Döffingeravcodec/frame_thread_encoder : Fix AV_OPT_TYPE_STRING handling in avctx
This is the equivalent to what 7d317d4706b49d572a1eb5269438753be18362c7
did for the codec-specific options.
av_opt_copy has specific handling so it's fine that we already copied
the whole context before.Signed-off-by : Reimar Döffinger <Reimar.Doeffinger@gmx.de>