Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (43)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (5538)

  • 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'


    


  • AWS Lambda and Fluent FFMPEG error "cannot read property "isStream" of undefined"

    29 mai 2021, par Travis Lee

    so here's the goal : convert a .webm file hosted in an S3 into a gif and upload that to a new bucket. This all works fine when run locally, but when trying to translate it into a lambda, fluent-ffmpeg throws errors when it runs the command.

    


    Here's the code snippet :

    


    ffmpeg(new URL(vid))
  .outputOptions("-vf", "scale=320:-1:flags=lanczos,fps=14")
  .on('progress', () => {
      console.log('progress');
  })
  .on('end', () => {
     //Do stuff with the result when it is done
  })
  .output(newKey)
  .run(newKey);


    


    in this snippet, "vid" is a presigned GET url for an S3 bucket containing the .webm video file, and "newKey" is the name of the new bucket (and a temporary writeStream/File that is created in the lambda to store the new .gif file until we upload it to S3 - not super relevant to this issue).

    


    What should happen (and does locally) is that a new output is created containing the converted .gif file

    


    What happens when it is deployed in a lambda is that it reaches the .outputOptions call and throws a type error saying that it cannot read property isStream of undefined.

    


    At first glance, this seems like I simply don't have FFMPEG installed in the lambda, but I do. I have tried with the prebuilt layer using NodeJS 10 found here : https://serverlessrepo.aws.amazon.com/applications/us-east-1/145266761615/ffmpeg-lambda-layer ,
with a NodeJS 12 layer that was built by some engineers here previously, and tried building a NodeJS 14 FFMPEG layer myself and using that. I tried for all three using no configuration and letting it call the PATH ffmpeg, using the FFMPEG_PATH and FFPROBE_PATH environment variables set to either what was specified in the previous layers, or what I made it in the newly built one, and even manually setting the path to the executables using the setFfmpegPath and setFfprobePath functions found on the fluent-ffmpeg object.

    


    Lastly, I even tried bundling the executables in with the actual lambda code itself and uploading it through an S3, trying all three above methods of getting it to point to the correct paths once again to no avail.

    


    I'm seriously in need of help if anyone else has encountered something similar or just might know what is going on. I'm at wit's end here trying to figure this out.

    


  • Live streaming of processed frames to AWS

    22 avril 2021, par MinasCham

    I'm working on a project where i need to capture live video feed from an RTSP camera source, process the video frame-by-frame and stream the result to an AWS Service.

    


    So far, my solution :

    


      

    • Captures frames from the RTSP camera source using OpenCV and performs some processing.
    • 


    • Feeds the processed frames to an ffmpeg pipe that packages the content for online streaming (HTTP Live Streaming - hls) and saves it locally.
    • 


    • Transfers the media content to an Amazon Kinesis Video Stream using a Gstreamer pipeline element with kvssink as a sink element.
    • 


    


    My questions are :

    


      

    • Currently I'm saving the content both locally and on an Amazon Kinesis Video Stream. Is this efficient ?
    • 


    • Is it possible to directly stream the frames to the Amazon kinesis Video Stream (perhaps by connecting the ffmpeg output with the gstreamer pipeline element) ?
    • 


    • Is the file format suitable for this implementation or would it better to encode the media differently ?
    •