Recherche avancée

Médias (91)

Autres articles (59)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

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

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (3871)

  • AWS EC2 and OpenCV with UDP consumer

    22 juillet 2021, par NoobZik

    I have two EC2

    


      

    • A That grabs the video feed from Amazon Kinesis Video to send it into via UDP to B
    • 


    • B the consumer which it will grab the UDP feed from the A
    • 


    


    While debugging my opencv not grabbing the UDP feed, I suspect something is wrong with ffpmeg, so I am going to make sure that ffplay can read packets sent from A.

    


    Now when I try to read udp packets with ffplay {adress-ip-with-port}I have the following error :

    


    Could not initialize SDL - No available video device
(Did you set the DISPLAY variable?)


    


    How do I fix this one since there is no display on EC2.

    


    Also if it can help, this is my code for the consumer part

    


     Create your views here.
from django.http import HttpResponse
from django.template import loader
from django.shortcuts import render
# from .models import Vehicule
import cv2
import threading
from django.views.decorators import gzip
from django.http import StreamingHttpResponse


@gzip.gzip_page
def webcam(request):
    try:
        cam = VideoCamera()
        return StreamingHttpResponse(gen(cam), content_type="multipart/x-mixed-replace;boundary=frame")
    except:
        pass
    return render(request, 'vebcam.html')

#capture video
class VideoCamera(object):
    def __init__(self):
        self.video = cv2.VideoCapture('udp://172.31.57.243:55055', cv2.CAP_FFMPEG)
        (self.grabbed, self.frame) = self.video.read()
        threading.Thread(target=self.update, args=()).start()

    def __del__(self):
        self.video.release()

    def get_frame(self):
        image = self.frame
        _, jpeg = cv2.imencode('.jpg', image)
        return jpeg.tobytes()

    def update(self):
        while True:
            (self.grabbed, self.frame) = self.video.read()

def gen(camera):
    while True:
        frame = camera.get_frame()
        yield (b'--frame\r\n'b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n')


    


    It runs fine on local but not on EC2

    


    This is the log that led me to check ffplay

    


    Traceback (most recent call last):
  File "/usr/lib/python3.8/wsgiref/handlers.py", line 138, in run
    self.finish_response()
  File "/usr/lib/python3.8/wsgiref/handlers.py", line 183, in finish_response
    for data in self.result:
  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/utils/text.py", line 304, in compress_sequence
    for item in sequence:
  File "/home/ubuntu/site/mysite/mysite/views.py", line 42, in gen
    frame = camera.get_frame()
  File "/home/ubuntu/site/mysite/mysite/views.py", line 33, in get_frame
    _, jpeg = cv2.imencode('.jpg', image)
cv2.error: OpenCV(4.5.3) /tmp/pip-req-build-xw6jtoah/opencv/modules/imgcodecs/src/loadsave.cpp:978: error: (-215:Assertion failed) !image.empty() in function 'imencode'


    


  • lavc/aarch64 : motion estimation functions in neon

    26 juin 2022, par Swinney, Jonathan
    lavc/aarch64 : motion estimation functions in neon
    

    - ff_pix_abs16_neon
    - ff_pix_abs16_xy2_neon

    In direct micro benchmarks of these ff functions verses their C implementations,
    these functions performed as follows on AWS Graviton 3.

    ff_pix_abs16_neon :
    pix_abs_0_0_c : 141.1
    pix_abs_0_0_neon : 19.6

    ff_pix_abs16_xy2_neon :
    pix_abs_0_3_c : 269.1
    pix_abs_0_3_neon : 39.3

    Tested with :
    ./tests/checkasm/checkasm —test=motion —bench —disable-linux-perf

    Signed-off-by : Jonathan Swinney <jswinney@amazon.com>
    Signed-off-by : Martin Storsjö <martin@martin.st>

    • [DH] libavcodec/aarch64/Makefile
    • [DH] libavcodec/aarch64/me_cmp_init_aarch64.c
    • [DH] libavcodec/aarch64/me_cmp_neon.S
    • [DH] libavcodec/me_cmp.c
    • [DH] libavcodec/me_cmp.h
    • [DH] tests/checkasm/Makefile
    • [DH] tests/checkasm/checkasm.c
    • [DH] tests/checkasm/checkasm.h
    • [DH] tests/checkasm/motion.c
    • [DH] tests/fate/checkasm.mak
  • ffmpeg app using node occasionally crashes as file doesn't appear to be read correctly

    31 mai 2022, par Zabs

    I have an simple Node application that allows me to pass an AWS S3 URL link to a file (in this case video files). It uses the FFMPEG library to read the video file and return data like codecs, duration, bitrate etc..

    &#xA;

    The script is called from PHP script which in turn send the data to the Node endpoint and passes the Amazon S3 URL to node. Sometimes for no obvious reasons the video file fails to return the expected values regarding container, codec, duration etc... and just returns '0'. But when I try the exact same file/request again it returns this data correctly e.g container:mp4

    &#xA;

    I'm not sure but I think the script somehow needs the createWriteStream to be closed but I cannot be sure, the problem is the issue I have found doesn't happen all the time but sporadically so its hard to get to the issue when its difficult to replicate it.

    &#xA;

    Any ideas ?

    &#xA;

    router.post(&#x27;/&#x27;, async function(req, res) {&#xA;  const fileURL = new URL(req.body.file);&#xA;  var path = fileURL.pathname;&#xA;  path = &#x27;tmp/&#x27;&#x2B;path.substring(1);    // removes the initial / from the path&#xA;&#xA;  let file = fs.createWriteStream(path);  // create the file locally&#xA;  const request = https.get(fileURL, function(response) {&#xA;    response.pipe(file);&#xA;  });&#xA;  &#xA;  // after file has saved&#xA;  file.on(&#x27;finish&#x27;, function () {&#xA;    var process = new ffmpeg(path);&#xA;    process.then(function (video) {&#xA;      let metadata = formatMetadata(video.metadata);&#xA;&#xA;      res.send ({&#xA;        status: &#x27;200&#x27;,&#xA;        data: metadata,&#xA;        errors: errors,&#xA;        response: &#x27;success&#x27;&#xA;      });&#xA;&#xA;    }, function (err) {&#xA;      console.warn(&#x27;Error: &#x27; &#x2B; err);&#xA;&#xA;      res.send ({&#xA;        status: &#x27;400&#x27;,&#xA;        data: &#x27;Something went wrong processing this video&#x27;,&#xA;        response: &#x27;fail&#x27;,&#xA;      });&#xA;    });&#xA;  });&#xA;&#xA;  file.on(&#x27;error&#x27;, function (err) {&#xA;    console.warn(err);&#xA;  });&#xA;&#xA;});&#xA;&#xA;function formatMetadata(metadata) {&#xA;  const data = {&#xA;    &#x27;video&#x27; : metadata.video,&#xA;    &#x27;audio&#x27; : metadata.audio,&#xA;    &#x27;duration&#x27; : metadata.duration&#xA;  };&#xA;  return data;&#xA;}&#xA;

    &#xA;

    // Expected output

    &#xA;

    {"data":{"video":{"container":"mov","bitrate":400,"stream":0,"codec":"h264","resolution":{"w":1280,"h":720},"resolutionSquare":{"w":1280,"h":720},"aspect":{"x":16,"y":9,"string":"16:9","value":1.7777777777777777},"rotate":0,"fps":25,"pixelString":"1:1","pixel":1},"audio":{"codec":"aac","bitrate":"127","sample_rate":44100,"stream":0,"channels":{"raw":"stereo","value":2}},"duration":{"raw":"00:00:25.68","seconds":25}}&#xA;

    &#xA;

    // Actual output

    &#xA;

    {"data":{"video":{"container":"","bitrate":0,"stream":0,"codec":"","resolution":{"w":0,"h":0},"resolutionSquare":{"w":0,"h":null},"aspect":{},"rotate":0,"fps":0,"pixelString":"","pixel":0},"audio":{"codec":"","bitrate":"","sample_rate":0,"stream":0,"channels":{"raw":"","value":""}},"duration":{"raw":"","seconds":0}}&#xA;

    &#xA;

    Note - this happens sporadically

    &#xA;