
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (47)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette 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. -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si 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 (...) -
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
Sur d’autres sites (8494)
-
How can start a process and stop the process if "error" string appear in the console output strings in one line commands set
25 janvier 2018, par Thm LeeNow I want one line cmd commands set which start a process and monitor the consol output strings stream. And so if error message appear in the process’s console output, then could stop the process immediately.
For example, I tried below commends sets, but failed. It seems find command didn’t get any strings streams in which search key word "error"
ffmpeg "endcoding process options set" | find "error" && exit
or,
ffmpeg "endcoding process options set" 2>&1 find "error" && exit
Is there any solutions about this ?
Thanks in advance
-
dashdec : Only free url string if being reused
21 janvier 2018, par Brendan McGrathdashdec : Only free url string if being reused
If no representation bandwidth value is set, the url value returned
by get_content_url is corrupt (as it has been freed).
This change ensures the url string is not freed unless it is about
to be reused
Changes since v1 :
1 removed the unneeded 'if' statement (as pointed out by Michael Niedermayer
2 added comment to make it clear why the av_free was required
Signed-off-by : Brendan McGrath <redmcg@redmandi.dyndns.org> -
Convert an h264 byte string to OpenCV images
27 novembre 2017, par Fred DufresneIn Python, how do I convert an h264 byte string to images OpenCV can read, only keeping the latest image ?
Long version :
Hi everyone.
Working in Python, I’m trying to get the output from adb screenrecord piped in a way that allows me to capture a frame whenever I need it and use it with OpenCV. As I understand, I need to constantly read the stream because it’s h264.
I’ve tried multiple things to get it working and concluded that I needed to ask for specific help.
The following gets me the stream I need and works very well when I print stream.stdout.read(n).
import subprocess as sp
adbCmd = ['adb', 'exec-out', 'screenrecord', '--output-format=h264', '-']
stream = sp.Popen(adbCmd, stdout = sp.PIPE, universal_newlines = True)Universal newlines was necessary to get it to work on Windows.
Doing :
sp.call(['ffplay', '-'], stdin = stream.stdout, universal_newlines = True)
Works.
The problem is I am now trying to use ffmpeg to take the input h264 stream and output as many frames as possible, overwriting the last frame if needed.
ffmpegCmd = ['ffmpeg', '-f', 'image2pipe', '-pix_fmt', 'bgr24', '-vcodec', 'h264', 'fps=30', '-']
ffmpeg = sp.Popen(ffmpegCmd, stdin = stream.stdout, stdout = sp.PIPE, universal_newlines = True)This is what I think should be used, but I always get the error "Output file #0 does not contain any stream".
Edit :
Final Answer
Turns out the universal_newlines option was ruining the line endings and gradually corrupting the output. Also, the ffmpeg command was wrong, see LordNeckbeard’s answer.
Here’s the correct ffmpeg command to achieve what was used :
ffmpegCmd = ['ffmpeg', '-i', '-', '-f', 'rawvideo', '-vcodec', 'bmp', '-vf', 'fps=5', '-']
ffmpeg = sp.Popen(ffmpegCmd, stdin = stream.stdout, stdout = sp.PIPE)And then to convert the result into an OpenCV image, you do the following :
fileSizeBytes = ffmpeg.stdout.read(6)
fileSize = 0
for i in xrange(4):
fileSize += fileSizeBytes[i + 2] * 256 ** i
bmpData = fileSizeBytes + ffmpeg.stdout.read(fileSize - 6)
image = cv2.imdecode(np.fromstring(bmpData, dtype = np.uint8), 1)This will get every single frame of a stream as an OpenCV image.