
Recherche avancée
Médias (2)
-
Granite de l’Aber Ildut
9 septembre 2011, par
Mis à jour : Septembre 2011
Langue : français
Type : Texte
-
Géodiversité
9 septembre 2011, par ,
Mis à jour : Août 2018
Langue : français
Type : Texte
Autres articles (15)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP 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" (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (2341)
-
Display stream with FFmpeg, python and opencv
23 février, par Ηλίας ΚωνσταντινίδηςSituation :
I have a basler camera connected to a raspberry pi, and I am trying to livestream it's feed with FFmpg to a tcp port in my windows PC in order to monitor whats happening in front of the camera.


Things that work :
I manage to set up a python script on the raspberry pi which is responsible for recording the frames, feed them to a pipe and streaming them to a tcp port. From that port, I am able to display the stream using FFplay.


My problem :
FFplay is great for testing out quickly and easily if the direction you are heading is correct, but I want to "read" every frame from the stream, do some processing and then displaying the stream with opencv. That, I am not able to do yet.


Minimaly reprsented, that's the code I use on the raspberry pi side of things :


command = ['ffmpeg',
 '-y',
 '-i', '-',
 '-an',
 '-c:v', 'mpeg4',
 '-r', '50',
 '-f', 'rtsp',
 '-rtsp_transport',
 'tcp','rtsp://192.168.1.xxxx:5555/live.sdp']

p = subprocess.Popen(command, stdin=subprocess.PIPE) 

while camera.IsGrabbing(): # send images as stream until Ctrl-C
 grabResult = camera.RetrieveResult(100, pylon.TimeoutHandling_ThrowException)
 
 if grabResult.GrabSucceeded():
 image = grabResult.Array
 image = resize_compress(image)
 p.stdin.write(image)
 grabResult.Release() 




On my PC if I use the following FFplay command on a terminal, it works and it displays the stream in real time :


ffplay -rtsp_flags listen rtsp://192.168.1.xxxx:5555/live.sdp?tcp


On my PC if I use the following python script, the stream begins, but it fails in the
cv2.imshow
function because I am not sure how to decode it :

import subprocess
import cv2

command = ['C:/ffmpeg/bin/ffmpeg.exe',
 '-rtsp_flags', 'listen',
 '-i', 'rtsp://192.168.1.xxxx:5555/live.sdp?tcp?', 
 '-']

p1 = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)

while True:
 frame = p1.stdout.read()
 cv2.imshow('image', frame)
 cv2.waitKey(1)



Does anyone knows what I need to change in either of those scripts in order to get i to work ?


Thank you in advance for any tips.


-
FFMPEG tee muxer giving "Output file #0 does not contain any stream"
31 août 2020, par Giorgi AptsiauriI am trying to create two streams : one is mpegts UDP stream another - rtmp to Twitch servers.


This command works :


ffmpeg -threads:v 2 -threads:a 16 -filter_threads 2 -thread_queue_size 16 -y \
 -f dshow -video_size 1920x1080 -pixel_format uyvy422 -framerate 25 -rtbufsize 500M -i video="Decklink Video Capture" \
 -f dshow -rtbufsize 100M -i audio="Decklink Audio Capture" \
 -preset ultrafast -c:v libx264 -tune zerolatency -b:v 900k -map 0:v:0 -f mpegts udp://127.0.0.1:5555 \ 
 -pix_fmt yuv420p -c:v libx264 -crf 20 -tune zerolatency -f flv rtmp://live-fra05.twitch.tv/app/stream_key



But it requires double the encoding CPU power.


So, following this, I rewrote the command like this :


ffmpeg -threads:v 2 -threads:a 16 -filter_threads 2 -thread_queue_size 16 -y \
 -f dshow -video_size 1920x1080 -pixel_format uyvy422 -framerate 25 -rtbufsize 500M -i video="Decklink Video Capture" \
 -f dshow -rtbufsize 100M -i audio="Decklink Audio Capture" \
 -preset ultrafast -c:v libx264 -tune zerolatency -b:v 900k \
 -f tee "[select=\'0:v:0\':f=mpegts]udp://127.0.0.1:5555|[select=\'0:v:0,1:a:0\':f=flv]rtmp://live-fra05.twitch.tv/app/stream_key"



By writing
-f tee "[select=\'0:v:0\':f=mpegts]udp://127.0.0.1:5555|[select=\'0:v:0,1:a:0\':f=flv]rtmp://live-fra05.twitch.tv/app/stream_key"
, I mean :

- 

- create UDP stream at udp ://127.0.0.1:5555 and only include video stream from "Decklink Video Capture"
- create RTMP stream where we include the same video stream as above and also the audio stream from "Decklink Audio Capture"






I get the error message :


Output file #0 does not contain any stream



How do I fix this ? I assume I made a mistake in the command.


-
Gnuplot how to set a variable to standard-input if not passed
27 août 2020, par DDSI have a gnuplot script (plot.script) that is invoked like


C:> ffmpeg -i '.\my_awesome_audio_file.wav' -filter_complex aformat=channel_layouts=mono -acodec pcm_s16le -ar 4000 -f data - | gnuplot -e "fileout='plot';fileformat='png';wid=500;" .\plot.script 



Now I'd want to default filein variable to stdin if it is not passed as argument. This because I want to be able to call this script as a 1-liner command with ffmpeg data generation and also as step-by-step procedure


My idea was to use


if(!exists('filein')){
filein = '-';
}



but this throws
warning: Skipping data file with no valid points


if i print the variable datafile I got
-
(I expected something like stdin).

this is the
plot.script
script :


if(!exists('filein')){
 filein = '-';
 }

if (!exists("hei")){
 hei = 4444;
 }
if (!exists("wid")){
 wid = 5555;
 }
if(!exists("fileformat")){
 fileformat = 'png';
 }
if(!exists("fileout")){
 fileout = 'risultato';
 }
 
fileout = fileout . '.' . fileformat;
 
if(!exists("dataformat")){
 dataformat = '%int16';
 }
if(fileformat eq 'png'){
 set terminal png transparent size larghezza,altezza;
 
 }else{
 set terminal fileformat size wid,hei;
 }
 set output fileout;
 unset key;
 unset tics;
 unset border;
 set lmargin 0;
 set rmargin 0;
 set tmargin 0;
 set bmargin 0;


print filein;
plot filein binary filetype=bin format=dataformat endian=little array=1:0 with lines linecolor "0x009900";



But I also want to call this command-by-command :
generate the data-file :


c:> ffmpeg -i '.\my_awesome_audio_file.wav' -filter_complex aformat=channel_layouts=mono -acodec pcm_s16le -ar 4000 -f data audio.dat



plot the data :


c:> gnuplot -e "filein='audio.dat';fileout='plot';fileformat='png';wid=500;" .\plot.script