
Recherche avancée
Autres articles (16)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (3116)
-
AWS EC2 and OpenCV with UDP consumer
22 juillet 2021, par NoobZikI 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, Jonathanlavc/aarch64 : motion estimation functions in neon
- ff_pix_abs16_neon
- ff_pix_abs16_xy2_neonIn 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.6ff_pix_abs16_xy2_neon :
pix_abs_0_3_c : 269.1
pix_abs_0_3_neon : 39.3Tested with :
./tests/checkasm/checkasm —test=motion —bench —disable-linux-perfSigned-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 ZabsI 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