Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (50)

  • Diogene : création de masques spécifiques de formulaires d’édition de contenus

    26 octobre 2010, par

    Diogene est un des plugins ? SPIP activé par défaut (extension) lors de l’initialisation de MediaSPIP.
    A quoi sert ce plugin
    Création de masques de formulaires
    Le plugin Diogène permet de créer des masques de formulaires spécifiques par secteur sur les trois objets spécifiques SPIP que sont : les articles ; les rubriques ; les sites
    Il permet ainsi de définir en fonction d’un secteur particulier, un masque de formulaire par objet, ajoutant ou enlevant ainsi des champs afin de rendre le formulaire (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Utilisation et configuration du script

    19 janvier 2011, par

    Informations spécifiques à la distribution Debian
    Si vous utilisez cette distribution, vous devrez activer les dépôts "debian-multimedia" comme expliqué ici :
    Depuis la version 0.3.1 du script, le dépôt peut être automatiquement activé à la suite d’une question.
    Récupération du script
    Le script d’installation peut être récupéré de deux manières différentes.
    Via svn en utilisant la commande pour récupérer le code source à jour :
    svn co (...)

Sur d’autres sites (2680)

  • How to get a list of video devices with a particular VendorID and/or ProductID using FFmpeg (on Mac OS)

    26 mai 2020, par mcgregor94086

    The master task :

    



    I am writing software for a multiple USB camera array. The camera may be connected to a CPU that has other USB cameras builtin or attached. I need to capture one 1920x1080 JPG image from EACH of MY array's cameras into a directory of images - but I need to EXCLUDE any OTHER cameras when taking pictures.

    



    Right now I am trying to implement for MacOS, but in the future I will be implementing for Windows, Linux, iOS and Android.

    



    What is known :

    



    I know the VendorID, ProductID and UniqueID (reported by the MacOS USB system System Hardware Report) for each of the cameras in the camera array.

    



    UNIQUESKY_CAR_CAMERA #5:

  Model ID: UVC Camera VendorID_7119 ProductID_2825
  Unique ID:    0x143400001bcf0b09

UNIQUESKY_CAR_CAMERA #6:

  Model ID: UVC Camera VendorID_7119 ProductID_2825
  Unique ID:    0x143300001bcf0b09


    



    The problem code :

    



    I made the following call to FFmpeg

    



    ffmpeg -nostdin -hide_banner -an -sn -dn  -f avfoundation -list_devices true -I 1


    



    I received the following result in stderr :

    



        [AVFoundation indev @ 0x7fc870e21800] AVFoundation video devices:
    [AVFoundation indev @ 0x7fc870e21800] [0] FaceTime HD Camera (Built-in)
    [AVFoundation indev @ 0x7fc870e21800] [1] UNIQUESKY_CAR_CAMERA #5
    [AVFoundation indev @ 0x7fc870e21800] [2] UNIQUESKY_CAR_CAMERA #6
    [AVFoundation indev @ 0x7fc870e21800] [3] Capture screen 0
    [AVFoundation indev @ 0x7fc870e21800] [4] Capture screen 1
    [AVFoundation indev @ 0x7fc870e21800] AVFoundation audio devices:
    [AVFoundation indev @ 0x7fc870e21800] [0] MacBook Pro Microphone
    1: Input/output error


    



    Of these devices listed in the output, I happen to know (in this particular TEST CASE) that the cameras in my test array, are only these two :

    



    [1] UNIQUESKY_CAR_CAMERA #5
[2] UNIQUESKY_CAR_CAMERA #6


    



    With this knowledge, I can select the indices (1 2) that I need, and then use the following code to capture an image from each :

    



    for i in 1 2; 
do
    ffmpeg  -y -hide_banner  -f avfoundation  -r 15 -video_size 1920x1080 -i 1  -f image2 -qscale:v 1 -qmin 1 -qmax 1 -frames:v 1 img$i.jpg;
done



    



    Unfortunately, in production use (i.e. outside of this test case), I CAN NOT rely on cameras all identifying themselves with the same TEXT "name" prefix (e.g. "UNIQUESKY_CAR_CAMERA"), so I can't just use grep to select the ones I want.

    



    But I CAN be sure that I will know their VendorID, ProductID and UniqueIDs.

    



    So, IF I could get

    



    ffmpeg  -nostdin -hide_banner -an -sn -dn  -f avfoundation -list_devices true -I 1


    



    to also list the VendorID and ProductID, then I could grep for those values.

    



    Is this solution possible ? I can't find syntax in the documentation or examples for how to set such limits.

    



    ALTERNATIVELY : if I could specify to FFmpeg -list_devices to limit the output list to just those with my specified VendorID and ProductIDs then I could easily get the list of device indices I will need for the succeeding image extraction.

    



    Is this solution possible ? I can't find syntax in the documentation or examples for how to set such limits.

    



    Special Note :
    
The cameras I am using are all 1920x1080, and that resolution is necessary for my application. As has been noted by many Mac users on the web, other image capture programs (such as imagesnap) sometimes capture images at lower resolution (1024x720) than the cameras are capable of, and will not capture images at higher resolutions such as (1920x1080). For this reason, and because it is available on ALL the OS platforms of interest to us, I chose to use FFmpeg.

    


  • vf_dnn_processing.c : add dnn backend openvino

    25 mai 2020, par Guo, Yejun
    vf_dnn_processing.c : add dnn backend openvino
    

    We can try with the srcnn model from sr filter.
    1) get srcnn.pb model file, see filter sr
    2) convert srcnn.pb into openvino model with command :
    python mo_tf.py —input_model srcnn.pb —data_type=FP32 —input_shape [1,960,1440,1] —keep_shape_ops

    See the script at https://github.com/openvinotoolkit/openvino/tree/master/model-optimizer
    We'll see srcnn.xml and srcnn.bin at current path, copy them to the
    directory where ffmpeg is.

    I have also uploaded the model files at https://github.com/guoyejun/dnn_processing/tree/master/models

    3) run with openvino backend :
    ffmpeg -i input.jpg -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=openvino:model=srcnn.xml:input=x:output=srcnn/Maximum -y srcnn.ov.jpg
    (The input.jpg resolution is 720*480)

    Also copy the logs on my skylake machine (4 cpus) locally with openvino backend
    and tensorflow backend. just for your information.

    $ time ./ffmpeg -i 480p.mp4 -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=tensorflow:model=srcnn.pb:input=x:output=y -y srcnn.tf.mp4

    frame= 343 fps=2.1 q=31.0 Lsize= 2172kB time=00:00:11.76 bitrate=1511.9kbits/s speed=0.0706x
    video:1973kB audio:187kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : 0.517637%
    [aac @ 0x2f5db80] Qavg : 454.353
    real 2m46.781s
    user 9m48.590s
    sys 0m55.290s

    $ time ./ffmpeg -i 480p.mp4 -vf format=yuv420p,scale=w=iw*2:h=ih*2,dnn_processing=dnn_backend=openvino:model=srcnn.xml:input=x:output=srcnn/Maximum -y srcnn.ov.mp4

    frame= 343 fps=4.0 q=31.0 Lsize= 2172kB time=00:00:11.76 bitrate=1511.9kbits/s speed=0.137x
    video:1973kB audio:187kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : 0.517640%
    [aac @ 0x31a9040] Qavg : 454.353
    real 1m25.882s
    user 5m27.004s
    sys 0m0.640s

    Signed-off-by : Guo, Yejun <yejun.guo@intel.com>
    Signed-off-by : Pedro Arthur <bygrandao@gmail.com>

    • [DH] doc/filters.texi
    • [DH] libavfilter/vf_dnn_processing.c
  • FPS goes down while performing object detection using TensorFlow on multiple threads

    14 mai 2020, par Apoorv Mishra

    I am trying to run object detection on multiple cameras. I am using SSD mobinet v2 frozen graph to perform object detection with TensorFlow and OpenCV. I had implemented threading to invoke the separate thread for separate camera. But doing so I'm getting low FPS with multiple video streams.

    &#xA;&#xA;

    Note : The model is working fine with single stream. Also when number of detected objects in different frames are low, I'm getting decent FPS.

    &#xA;&#xA;

    My threading logic is working fine. I guess I'm having issue with using the graph and session. Please let me know what am I doing wrong.

    &#xA;&#xA;

    with tf.device(&#x27;/GPU:0&#x27;):&#xA;    with detection_graph.as_default():&#xA;        with tf.Session(config=config, graph=detection_graph) as sess:&#xA;            while True:&#xA;                # Read frame from camera&#xA;                raw_image = pipe.stdout.read(IMG_H*IMG_W*3)&#xA;                image =  np.fromstring(raw_image, dtype=&#x27;uint8&#x27;)     # convert read bytes to np&#xA;                image_np = image.reshape((IMG_H,IMG_W,3))&#xA;                img_copy = image_np[170:480, 100:480]&#xA;                # Expand dimensions since the model expects images to have shape: [1, None, None, 3]&#xA;                image_np_expanded = np.expand_dims(img_copy, axis=0)&#xA;                # Extract image tensor&#xA;                image_tensor = detection_graph.get_tensor_by_name(&#x27;image_tensor:0&#x27;)&#xA;                # Extract detection boxes&#xA;                boxes = detection_graph.get_tensor_by_name(&#x27;detection_boxes:0&#x27;)&#xA;                # Extract detection scores&#xA;                scores = detection_graph.get_tensor_by_name(&#x27;detection_scores:0&#x27;)&#xA;                # Extract detection classes&#xA;                classes = detection_graph.get_tensor_by_name(&#x27;detection_classes:0&#x27;)&#xA;                # Extract number of detections&#xA;                num_detections = detection_graph.get_tensor_by_name(&#xA;                        &#x27;num_detections:0&#x27;)&#xA;                # Actual detection.&#xA;                (boxes, scores, classes, num_detections) = sess.run(&#xA;                        [boxes, scores, classes, num_detections],&#xA;                        feed_dict={image_tensor: image_np_expanded})&#xA;                # Visualization of the results of a detection.&#xA;                boxes = np.squeeze(boxes)&#xA;                scores = np.squeeze(scores)&#xA;                classes = np.squeeze(classes).astype(np.int32)&#xA;&#xA;                box_to_display_str_map = collections.defaultdict(list)&#xA;                box_to_color_map = collections.defaultdict(str)&#xA;&#xA;                for i in range(min(max_boxes_to_draw, boxes.shape[0])):&#xA;                    if scores is None or scores[i] > threshold:&#xA;                        box = tuple(boxes[i].tolist())&#xA;                        if classes[i] in six.viewkeys(category_index):&#xA;                            class_name = category_index[classes[i]][&#x27;name&#x27;]&#xA;                        display_str = str(class_name)&#xA;                        display_str = &#x27;{}: {}%&#x27;.format(display_str, int(100 * scores[i]))&#xA;                        box_to_display_str_map[box].append(display_str)&#xA;                        box_to_color_map[box] = STANDARD_COLORS[&#xA;                                classes[i] % len(STANDARD_COLORS)]&#xA;                for box,color in box_to_color_map.items():&#xA;                    ymin, xmin, ymax, xmax = box&#xA;                    flag = jam_check(xmin, ymin, xmax, ymax, frame_counter)&#xA;                    draw_bounding_box_on_image_array(&#xA;                            img_copy,&#xA;                            ymin,&#xA;                            xmin,&#xA;                            ymax,&#xA;                            xmax,&#xA;                            color=color,&#xA;                            thickness=line_thickness,&#xA;                            display_str_list=box_to_display_str_map[box],&#xA;                            use_normalized_coordinates=use_normalized_coordinates)&#xA;&#xA;                image_np[170:480, 100:480] = img_copy&#xA;&#xA;                image_np = image_np[...,::-1]&#xA;&#xA;                pipe.stdout.flush()&#xA;&#xA;                yield cv2.imencode(&#x27;.jpg&#x27;, image_np, [int(cv2.IMWRITE_JPEG_QUALITY), 50])[1].tobytes()&#xA;

    &#xA;&#xA;

    I've set the config as :

    &#xA;&#xA;

    config = tf.ConfigProto()&#xA;config.gpu_options.per_process_gpu_memory_fraction=0.4&#xA;

    &#xA;