Recherche avancée

Médias (91)

Autres articles (35)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (4300)

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

    


    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

    


    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.

    


    Any ideas ?

    


    router.post('/', async function(req, res) {
  const fileURL = new URL(req.body.file);
  var path = fileURL.pathname;
  path = 'tmp/'+path.substring(1);    // removes the initial / from the path

  let file = fs.createWriteStream(path);  // create the file locally
  const request = https.get(fileURL, function(response) {
    response.pipe(file);
  });
  
  // after file has saved
  file.on('finish', function () {
    var process = new ffmpeg(path);
    process.then(function (video) {
      let metadata = formatMetadata(video.metadata);

      res.send ({
        status: '200',
        data: metadata,
        errors: errors,
        response: 'success'
      });

    }, function (err) {
      console.warn('Error: ' + err);

      res.send ({
        status: '400',
        data: 'Something went wrong processing this video',
        response: 'fail',
      });
    });
  });

  file.on('error', function (err) {
    console.warn(err);
  });

});

function formatMetadata(metadata) {
  const data = {
    'video' : metadata.video,
    'audio' : metadata.audio,
    'duration' : metadata.duration
  };
  return data;
}


    


    // Expected output

    


    {"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}}


    


    // Actual output

    


    {"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}}


    


    Note - this happens sporadically

    


  • 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
  • AWS EC2 and OpenCV with UDP consumer

    22 juillet 2021, par NoobZik

    I have two EC2

    &#xA;

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

    • B the consumer which it will grab the UDP feed from the A
    • &#xA;

    &#xA;

    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.

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

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

    &#xA;

     Create your views here.&#xA;from django.http import HttpResponse&#xA;from django.template import loader&#xA;from django.shortcuts import render&#xA;# from .models import Vehicule&#xA;import cv2&#xA;import threading&#xA;from django.views.decorators import gzip&#xA;from django.http import StreamingHttpResponse&#xA;&#xA;&#xA;@gzip.gzip_page&#xA;def webcam(request):&#xA;    try:&#xA;        cam = VideoCamera()&#xA;        return StreamingHttpResponse(gen(cam), content_type="multipart/x-mixed-replace;boundary=frame")&#xA;    except:&#xA;        pass&#xA;    return render(request, &#x27;vebcam.html&#x27;)&#xA;&#xA;#capture video&#xA;class VideoCamera(object):&#xA;    def __init__(self):&#xA;        self.video = cv2.VideoCapture(&#x27;udp://172.31.57.243:55055&#x27;, cv2.CAP_FFMPEG)&#xA;        (self.grabbed, self.frame) = self.video.read()&#xA;        threading.Thread(target=self.update, args=()).start()&#xA;&#xA;    def __del__(self):&#xA;        self.video.release()&#xA;&#xA;    def get_frame(self):&#xA;        image = self.frame&#xA;        _, jpeg = cv2.imencode(&#x27;.jpg&#x27;, image)&#xA;        return jpeg.tobytes()&#xA;&#xA;    def update(self):&#xA;        while True:&#xA;            (self.grabbed, self.frame) = self.video.read()&#xA;&#xA;def gen(camera):&#xA;    while True:&#xA;        frame = camera.get_frame()&#xA;        yield (b&#x27;--frame\r\n&#x27;b&#x27;Content-Type: image/jpeg\r\n\r\n&#x27; &#x2B; frame &#x2B; b&#x27;\r\n\r\n&#x27;)&#xA;

    &#xA;

    It runs fine on local but not on EC2

    &#xA;

    This is the log that led me to check ffplay

    &#xA;

    Traceback (most recent call last):&#xA;  File "/usr/lib/python3.8/wsgiref/handlers.py", line 138, in run&#xA;    self.finish_response()&#xA;  File "/usr/lib/python3.8/wsgiref/handlers.py", line 183, in finish_response&#xA;    for data in self.result:&#xA;  File "/home/ubuntu/.local/lib/python3.8/site-packages/django/utils/text.py", line 304, in compress_sequence&#xA;    for item in sequence:&#xA;  File "/home/ubuntu/site/mysite/mysite/views.py", line 42, in gen&#xA;    frame = camera.get_frame()&#xA;  File "/home/ubuntu/site/mysite/mysite/views.py", line 33, in get_frame&#xA;    _, jpeg = cv2.imencode(&#x27;.jpg&#x27;, image)&#xA;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 &#x27;imencode&#x27;&#xA;

    &#xA;