
Recherche avancée
Autres articles (45)
-
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Multilang : améliorer l’interface pour les blocs multilingues
18 février 2011, parMultilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela. -
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
Sur d’autres sites (4826)
-
Using FFMPEG for Bidirectional Voice Communication with Symmetric RTP
3 février 2024, par Batuhan ÖksüzI am trying to make a voice communication between two peers. The first peer is my local machine which is behind a symmetric NAT. The second peer is my server running on an AWS EC2 device which has a public IP address. I want to use FFMPEG for sending the audio stream through RTP while at the same time listening to a known port to receive the audio stream the remote peer sends to my device. In order to not deal with NAT traversal issues, I want to be able to use the same IP address and port number I use for sending on my local device for receiving. Is this plausible ? I'm starting to think that this is not possible and here is my rationale :


- 

- If my understanding is correct UDP doesn't allow full-duplex communication ; that is, one cannot use one IP:port pair for both sending and receiving data packets at the same time. Is that correct ?
- If one wants to bind a socket that is already been bound, the function throws a bind error saying "Address already in use.". I figured there is a UDP option to allow binding to the same port or address even if they are in use. These options are namely SO_REUSEADDR and SO_REUSEPORT. However, this page states that it is only possible if the port is in TIME_WAIT state. So this also supports my suspicion.






On the other hand, there is symmetric RTP that clearly states a device can receive RTP streams from an address and port that it simultaneously uses to transmit RTP streams from. With exact words of the RFC :




A device supports symmetric RTP if it selects, communicates, and uses
IP addresses and port numbers such that, when receiving a
bidirectional RTP media stream on UDP port "A" and IP address "a", it
also transmits RTP media for that stream from the same source UDP
port "A" and IP address "a". That is, it uses the same UDP port to
transmit and receive one RTP stream.






A device that doesn't support symmetric RTP would transmit RTP from a
different port, or from a different IP address, than the port and IP
address used to receive RTP for that bidirectional media steam.




So this is where I get confused. Is symmetric RTP somehow works around the limitations of UDP ? How am I getting this wrong ?


Now going back to FFMPEG and the use of symmetric RTP, I see there is an rtp option we can use to set it up, the so called localrtpport=n. I can find almost no explanation to what it does and how it's useful though. Can anyone help me with that ? As far as I can tell, this option tells FFMPEG to use port "n" as the outbound port when transmitting an RTP stream. So if the receiver transmitted its stream to this port then the problem of symmetric NAT requirement would be resolved. Or so I thought...


To draw you a better picture, here are my FFMPEG commands (I'm trying everything in my local host in these commands) :


# My Mac with en0 IP of 192.168.1.64
ffmpeg \
-hide_banner \
-re \
-fflags +genpts \
-f lavfi -i aevalsrc="sin(400*2*PI*t)" \
-ar 8000 \
-f mulaw \
-f rtp -reuse 1 "rtp://192.168.1.72:9193?reuse=1&localrtpport=16386&localrtcpport=16387" \
-protocol_whitelist udp,rtp \
-i rtp://192.168.1.64:16386 \
audio_signal_with_symmetric_rtp.mp3



Here I am simply generating a fixed sound signal and outputting it in mulaw format through rtp. I am using the 'localrtport' option to set my outbound port and I am expecting to receive the remote peer's stream on the same port. This command starts running and and waits for the incoming stream. As soon as I start transmitting the stream from my Raspberry Pi which is on the same wireless network, I get the dreaded "Address already in use." error and the process terminates. Here is the command I use on the Raspberry :


# My Raspberry Pi with wlan0 IP of 192.168.1.72
ffmpeg \
-hide_banner \
-re \
-f lavfi -i aevalsrc="sin(400*2*PI*t)" \
-ar 8000 \
-f mulaw \
-f rtp "rtp://192.168.1.64:16386?reuse=1&localrtpport=16386"



TLDR


The short form of the question comes down to this : How can I make use of symmetric RTP with FFMPEG, receive a stream from the same port I am actively transmitting another stream from ? Is what I'm asking impossible ? Should I go for an alternate route and try to set up a TURN server for my system ? Any help would be appreciated.


-
cannot hear audio after saving RTSP stream as ts or avi or mp4 files using ffmpeg command
28 mai 2022, par ewangI am still new to ffmpeg and trying to save RTSP stream from the IP camera (Meraki MV2) via RTSP link (rtsp ://192.168.0.80:9000/live) to local laptop (Windows 10) as ts file, or avi or mp4 files, but none of them can hear sound. In Meraki MV2 camera dashboard audio is enabled
meraki dashboard audio enabled screenshot


And below is the ffmpeg command i used :


ffmpeg -use_wallclock_as_timestamps 1 -rtsp_transport tcp -i rtsp://192.168.0.80:9000/live -f mpegts -b 400k -r 25 -vcodec libx264 -s 640x480 -aspect 4:3 -bufsize 6000k -acodec aac -ab 56k -ac 2 -ar 22050 -bf 0 -level 30 -y record_a_v.ts



In below part of the result log, noticed Steam mapping has a #0:1 -> #0:0 and #0:0 -> #0:1, is it supposed to be crossed or not really ?


Input #0, rtsp, from 'rtsp://192.168.0.80:9000/live':
 Metadata:
 title : www rtsp live
 comment : LIVE555 Streaming Media v2017.01.26
 Duration: N/A, start: 1653723857.755958, bitrate: N/A
 Stream #0:0: Audio: aac (LC), 48000 Hz, mono, fltp
 Stream #0:1: Video: h264 (High), yuvj420p(pc, smpte170m, progressive), 1920x1080, 90k tbr, 90k tbn
Stream mapping:
 Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
 Stream #0:0 -> #0:1 (aac (native) -> aac (native))



Here are the last section of the result log :


Last message repeated 4 times
Error while decoding stream #0:0: Invalid argument:00:09.44 bitrate= 79.3kbits/s dup=0 drop=2 speed=1.38x
 Last message repeated 1 times
[aac @ 0000027bec8ee780] Queue input is backward in time
Error while decoding stream #0:0: Invalid argument
[mpegts @ 0000027bee8cfac0] Non-monotonous DTS in output stream 0:1; previous: 868241, current: 867392; changing to 868242. This may result in incorrect timestamps in the output file.
Error while decoding stream #0:0: Invalid argument
 Last message repeated 12 times
Error while decoding stream #0:0: Invalid argument:00:09.90 bitrate= 111.7kbits/s dup=0 drop=2 speed=1.35x
 Last message repeated 6 times
Error while decoding stream #0:0: Invalid argument:00:10.51 bitrate= 121.5kbits/s dup=0 drop=2 speed=1.34x
 Last message repeated 19 times
Error while decoding stream #0:0: Invalid argument:00:11.01 bitrate= 137.9kbits/s dup=0 drop=2 speed=1.31x
 Last message repeated 10 times
Error while decoding stream #0:0: Invalid argument:00:11.51 bitrate= 145.2kbits/s dup=0 drop=2 speed=1.29x
 Last message repeated 9 times
Error while decoding stream #0:0: Invalid argument:00:12.12 bitrate= 154.5kbits/s dup=0 drop=2 speed=1.29x
 Last message repeated 21 times
Error while decoding stream #0:0: Invalid argument:00:12.50 bitrate= 167.7kbits/s dup=0 drop=2 speed=1.26x
 Last message repeated 8 times
Error while decoding stream #0:0: Invalid argument:00:13.08 bitrate= 160.2kbits/s dup=0 drop=2 speed=1.25x
 Last message repeated 11 times
Error while decoding stream #0:0: Invalid argument:00:13.61 bitrate= 154.0kbits/s dup=0 drop=2 speed=1.24x
 Last message repeated 8 times
Error while decoding stream #0:0: Invalid argument:00:14.11 bitrate= 148.5kbits/s dup=0 drop=2 speed=1.23x
 Last message repeated 16 times
Error while decoding stream #0:0: Invalid argument:00:14.61 bitrate= 143.5kbits/s dup=0 drop=2 speed=1.22x
 Last message repeated 10 times
Error while decoding stream #0:0: Invalid argument:00:15.14 bitrate= 138.4kbits/s dup=0 drop=2 speed=1.21x
 Last message repeated 18 times
Error while decoding stream #0:0: Invalid argument:00:15.62 bitrate= 134.2kbits/s dup=0 drop=2 speed= 1.2x
 Last message repeated 6 times
Error while decoding stream #0:0: Invalid argument:00:16.14 bitrate= 129.9kbits/s dup=0 drop=2 speed=1.19x
 Last message repeated 15 times
Error while decoding stream #0:0: Invalid argument:00:16.64 bitrate= 251.9kbits/s dup=0 drop=2 speed=1.19x
 Last message repeated 9 times
Error while decoding stream #0:0: Invalid argument:00:17.11 bitrate= 245.1kbits/s dup=0 drop=2 speed=1.18x
 Last message repeated 15 times
frame= 125 fps=8.3 q=27.0 size= 512kB time=00:00:17.66 bitrate= 237.5kbits/s dup=0 drop=2 speed=1.17x

[q] command received. Exiting.

frame= 125 fps=8.2 q=-1.0 Lsize= 922kB time=00:00:17.75 bitrate= 425.1kbits/s dup=0 drop=2 speed=1.16x
video:843kB audio:2kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.064729%
[libx264 @ 0000027bee8cd640] frame I:1 Avg QP:17.27 size: 54983
[libx264 @ 0000027bee8cd640] frame P:124 Avg QP:22.65 size: 6516
[libx264 @ 0000027bee8cd640] mb I I16..4: 4.2% 60.5% 35.2%
[libx264 @ 0000027bee8cd640] mb P I16..4: 0.1% 2.4% 0.4% P16..4: 39.2% 11.9% 10.2% 0.0% 0.0% skip:35.9%
[libx264 @ 0000027bee8cd640] 8x8 transform intra:77.2% inter:55.0%
[libx264 @ 0000027bee8cd640] coded y,uvDC,uvAC intra: 93.1% 91.5% 65.1% inter: 26.5% 37.1% 6.2%
[libx264 @ 0000027bee8cd640] i16 v,h,dc,p: 8% 2% 8% 81%
[libx264 @ 0000027bee8cd640] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 9% 24% 5% 16% 12% 12% 6% 6%
[libx264 @ 0000027bee8cd640] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 9% 16% 6% 11% 14% 6% 6% 6%
[libx264 @ 0000027bee8cd640] i8c dc,h,v,p: 64% 12% 20% 5%
[libx264 @ 0000027bee8cd640] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0000027bee8cd640] ref P L0: 77.9% 10.9% 7.7% 3.5%
[libx264 @ 0000027bee8cd640] kb/s:435.85
[aac @ 0000027bec8ee780] Qavg: 65536.000



Can anyone help checking where went wrong ? Thanks


-
Documentation #3374 (Nouveau) : "PHP Warning : Cannot modify header information" récurrentes
14 janvier 2015, par Eric CamusSur une machine Windows + IIS 6, avec des SPIP 3.0.17 + Sarka 3.2.28.
On subit à longueur de journée des erreurs :
[13-Jan-2015 10:29:07 Europe/Paris] PHP Warning: Cannot modify header information - headers already sent by (output started at D:\wwwwww\yyyyyyy\ecrire\public.php:154) in D:\ wwwwww\yyyyyyy \ecrire\inc\headers.php on line 152
Après une analyse du code et des essais en production, j’ai identifié que ces erreurs proviennent toutes (quel que soit le site SPIP sur les 180 actuellement en production) de l’écriture du fichier " tmp/cache/chemin.txt" qui termine le calcul de la page. Ci-dessous un debug_backtrace() :
Array ( [0] => Array ( [file] => D :\wwwwww\yyyyyyy\ecrire\inc\flock.php [line] => 233 [function] => http_status [args] => Array ( [0] => 401 )
)
[1] => Array
(
[file] => D :\wwwwww\yyyyyyy\ecrire\inc\flock.php
[line] => 193
[function] => raler_fichier
[args] => Array
(
[0] => tmp/cache/chemin.txt
))
[2] => Array
(
[file] => D :\wwwwww\yyyyyyy\ecrire\inc\utils.php
[line] => 1032
[function] => ecrire_fichier
[args] => Array
(
[0] => tmp/cache/chemin.txt
[1] => a:2 :s:32 :"6f0bd1a59e3585679ea73508e8a166ba"...
))
[3] => Array
(
[file] => D :\wwwwww\yyyyyyy\ecrire\public.php
[line] => 184
[function] => save_path_cache
[args] => Array
(
))
[4] => Array
(
[file] => D :\wwwwww\yyyyyyy\spip.php
[line] => 24
[args] => Array
(
[0] => D :\wwwwww\yyyyyyy\ecrire\public.php
)[function] => include
))
Ayant placé ce code dans la fonction " http_status " :
if(headers_sent()) // APmodif debug mode $f=$_SERVER[’DOCUMENT_ROOT’].’\debug_header.txt’ ; $out=date(’******************[d/m/Y H:i:s]’)."\r\n" ; $out.=’PHP_SELF=’.$_SERVER[’PHP_SELF’]."\r\n" ; $out.=’QUERY_STRING=’.$_SERVER[’QUERY_STRING’]."\r\n" ; $out.=’-----ob_get_contents---------------------------------------------’."\r\n".ob_get_contents()."\r\n". ’-----headers_list------------------------------------------------’."\r\n" ; $out.=print_r(headers_list(),true)."\r\n". ’-----------------------------------------------------------------’."\r\n" ; $out.=’STATUS_STRING=’.$status_string[$status]."\r\n" ; $out.=’*****FIN*********************************************************’."\r\n" ; file_put_contents($f,$out,FILE_APPEND) ; file_put_contents($_SERVER[’DOCUMENT_ROOT’].’\debug_backtrace.txt’,print_r(debug_backtrace(),true)) ; else if ($php_cgi) header("Status : ".$status_string[$status]) ; else header("HTTP/1.0 ".$status_string[$status]) ;
Un extrait de "debug_header.txt" :
******************[14/01/2015 08:40:53] PHP_SELF=/yyyyyyy/spip.php QUERY_STRING=page=style.css
ob_get_contents---------------------------------------------
headers_list------------------------------------------------
Array
(
[0] => X-Powered-By : PHP/5.4.35
[1] => Composed-By : SPIP @ www.spip.net
[2] => X-Spip-Cache : 7776000
[3] => Content-Type : text/css ; charset=iso-8859-15
[4] => Vary : Accept-Encoding
[5] => Last-Modified : Wed, 14 Jan 2015 07:40:52 GMT
)
STATUS_STRING=401 Unauthorized
*****FIN*********************************************************Cette analyse montre que ces erreurs passent toutes par l’appel de la fonction "raler_fichier" dans " ecrire_fichier" du fichier "flock.php" :
if (!$ignorer_echec) include_spip(’inc/autoriser’) ; if (autoriser(’chargerftp’)) raler_fichier($fichier) ; spip_unlink($fichier) ;
Maintenant les questions :
- Pourquoi seuls les administrateurs affichent cette erreur qui en plus arrête le processus par un "exit" dans "raler_fichier", donc les codes suivant ne sont pas exécuter (suppression et log SPIP) ? Sans compter que l’on ne voit rien car la plupart du temps elle arrive dans un fichier de CSS !!!
- Pourquoi supprimer un fichier qui n’est pas obligatoirement en erreur car c’est probablement un problème de LOCK (deux processus en même temps) ?
- Peut-on désactivé cette portion de code sans risque de problème ?Pour la part, je prends sur moi de supprimer cette portion de code.