Recherche avancée

Médias (0)

Mot : - Tags -/publication

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

Autres articles (79)

  • Participer à sa traduction

    10 avril 2011

    Vous 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 (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (12738)

  • ffmpeg crop detect python using subprocess

    12 mai 2015, par JRM

    I want to use python subprocess to call ffmpeg and use crop detect to find all black in a video. The crop detect return I want to put into a string variable and put in a database. At the moment I can get the process running in terminal and but I am unsure about how to grab the specific part of the terminal (stdout) output :

    the script :

    def cropDetect():
       p = subprocess.Popen(["ffmpeg", "-i", "/Desktop/ffprobe_instance/Crop_detect/video_file.mpg", "-vf", "cropdetect=24:16:0", "-vframes", "10", "dummy.mp4"], stdout=subprocess.PIPE)
       result = p.communicate()[0]
       print result


    # SCRIPT
    cropDetect()

    Result in terminal :
    [Parsed_cropdetect_0 @ 0x7fa1d840cb80] x1:719 x2:0 y1:575 y2:0 w :-704 h :-560 x:714 y:570 pos:432142 pts:44102 t:0.490022 crop=-704 :-560:714:570

    How do I take "crop=-704 :-560:714:570" and put it into a variable that I can store in a database ?

    As per update :

    def cropDetect1():
       p = subprocess.check_output(["ffmpeg", "-i", "/Desktop/ffprobe_instance/Crop_detect/video_file.mpg", "-vf", "cropdetect=24:16:0", "-vframes", "10", "dummy.mp4"])
       match = re.search("crop\S+", p)
       crop_result = None
       if match is not None:
           crop_result = match.group()
           print "hello %s" % crop_result

    I can’t seem to print out the "crop_result" - I am presuming that means that the variable is empty ?

    UPDATE : Found it :

    def detectCropFile(localPath):
       fpath = "/xxx/xx/Desktop/Crop_detect/videos/USUV.mp4"
       print "File to detect crop: %s " % fpath
       p = subprocess.Popen(["ffmpeg", "-i", fpath, "-vf", "cropdetect=24:16:0", "-vframes", "500", "-f", "rawvideo", "-y", "/dev/null"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
       infos = p.stderr.read()
       print infos
       allCrops = re.findall(CROP_DETECT_LINE + ".*", infos)
       print allCrops
       mostCommonCrop = Counter(allCrops).most_common(1)
       print "most common crop: %s" % mostCommonCrop
       print mostCommonCrop[0][0]
       global crop
       crop = mostCommonCrop[0][0]
       video_rename()

    Use : p = subprocess.Popen(["ffmpeg", "-i", fpath, "-vf", "cropdetect=24:16:0", "-vframes", "500", "-f", "rawvideo", "-y", "/dev/null"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) to pipe it out

  • Anomalie #3430 (En cours) : les champs multi ne fonctionnent plus si une des rubriques n’est plus ...

    5 mai 2015, par Eric Lupinacci

    Je confirme le bug en 3.1 mais il doit aussi exister en 3.0.
    En fait, dans typo() on appelle à un moment corriger_typo($letexte) sans préciser la langue en cours alors que cela est possible.
    Dans corriger_typo() on appelle ensuite extraire_multi($letexte, $lang, true) mais $lang est la chaine vide car l’argument n’a pas été passé dans l’appel de la fonction.
    De fait, dans extraire_multi() on passe par l’instruction :

    if (!$lang) $lang = $GLOBALS[’spip_lang’] ;
    


    pour déterminer la langue qui est donc celle de l’index spip_lang de $GLOBALS.

    Or, si on suit la boucle de erational on a dans $GLOBALS les valeurs suivantes :
    - pour le titre 10. xxx : $GLOBALS[’spip_lang’] = ’en’ et $GLOBALS[’lang’] = ’en’
    - pour le titre 20. xxx : $GLOBALS[’spip_lang’] = ’fr’ et $GLOBALS[’lang’] = ’en’
    - pour le titre 30. xxx : $GLOBALS[’spip_lang’] = ’fr’ et $GLOBALS[’lang’] = ’en’

    Il est donc normal que pour la deuxième et troisième rubrique on extrait la langue fr.
    Si je patche extraire_multi() en rajoutant la ligne

    if (!$lang and isset($GLOBALS[’lang’])) $lang = $GLOBALS[’lang’] ;
    


    avant l’autre affectation de $lang en considérant que lang est prioritaire sur spip_lang cela fonctionne évidemment.

    Maintenant, je ne connais pas la différence entre spip_lang et lang et je trouve bizarre qu’on laisse tout se faire par défaut dans tous les cas depuis typo(). A votre avis, où faut-il modifier le code pour corriger sans tout casser ?

  • OpenCV won't capture frames from a RTMP source, while FFmpeg does

    27 août 2015, par user2957378

    my goal is to capture a frame from a rtmp stream every second, and process it using OpenCV. I’m using FFmpeg version N-71899-g6ef3426 and OpenCV 2.4.9 with the Java interface (but I’m first experimenting with Python).
    For the moment, I can only take the simple and dirty solution, which is to capture images using FFmpeg, store them in disk, and then read those images from my OpenCV program. This is the FFmpeg command I’m using :

    ffmpeg -i "rtmp://antena3fms35livefs.fplive.net:1935/antena3fms35live-live/stream-lasexta_1 live=1" -r 1 capImage%03d.jpg

    This is currently working for me, at least with this concrete rtmp source. Then I would need to read those images from my OpenCV program in a proper way. I have not actually implemented this part, because I’m trying to find a better solution.

    I think the ideal way would be to capture the rtmp frames directly from OpenCV, but I cannot find the way to do it. This is the code in Python I’m using :

    cv2.namedWindow("camCapture", cv2.CV_WINDOW_AUTOSIZE)
    cap = cv2.VideoCapture()
    cap.open('"rtmp://antena3fms35livefs.fplive.net:1935/antena3fms35live-live/stream-lasexta_1 live=1"')
    if not cap.open:
       print "Not open"
    while (True):
       err,img = cap.read()
       if img and img.shape != (0,0):
           cv2.imwrite("img1", img)
           cv2.imshow("camCapture", img)
       if err:
           print err
           break
       cv2.waitKey(30)

    Instead of read() function, I’m also trying with grab() and retrieve() functions without any good result. The read() function is being executed every time, but no "img" or "err" is received.
    Is there any other way to do it ? or maybe there is no way to get frames directly from OpenCV 2.4.9 from a stream like this ?

    I’ve read OpenCV uses FFmpeg to do this kind of tasks, but as you can see, in my case FFmpeg is able to get frames from the stream while OpenCV is not.

    In the case I could not find the way to get the frames directly from OpenCV, my next idea is to pipe somehow, FFmpeg output to OpenCV, which seems harder to implement.

    Any idea,
    thank you !

    UPDATE 1 :
    I’m in Windows 8.1. Since I was running the python script from Eclipse PyDev, this time I run it from cmd instead, and I’m getting the following warning :

    warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl.hpp:545)

    This warning means, as far as I could read, that either the file-path is wrong, or either the codec is not supported. Now, the question is the same. Is OpenCV not capable of getting the frames from this source ?