
Recherche avancée
Autres articles (25)
-
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...) -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP 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, parLe 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 (3684)
-
Obtaining frames from IP Camera with low latency
5 février 2023, par Russ1337I am currently using this command to get frames from my RTSP stream and reading frames from stdout :


ffmpeg -nostdin -rtsp_transport tcp -i -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -



However, I would like to get the same latency as when I see it via ffplay :


ffplay -fflags nobuffer -flags low_delay -tune zerolatency -framedrop -rtsp_transport tcp 



or when I play it via VLC Media > Open Network Stream with :network_caching=300ms.


I would like to know what other parameters I can use with my ffmpeg command to get an equivalent (or better) result compared to the ffplay command.


I have made references from : How to dump raw RTSP stream to file ?, Open CV RTSP camera buffer lag, How to pipe output from ffmpeg using python ?, bad ffmpeg performace compared to ffplay and VLC, How to minimize the delay in a live streaming with ffmpeg


My current implmentation :


FFMPEG_CMD = "ffmpeg -nostdin -rtsp_transport tcp -i -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -".split(" ")
WIDTH = 2560
HEIGHT = 1440

process = subprocess.Popen(FFMPEG_CMD, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)

while True:
 raw_frame = process.stdout.read(WIDTH*HEIGHT*3)
 frame = np.frombuffer(raw_frame, np.uint8) 
 frame = frame.reshape((HEIGHT, WIDTH, 3))

 <do stuff="stuff" with="with" frame="frame"></do> show frame etc.>



Thanks for reading.



ffmpeg
command I am now using for < 1s latency.

ffmpeg -nostdin -flags low_delay -rtsp_transport tcp -i -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -




Implementation with suggestion(s) from Answers :


import subprocess
import numpy as np

FFMPEG_CMD = "ffmpeg -nostdin -flags low_delay -rtsp_transport tcp -i -pix_fmt bgr24 -an -vcodec rawvideo -f rawvideo -".split(" ")
WIDTH = 2560
HEIGHT = 1440

process = subprocess.Popen(FFMPEG_CMD, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)

raw_frame = np.empty((HEIGHT, WIDTH, 3), np.uint8) 
frame_bytes = memoryview(raw_frame).cast("B")

while process.poll() is None:
 process.stdout.readinto(frame_bytes)
 frame = raw_frame.reshape((HEIGHT, WIDTH, 3))

 <do stuff="stuff" with="with" frame="frame"></do> show frame etc.>



-
avformat/mov : add option max_stts_delta
27 novembre 2021, par Gyan Doshiavformat/mov : add option max_stts_delta
Very high stts sample deltas may occasionally be intended but usually
they are written in error or used to store a negative value for dts correction
when treated as signed 32-bit integers.This option lets the user set an upper limit, beyond which the delta is clamped to 1.
Values greater than the limit if negative when cast to int32 are used to adjust onward dts.Unit is the track time scale. Default is UINT_MAX - 48000*10 which
allows upto a 10 second dts correction for 48 kHz audio streams while
accommodating 99.9% of uint32 range.Signed-off-by : Gyan Doshi <ffmpeg@gyani.pro>
Reviewed-by : Michael Niedermayer <michael@niedermayer.cc> -
libavutil/hwcontext_qsv : fix a bug for mapping vaapi frame to qsv
16 novembre 2021, par nyanmisakalibavutil/hwcontext_qsv : fix a bug for mapping vaapi frame to qsv
The data stored in data[3] in VAAPI AVFrame is VASurfaceID while
the data stored in pair->first is the pointer of VASurfaceID, so
we need to do cast to make following commandline works :ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
hwaccel_output_format vaapi -i input.264 \
vf "hwmap=derive_device=qsv,format=qsv" -c:v h264_qsv output.264
Signed-off-by : nyanmisaka <nst799610810@gmail.com>
Signed-off-by : Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by : Anton Khirnov <anton@khirnov.net>