
Recherche avancée
Autres articles (75)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Automated installation script of MediaSPIP
25 avril 2011, parTo overcome the difficulties mainly due to the installation of server side software dependencies, an "all-in-one" installation script written in bash was created to facilitate this step on a server with a compatible Linux distribution.
You must have access to your server via SSH and a root account to use it, which will install the dependencies. Contact your provider if you do not have that.
The documentation of the use of this installation script is available here.
The code of this (...)
Sur d’autres sites (6816)
-
Do I need multiple video files in different resolutions to use MPEG DASH ?
2 février 2023, par Gentil AlysonI'm trying to use Django REST Framework to serve .mpd files. When the user uploads a video, the server creates the MPD and the chunk files. However, I can't seem to able to make it work. I've tried using python-ffmpeg-video-streaming, but the client which is using dash.js to play the video will get only one bitrate (480p). I've also tried running this command
'ffmpeg -i {self.file.path} -map 0 -map 0 -c:a aac -c:v libx264 -b:v:0 800k -b:v:1 300k -var_stream_map "v:0,name:800k v:1,name:300k" -f dash -dash_segment_type mp4 -single_file 1 {file_dir}/dash.mpd'
usingos.system
from Python, but then the player gets stuck at buffering.



<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT2M30.5S" maxsegmentduration="PT5.0S" minbuffertime="PT16.6S">
 <programinformation>
 </programinformation>
 <servicedescription>
 </servicedescription>
 <period start="PT0.0S">
 <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30000/1001" maxwidth="1280" maxheight="720" par="16:9" lang="und">
 <representation mimetype="video/mp4" codecs="avc1.64001f" bandwidth="800000" width="1280" height="720" sar="1:1">
 <baseurl>dash-stream0.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="1">
 <initialization range="0-854"></initialization>
 <segmenturl mediarange="855-190364" indexrange="855-906"></segmenturl>
 <segmenturl mediarange="190365-448322" indexrange="190365-190416"></segmenturl>
 <segmenturl mediarange="448323-628609" indexrange="448323-448374"></segmenturl>
 <segmenturl mediarange="628610-741660" indexrange="628610-628661"></segmenturl>
 <segmenturl mediarange="741661-1149015" indexrange="741661-741712"></segmenturl>
 <segmenturl mediarange="1149016-1761260" indexrange="1149016-1149067"></segmenturl>
 <segmenturl mediarange="1761261-1829636" indexrange="1761261-1761312"></segmenturl>
 <segmenturl mediarange="1829637-2343368" indexrange="1829637-1829688"></segmenturl>
 <segmenturl mediarange="2343369-2759155" indexrange="2343369-2343420"></segmenturl>
 <segmenturl mediarange="2759156-3120911" indexrange="2759156-2759207"></segmenturl>
 <segmenturl mediarange="3120912-3255416" indexrange="3120912-3120963"></segmenturl>
 <segmenturl mediarange="3255417-3617692" indexrange="3255417-3255468"></segmenturl>
 <segmenturl mediarange="3617693-3910773" indexrange="3617693-3617744"></segmenturl>
 <segmenturl mediarange="3910774-4097693" indexrange="3910774-3910825"></segmenturl>
 <segmenturl mediarange="4097694-4266685" indexrange="4097694-4097745"></segmenturl>
 <segmenturl mediarange="4266686-4609479" indexrange="4266686-4266737"></segmenturl>
 <segmenturl mediarange="4609480-4719699" indexrange="4609480-4609531"></segmenturl>
 <segmenturl mediarange="4719700-4833193" indexrange="4719700-4719751"></segmenturl>
 <segmenturl mediarange="4833194-4905000" indexrange="4833194-4833245"></segmenturl>
 <segmenturl mediarange="4905001-5046627" indexrange="4905001-4905052"></segmenturl>
 </segmentlist>
 </representation>
 </adaptationset>
 <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="eng">
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audiosamplingrate="44100">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
 <baseurl>dash-stream1.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="1">
 <initialization range="0-764"></initialization>
 <segmenturl mediarange="765-82409" indexrange="765-816"></segmenturl>
 <segmenturl mediarange="82410-163592" indexrange="82410-82461"></segmenturl>
 <segmenturl mediarange="163593-244493" indexrange="163593-163644"></segmenturl>
 <segmenturl mediarange="244494-325181" indexrange="244494-244545"></segmenturl>
 <segmenturl mediarange="325182-406218" indexrange="325182-325233"></segmenturl>
 <segmenturl mediarange="406219-487174" indexrange="406219-406270"></segmenturl>
 <segmenturl mediarange="487175-568100" indexrange="487175-487226"></segmenturl>
 <segmenturl mediarange="568101-649853" indexrange="568101-568152"></segmenturl>
 <segmenturl mediarange="649854-732519" indexrange="649854-649905"></segmenturl>
 <segmenturl mediarange="732520-813751" indexrange="732520-732571"></segmenturl>
 <segmenturl mediarange="813752-895429" indexrange="813752-813803"></segmenturl>
 <segmenturl mediarange="895430-976537" indexrange="895430-895481"></segmenturl>
 <segmenturl mediarange="976538-1058579" indexrange="976538-976589"></segmenturl>
 <segmenturl mediarange="1058580-1139556" indexrange="1058580-1058631"></segmenturl>
 <segmenturl mediarange="1139557-1220802" indexrange="1139557-1139608"></segmenturl>
 <segmenturl mediarange="1220803-1301723" indexrange="1220803-1220854"></segmenturl>
 <segmenturl mediarange="1301724-1382546" indexrange="1301724-1301775"></segmenturl>
 <segmenturl mediarange="1382547-1464086" indexrange="1382547-1382598"></segmenturl>
 <segmenturl mediarange="1464087-1546573" indexrange="1464087-1464138"></segmenturl>
 <segmenturl mediarange="1546574-1627881" indexrange="1546574-1546625"></segmenturl>
 <segmenturl mediarange="1627882-1710185" indexrange="1627882-1627933"></segmenturl>
 <segmenturl mediarange="1710186-1791593" indexrange="1710186-1710237"></segmenturl>
 <segmenturl mediarange="1791594-1872889" indexrange="1791594-1791645"></segmenturl>
 <segmenturl mediarange="1872890-1954238" indexrange="1872890-1872941"></segmenturl>
 <segmenturl mediarange="1954239-2036069" indexrange="1954239-1954290"></segmenturl>
 <segmenturl mediarange="2036070-2117365" indexrange="2036070-2036121"></segmenturl>
 <segmenturl mediarange="2117366-2198435" indexrange="2117366-2117417"></segmenturl>
 <segmenturl mediarange="2198436-2279764" indexrange="2198436-2198487"></segmenturl>
 <segmenturl mediarange="2279765-2362061" indexrange="2279765-2279816"></segmenturl>
 <segmenturl mediarange="2362062-2443751" indexrange="2362062-2362113"></segmenturl>
 <segmenturl mediarange="2443752-2446358" indexrange="2443752-2443803"></segmenturl>
 </segmentlist>
 </representation>
 </adaptationset>
 <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30000/1001" maxwidth="1280" maxheight="720" par="16:9" lang="und">
 <representation mimetype="video/mp4" codecs="avc1.64001f" bandwidth="300000" width="1280" height="720" sar="1:1">
 <baseurl>dash-stream2.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="1">
 <initialization range="0-854"></initialization>
 <segmenturl mediarange="855-117134" indexrange="855-906"></segmenturl>
 <segmenturl mediarange="117135-288087" indexrange="117135-117186"></segmenturl>
 <segmenturl mediarange="288088-435178" indexrange="288088-288139"></segmenturl>
 <segmenturl mediarange="435179-520309" indexrange="435179-435230"></segmenturl>
 <segmenturl mediarange="520310-903223" indexrange="520310-520361"></segmenturl>
 <segmenturl mediarange="903224-1458808" indexrange="903224-903275"></segmenturl>
 <segmenturl mediarange="1458809-1524956" indexrange="1458809-1458860"></segmenturl>
 <segmenturl mediarange="1524957-2026894" indexrange="1524957-1525008"></segmenturl>
 <segmenturl mediarange="2026895-2406246" indexrange="2026895-2026946"></segmenturl>
 <segmenturl mediarange="2406247-2726266" indexrange="2406247-2406298"></segmenturl>
 <segmenturl mediarange="2726267-2852806" indexrange="2726267-2726318"></segmenturl>
 <segmenturl mediarange="2852807-3183174" indexrange="2852807-2852858"></segmenturl>
 <segmenturl mediarange="3183175-3467272" indexrange="3183175-3183226"></segmenturl>
 <segmenturl mediarange="3467273-3653219" indexrange="3467273-3467324"></segmenturl>
 <segmenturl mediarange="3653220-3821184" indexrange="3653220-3653271"></segmenturl>
 <segmenturl mediarange="3821185-4162978" indexrange="3821185-3821236"></segmenturl>
 <segmenturl mediarange="4162979-4273050" indexrange="4162979-4163030"></segmenturl>
 <segmenturl mediarange="4273051-4386223" indexrange="4273051-4273102"></segmenturl>
 <segmenturl mediarange="4386224-4458425" indexrange="4386224-4386275"></segmenturl>
 <segmenturl mediarange="4458426-4597502" indexrange="4458426-4458477"></segmenturl>
 </segmentlist>
 </representation>
 </adaptationset>
 <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="eng">
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="128000" audiosamplingrate="44100">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
 <baseurl>dash-stream3.mp4</baseurl>
 <segmentlist timescale="1000000" duration="5000000" startnumber="1">
 <initialization range="0-764"></initialization>
 <segmenturl mediarange="765-82409" indexrange="765-816"></segmenturl>
 <segmenturl mediarange="82410-163592" indexrange="82410-82461"></segmenturl>
 <segmenturl mediarange="163593-244493" indexrange="163593-163644"></segmenturl>
 <segmenturl mediarange="244494-325181" indexrange="244494-244545"></segmenturl>
 <segmenturl mediarange="325182-406218" indexrange="325182-325233"></segmenturl>
 <segmenturl mediarange="406219-487174" indexrange="406219-406270"></segmenturl>
 <segmenturl mediarange="487175-568100" indexrange="487175-487226"></segmenturl>
 <segmenturl mediarange="568101-649853" indexrange="568101-568152"></segmenturl>
 <segmenturl mediarange="649854-732519" indexrange="649854-649905"></segmenturl>
 <segmenturl mediarange="732520-813751" indexrange="732520-732571"></segmenturl>
 <segmenturl mediarange="813752-895429" indexrange="813752-813803"></segmenturl>
 <segmenturl mediarange="895430-976537" indexrange="895430-895481"></segmenturl>
 <segmenturl mediarange="976538-1058579" indexrange="976538-976589"></segmenturl>
 <segmenturl mediarange="1058580-1139556" indexrange="1058580-1058631"></segmenturl>
 <segmenturl mediarange="1139557-1220802" indexrange="1139557-1139608"></segmenturl>
 <segmenturl mediarange="1220803-1301723" indexrange="1220803-1220854"></segmenturl>
 <segmenturl mediarange="1301724-1382546" indexrange="1301724-1301775"></segmenturl>
 <segmenturl mediarange="1382547-1464086" indexrange="1382547-1382598"></segmenturl>
 <segmenturl mediarange="1464087-1546573" indexrange="1464087-1464138"></segmenturl>
 <segmenturl mediarange="1546574-1627881" indexrange="1546574-1546625"></segmenturl>
 <segmenturl mediarange="1627882-1710185" indexrange="1627882-1627933"></segmenturl>
 <segmenturl mediarange="1710186-1791593" indexrange="1710186-1710237"></segmenturl>
 <segmenturl mediarange="1791594-1872889" indexrange="1791594-1791645"></segmenturl>
 <segmenturl mediarange="1872890-1954238" indexrange="1872890-1872941"></segmenturl>
 <segmenturl mediarange="1954239-2036069" indexrange="1954239-1954290"></segmenturl>
 <segmenturl mediarange="2036070-2117365" indexrange="2036070-2036121"></segmenturl>
 <segmenturl mediarange="2117366-2198435" indexrange="2117366-2117417"></segmenturl>
 <segmenturl mediarange="2198436-2279764" indexrange="2198436-2198487"></segmenturl>
 <segmenturl mediarange="2279765-2362061" indexrange="2279765-2279816"></segmenturl>
 <segmenturl mediarange="2362062-2443751" indexrange="2362062-2362113"></segmenturl>
 <segmenturl mediarange="2443752-2446358" indexrange="2443752-2443803"></segmenturl>
 </segmentlist>
 </representation>
 </adaptationset>
 </period>
</mpd>





<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" mediapresentationduration="PT5M24.4S" maxsegmentduration="PT5.0S" minbuffertime="PT10.8S">
 <programinformation>
 </programinformation>
 <servicedescription>
 </servicedescription>
 <period start="PT0.0S">
 <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30/1" maxwidth="854" maxheight="480" par="16:9" lang="und">
 <representation mimetype="video/mp4" codecs="avc1.64001f" bandwidth="750000" width="854" height="480" sar="1280:1281">
 <segmenttemplate timescale="15360" initialization="dash_init_$RepresentationID$.m4s" media="dash_chunk_$RepresentationID$_$Number%05d$.m4s" startnumber="1">
 <segmenttimeline>
 <s t="0" d="95744"></s>
 <s d="93696"></s>
 <s d="117760"></s>
 <s d="126976"></s>
 <s d="152064"></s>
 <s d="109056"></s>
 <s d="128000" r="1"></s>
 <s d="110080"></s>
 <s d="105984" r="1"></s>
 <s d="96256"></s>
 <s d="114688"></s>
 <s d="122880"></s>
 <s d="106496"></s>
 <s d="113152"></s>
 <s d="126464"></s>
 <s d="91136"></s>
 <s d="77824"></s>
 <s d="115712"></s>
 <s d="93184"></s>
 <s d="154624"></s>
 <s d="129024"></s>
 <s d="141824"></s>
 <s d="116736"></s>
 <s d="92672"></s>
 <s d="106496"></s>
 <s d="153088"></s>
 <s d="121344"></s>
 <s d="130560"></s>
 <s d="87040"></s>
 <s d="81920"></s>
 <s d="128000"></s>
 <s d="99328"></s>
 <s d="128000"></s>
 <s d="159232"></s>
 <s d="158208"></s>
 <s d="78848"></s>
 <s d="112640"></s>
 <s d="95232"></s>
 <s d="168448"></s>
 <s d="167424"></s>
 <s d="40960"></s>
 </segmenttimeline>
 </segmenttemplate>
 </representation>
 </adaptationset>
 <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="eng">
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="192000" audiosamplingrate="44100">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
 <segmenttemplate timescale="44100" initialization="dash_init_$RepresentationID$.m4s" media="dash_chunk_$RepresentationID$_$Number%05d$.m4s" startnumber="1">
 <segmenttimeline>
 <s t="0" d="220160"></s>
 <s d="221184" r="62"></s>
 <s d="151552"></s>
 </segmenttimeline>
 </segmenttemplate>
 </representation>
 </adaptationset>
 <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30/1" maxwidth="1280" maxheight="720" par="16:9" lang="und">
 <representation mimetype="video/mp4" codecs="avc1.64001f" bandwidth="2048000" width="1280" height="720" sar="1:1">
 <segmenttemplate timescale="15360" initialization="dash_init_$RepresentationID$.m4s" media="dash_chunk_$RepresentationID$_$Number%05d$.m4s" startnumber="1">
 <segmenttimeline>
 <s t="0" d="96256"></s>
 <s d="93184"></s>
 <s d="117760"></s>
 <s d="78336"></s>
 <s d="106496"></s>
 <s d="123392"></s>
 <s d="80384"></s>
 <s d="128000" r="1"></s>
 <s d="109568"></s>
 <s d="164864"></s>
 <s d="128000"></s>
 <s d="181760"></s>
 <s d="91136"></s>
 <s d="84992"></s>
 <s d="127488"></s>
 <s d="103936"></s>
 <s d="101376"></s>
 <s d="77312"></s>
 <s d="115712"></s>
 <s d="93184"></s>
 <s d="154624"></s>
 <s d="129024"></s>
 <s d="132096"></s>
 <s d="126464"></s>
 <s d="92672"></s>
 <s d="107008"></s>
 <s d="152064"></s>
 <s d="122368"></s>
 <s d="130560"></s>
 <s d="85504"></s>
 <s d="82944"></s>
 <s d="128000"></s>
 <s d="99328"></s>
 <s d="128000"></s>
 <s d="161792"></s>
 <s d="155648"></s>
 <s d="78848"></s>
 <s d="113152"></s>
 <s d="119808"></s>
 <s d="144896"></s>
 <s d="116224"></s>
 <s d="83456"></s>
 <s d="7168"></s>
 </segmenttimeline>
 </segmenttemplate>
 </representation>
 </adaptationset>
 <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="eng">
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="320000" audiosamplingrate="44100">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
 <segmenttemplate timescale="44100" initialization="dash_init_$RepresentationID$.m4s" media="dash_chunk_$RepresentationID$_$Number%05d$.m4s" startnumber="1">
 <segmenttimeline>
 <s t="0" d="220160"></s>
 <s d="221184" r="62"></s>
 <s d="151552"></s>
 </segmenttimeline>
 </segmenttemplate>
 </representation>
 </adaptationset>
 <adaptationset contenttype="video" startwithsap="1" segmentalignment="true" bitstreamswitching="true" framerate="30/1" maxwidth="1920" maxheight="1080" par="16:9" lang="und">
 <representation mimetype="video/mp4" codecs="avc1.640028" bandwidth="4096000" width="1920" height="1080" sar="1:1">
 <segmenttemplate timescale="15360" initialization="dash_init_$RepresentationID$.m4s" media="dash_chunk_$RepresentationID$_$Number%05d$.m4s" startnumber="1">
 <segmenttimeline>
 <s t="0" d="86016"></s>
 <s d="103424"></s>
 <s d="95232"></s>
 <s d="95744"></s>
 <s d="111616"></s>
 <s d="123392"></s>
 <s d="80384"></s>
 <s d="128000" r="1"></s>
 <s d="109568"></s>
 <s d="157184"></s>
 <s d="92160"></s>
 <s d="145408"></s>
 <s d="79872"></s>
 <s d="85504"></s>
 <s d="92160"></s>
 <s d="82944"></s>
 <s d="81408"></s>
 <s d="168960"></s>
 <s d="138240"></s>
 <s d="83456"></s>
 <s d="99328"></s>
 <s d="120320"></s>
 <s d="126464"></s>
 <s d="132608"></s>
 <s d="121856"></s>
 <s d="96768"></s>
 <s d="90112"></s>
 <s d="169472"></s>
 <s d="121856"></s>
 <s d="137216"></s>
 <s d="119808"></s>
 <s d="177152"></s>
 <s d="92160"></s>
 <s d="128000"></s>
 <s d="161792"></s>
 <s d="156160"></s>
 <s d="78336"></s>
 <s d="77824"></s>
 <s d="84480"></s>
 <s d="104960"></s>
 <s d="110592"></s>
 <s d="98304"></s>
 <s d="108544"></s>
 </segmenttimeline>
 </segmenttemplate>
 </representation>
 </adaptationset>
 <adaptationset contenttype="audio" startwithsap="1" segmentalignment="true" bitstreamswitching="true" lang="eng">
 <representation mimetype="audio/mp4" codecs="mp4a.40.2" bandwidth="320000" audiosamplingrate="44100">
 <audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
 <segmenttemplate timescale="44100" initialization="dash_init_$RepresentationID$.m4s" media="dash_chunk_$RepresentationID$_$Number%05d$.m4s" startnumber="1">
 <segmenttimeline>
 <s t="0" d="220160"></s>
 <s d="221184" r="62"></s>
 <s d="151552"></s>
 </segmenttimeline>
 </segmenttemplate>
 </representation>
 </adaptationset>
 </period>
</mpd>



Do I really need multiple video files in different resolutions ? If not, then how would I go about making the necessary files ? Thanks in advance !


-
VideoWriter Doesn't work using openCV, ubuntu, Qt
25 janvier 2023, par underflow223My code :


cv::VideoWriter(
 strFile.toStdString(),
 cv::VideoWriter::fourcc('m','p','4','v'),
 nfps,
 cv::Size(1920/nresize, 1080/nresize)
);



Error message :


[mpeg4_v4l2m2m @ 0x7f50a43c50] arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '7'.
Could not find a valid device
[mpeg4_v4l2m2m @ 0x7f50a43c50] can't configure encoder



If I use MJPG codec, it works fine thow.


This is OPENCV configure info :


-- General configuration for OpenCV 4.6.0 =====================================
-- Version control: unknown
-- 
-- Extra modules:
-- Location (extra): /home/firefly/Downloads/opencv_contrib-4.6.0/modules
-- Version control (extra): unknown
-- 
-- Platform:
-- Timestamp: 2023-01-19T02:11:26Z
-- Host: Linux 5.10.110 aarch64
-- CMake: 3.16.3
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: Release
-- 
-- CPU/HW features:
-- Baseline: NEON FP16
-- 
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ standard: 11
-- C++ Compiler: /usr/bin/c++ (ver 9.4.0)
-- C++ flags (Release): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -g -O0 -DDEBUG -D_DEBUG
-- C Compiler: /usr/bin/cc
-- C flags (Release): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections -fvisibility=hidden -g -O0 -DDEBUG -D_DEBUG
-- Linker flags (Release): -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
-- Linker flags (Debug): -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined 
-- ccache: NO
-- Precompiled headers: NO
-- Extra dependencies: dl m pthread rt
-- 3rdparty dependencies:
-- 
-- OpenCV modules:
-- To be built: aruco barcode bgsegm bioinspired calib3d ccalib core datasets dnn dnn_objdetect dnn_superres dpm face features2d flann freetype fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
-- Disabled: world
-- Disabled by dependency: -
-- Unavailable: alphamat cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev cvv hdf java julia matlab ovis python2 python3 sfm viz
-- Applications: tests perf_tests apps
-- Documentation: NO
-- Non-free algorithms: NO
-- 
-- GUI: GTK3
-- GTK+: YES (ver 3.24.20)
-- GThread : YES (ver 2.64.6)
-- GtkGlExt: NO
-- VTK support: NO
-- 
-- Media I/O: 
-- ZLib: /usr/lib/aarch64-linux-gnu/libz.so (ver 1.2.11)
-- JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so (ver 80)
-- WEBP: build (ver encoder: 0x020f)
-- PNG: /usr/lib/aarch64-linux-gnu/libpng.so (ver 1.6.37)
-- TIFF: /usr/lib/aarch64-linux-gnu/libtiff.so (ver 42 / 4.1.0)
-- JPEG 2000: build (ver 2.4.0)
-- OpenEXR: build (ver 2.3.0)
-- HDR: YES
-- SUNRASTER: YES
-- PXM: YES
-- PFM: YES
-- 
-- Video I/O:
-- DC1394: YES (2.2.5)
-- FFMPEG: YES
-- avcodec: YES (58.54.100)
-- avformat: YES (58.29.100)
-- avutil: YES (56.31.100)
-- swscale: YES (5.5.100)
-- avresample: YES (4.0.0)
-- GStreamer: YES (1.16.2)
-- v4l/v4l2: YES (linux/videodev2.h)
-- 
-- Parallel framework: pthreads
-- 
-- Trace: YES (with Intel ITT)
-- 
-- Other third-party libraries:
-- Lapack: NO
-- Eigen: NO
-- Custom HAL: YES (carotene (ver 0.0.1))
-- Protobuf: build (3.19.1)
-- 
-- OpenCL: YES (no extra features)
-- Include path: /home/firefly/Downloads/opencv-4.6.0/3rdparty/include/opencl/1.2
-- Link libraries: Dynamic load
-- 
-- Python (for build): /usr/bin/python2.7
-- 
-- Java: 
-- ant: NO
-- JNI: NO
-- Java wrappers: NO
-- Java tests: NO
-- 
============================================================================================



ffmpeg info :


============================================================================================
ffmpeg
ffmpeg version 4.2.4-1ubuntu1.0firefly5 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
 configuration: --prefix=/usr --extra-version=1ubuntu1.0firefly5 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-librga --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared --disable-doc
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavdevice 58. 8.100 / 58. 8.100
 libavfilter 7. 57.100 / 7. 57.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
 libpostproc 55. 5.100 / 55. 5.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
====================================================================================



-
ffmpeg realtime bad quality variable fps cams inputs to constant framerate problem
23 janvier 2023, par BloodMan../ffmpeg/ffmpeg -err_detect ignore_err -nostdin -threads 0 -y -strict experimental -thread_queue_size 10M -max_delay 20M -rtbufsize 20M -fflags +discardcorrupt \
 -i "${cam1}" -i "${cam2}" -i "${cam3}" -i "${cam4}" \
 -filter_complex " \
 nullsrc=size=3840x2160:rate=30 [main1]; \
 anullsrc=channel_layout=stereo:sample_rate=44100 [a]; \
 [0:v] scale=1920:1080 [overlay1]; \
 [1:v] scale=1920:1080 [overlay2]; \
 [2:v] scale=1920:1080 [overlay3]; \
 [3:v] scale=1920:1080 [overlay4]; \
 [main1][overlay1] overlay=0:0 [main2]; \
 [main2][overlay2] overlay=1920:0 [main3]; \
 [main3][overlay3] overlay=0:1080 [main4]; \
 [main4][overlay4] overlay=1920:1080 [v] " \
 -t 10 -r 30 -g 60 -map "[v]" -map "[a]" \
 -shortest -video_size 3840x2160 -pix_fmt yuv420p -vcodec libx264 -preset ultrafast -tune zerolatency -minrate 2M -maxrate 2M -bufsize 20M -c:a aac -b:a 96k -ac 2 -ar 48000 -copytb 1 \
 -f flv -y -fflags +genpts rtmp://b.rtmp.youtube.com/live2/${key}?backup=1



ffmpeg version N-109650-g9d5e66942c Copyright (c) 2000-2023 the FFmpeg developers
 built with gcc 10 (Debian 10.2.1-6)
 configuration: --prefix=/home/bloodman/ffmpeg --pkg-config-flags=--static --extra-cflags='-I/home/bloodman/ffmpeg/include -march=native' --extra-ldflags=-L/home/bloodman/ffmpeg/lib --extra-libs='-lpthread -lm' --bindir=/home/bloodman/ffmpeg --enable-gpl --enable-nonfree --enable-libx264 --enable-libfdk-aac --enable-libmp3lame --enable-libfreetype --enable-hardcoded-tables
 libavutil 57. 44.100 / 57. 44.100
 libavcodec 59. 56.100 / 59. 56.100
 libavformat 59. 35.100 / 59. 35.100
 libavdevice 59. 8.101 / 59. 8.101
 libavfilter 8. 54.100 / 8. 54.100
 libswscale 6. 8.112 / 6. 8.112
 libswresample 4. 9.100 / 4. 9.100
 libpostproc 56. 7.100 / 56. 7.100
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db77780] Opening 'cams/stream1_113.ts' for reading
Input #0, hls, from 'cams/stream1.m3u8':
 Duration: N/A, start: 1122.341667, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #0:0: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), yuv420p, 2048x1536, 15 fps, 15 tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
[hls @ 0x56019db9e980] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db9e980] Opening 'cams/stream2_105.ts' for reading
Input #1, hls, from 'cams/stream2.m3u8':
 Duration: N/A, start: 1042.633000, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #1:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 100 tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
[hls @ 0x56019dccdbc0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019dccdbc0] Opening 'cams/stream3_14.ts' for reading
Input #2, hls, from 'cams/stream3.m3u8':
 Duration: N/A, start: 132.469000, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #2:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 2688x1520, 25 fps, 100 tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
[hls @ 0x56019f0ec980] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019f0ec980] Opening 'cams/stream4_26.ts' for reading
Input #3, hls, from 'cams/stream4.m3u8':
 Duration: N/A, start: 253.389000, bitrate: N/A
 Program 0
 Metadata:
 variant_bitrate : 0
 Stream #3:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709), 1920x1080, 90k tbr, 90k tbn
 Metadata:
 variant_bitrate : 0
Stream mapping:
 Stream #0:0 (h264) -> scale:default
 Stream #1:0 (h264) -> scale:default
 Stream #2:0 (h264) -> scale:default
 Stream #3:0 (h264) -> scale:default
 overlay:default -> Stream #0:0 (libx264)
 anullsrc:default -> Stream #0:1 (aac)
[hls @ 0x56019db77780] Opening 'cams/stream1_114.ts' for reading
[hls @ 0x56019db77780] Opening 'cams/stream1_115.ts' for reading
[swscaler @ 0x5601a2c78e40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5601a332c940] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5601a2c78e40] deprecated pixel format used, make sure you did set range correctly
 Last message repeated 2 times
[swscaler @ 0x5601a332c940] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x5601a361fc00] deprecated pixel format used, make sure you did set range correctly
 Last message repeated 1 times
[libx264 @ 0x56019e5212c0] using SAR=1/1
[libx264 @ 0x56019e5212c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
[libx264 @ 0x56019e5212c0] profile Constrained Baseline, level 5.1, 4:2:0, 8-bit
[libx264 @ 0x56019e5212c0] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8 lookahead_threads=8 sliced_threads=1 slices=8 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=60 keyint_min=6 scenecut=0 intra_refresh=0 rc_lookahead=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2000 vbv_bufsize=20000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=0
Output #0, flv, to 'rtmp://b.rtmp.youtube.com/live2/XXXX-XXXX-XXXX-XXXX-XXXX?backup=1':
 Metadata:
 encoder : Lavf59.35.100
 Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(progressive), 3840x2160 [SAR 1:1 DAR 16:9], q=2-31, 30 fps, 1k tbn
 Metadata:
 encoder : Lavc59.56.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 2000000/0/0 buffer size: 20000000 vbv_delay: N/A
 Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 96 kb/s
 Metadata:
 encoder : Lavc59.56.100 aac
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')00:00:03.22 bitrate=7519.6kbits/s speed=0.359x
[hls @ 0x56019db77780] Opening 'cams/stream1_116.ts' for reading
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')00:00:07.23 bitrate=4470.2kbits/s speed=0.383x
[hls @ 0x56019db77780] Opening 'cams/stream1_117.ts' for reading
[hls @ 0x56019f0ec980] Skip ('#EXT-X-VERSION:3')00:00:09.04 bitrate=3978.1kbits/s speed=0.384x
[hls @ 0x56019f0ec980] Opening 'cams/stream4_27.ts' for reading
[hls @ 0x56019dccdbc0] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019dccdbc0] Opening 'cams/stream3_15.ts' for reading
[hls @ 0x56019db9e980] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db9e980] Opening 'cams/stream2_106.ts' for reading
[flv @ 0x56019e639a00] Failed to update header with correct duration.811.6kbits/s speed=0.385x
[flv @ 0x56019e639a00] Failed to update header with correct filesize.
frame= 299 fps= 12 q=34.0 Lsize= 4622kB time=00:00:09.98 bitrate=3792.7kbits/s speed=0.386x
video:4603kB audio:3kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.349536%
[libx264 @ 0x56019e5212c0] frame I:5 Avg QP:45.60 size:275880
[libx264 @ 0x56019e5212c0] frame P:294 Avg QP:38.77 size: 11340
[libx264 @ 0x56019e5212c0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 0x56019e5212c0] mb P I16..4: 1.4% 0.0% 0.0% P16..4: 4.7% 0.0% 0.0% 0.0% 0.0% skip:93.9%
[libx264 @ 0x56019e5212c0] coded y,uvDC,uvAC intra: 16.2% 8.9% 1.2% inter: 1.8% 0.6% 0.0%
[libx264 @ 0x56019e5212c0] i16 v,h,dc,p: 64% 17% 15% 5%
[libx264 @ 0x56019e5212c0] i8c dc,h,v,p: 90% 6% 3% 1%
[libx264 @ 0x56019e5212c0] kb/s:3783.23
[aac @ 0x56019e63a700] Qavg: 65511.207
[hls @ 0x56019db77780] Skip ('#EXT-X-VERSION:3')
[hls @ 0x56019db77780] Opening 'cams/stream1_118.ts' for reading



NOTES : sources are cams streamed first to hls/m3u8. -t 10 only for testing purposes.


The problem is variable output fps= 12 (sometimes 2, 5, 10, maybe 13) where I expect 30. Machine is 10 times greater (encode uses up to 5% cpu).


Im trying adding -re, -r 30, -r 15 to sources, convert sources via stream_filter (,fps=30), vsync (old versions of ffmpeg), wallclock time, etc. and reading stackoverflow of course. And... nothing.


Where is the problem ?