
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (7)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...) -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)
Sur d’autres sites (4194)
-
How to calculate vmaf score of multi-resolution webm using ffmpeg ?
13 juillet 2022, par willI’m trying to calculate the
vmaf
of two videos, one isavi
(rawvideo(I420), yuv420p), the other iswebm
(vp8, yuv420p). I uploaded test video and vmaf log here.

But I found that if it’s a multi-resolution webm, the scores obtained with and without fps filter are quite different. Without fps filter the vmaf score is
34.670390
, with fps filter the vmaf score is56.339923
.

If it‘s a single resolution webm, there is no significant difference between the scores obtained with and without fps filter. Without fps filter the vmaf score is
65.527304
, with fps filter the vmaf score is65.480217
.

I use these commands.


without fps filter


ffmpeg \
 -r 15 -i reference.avi \
 -r 15 -i distorted.webm \
 -lavfi "[0:v]setpts=PTS-STARTPTS[reference]; \
 [1:v]scale=1920:1080:flags=bicubic,setpts=PTS-STARTPTS[distorted]; \
 [distorted][reference]libvmaf=log_fmt=json:log_path=vmaf_without_fps.log:model_path=vmaf_v0.6.1.json:n_threads=10:ssim=1:psnr=1" \
 -f null -



ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 12.0.0 (clang-1200.0.32.29)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, avi, from 'reference.avi':
 Metadata:
 software : Lavf58.76.100
 Duration: 00:00:26.13, start: 0.000000, bitrate: 373260 kb/s
 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 374202 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
Input #1, matroska,webm, from 'distorted.webm':
 Metadata:
 encoder : Chrome
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
 Stream #1:1(eng): Video: vp8, yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc (default)
 Metadata:
 alpha_mode : 1
Stream mapping:
 Stream #0:0 (rawvideo) -> setpts (graph 0)
 Stream #1:1 (vp8) -> scale (graph 0)
 libvmaf (graph 0) -> Stream #0:0 (wrapped_avframe)
 Stream #1:0 -> #0:1 (opus (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version
Output #0, null, to 'pipe:':
 Metadata:
 software : Lavf58.76.100
 encoder : Lavf58.76.100
 Stream #0:0: Video: wrapped_avframe, yuv420p(tv, bt470bg/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 15 fps, 15 tbn (default)
 Metadata:
 encoder : Lavc58.134.100 wrapped_avframe
 Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
 Metadata:
 encoder : Lavc58.134.100 pcm_s16le
[libvmaf @ 0x7feb8a606a80] VMAF score: 58.1203705.87 bitrate=N/A speed= 5.6x 
libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 0
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 1
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 2
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 3
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 4
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 5
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 6
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 7
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 8
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 9
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 10
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 11
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 12
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 13
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 14
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 15
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 16
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 17
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 18
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 19
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 20
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 21
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 22
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 23
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 24
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 25
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 26
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 27
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 28
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 29
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 30
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 31
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 32
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 33
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 34
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 35
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 36
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 37
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 38
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 39
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 40
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 41
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 42
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 43
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 44
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 45
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 46
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 47
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 48
[null @ 0x7feb8b04da00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 49 >= 49
frame= 392 fps= 36 q=-0.0 Lsize=N/A time=00:00:28.73 bitrate=N/A speed= 2.6x 
video:205kB audio:5400kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libvmaf @ 0x7feb8c405bc0] VMAF score: 34.670390



with fps filter


ffmpeg \
 -r 15 -i reference.avi \
 -r 15 -i distorted.webm \
 -lavfi "[0:v]setpts=PTS-STARTPTS[reference]; \
 [1:v]fps=fps=15,scale=1920:1080:flags=bicubic,setpts=PTS-STARTPTS[distorted]; \
 [distorted][reference]libvmaf=log_fmt=json:log_path=vmaf_with_fps.log:model_path=vmaf_v0.6.1.json:n_threads=10:ssim=1:psnr=1" \
 -f null -



ffmpeg version 4.4.1 Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 12.0.0 (clang-1200.0.32.29)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, avi, from 'reference.avi':
 Metadata:
 software : Lavf58.76.100
 Duration: 00:00:26.13, start: 0.000000, bitrate: 373260 kb/s
 Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080, 374202 kb/s, 15 fps, 15 tbr, 15 tbn, 15 tbc
Input #1, matroska,webm, from 'distorted.webm':
 Metadata:
 encoder : Chrome
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #1:0(eng): Audio: opus, 48000 Hz, stereo, fltp (default)
 Stream #1:1(eng): Video: vp8, yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 1k tbr, 1k tbn, 1k tbc (default)
 Metadata:
 alpha_mode : 1
Stream mapping:
 Stream #0:0 (rawvideo) -> setpts (graph 0)
 Stream #1:1 (vp8) -> fps (graph 0)
 libvmaf (graph 0) -> Stream #0:0 (wrapped_avframe)
 Stream #1:0 -> #0:1 (opus (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version
Output #0, null, to 'pipe:':
 Metadata:
 software : Lavf58.76.100
 encoder : Lavf58.76.100
 Stream #0:0: Video: wrapped_avframe, yuv420p(tv, bt470bg/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 15 fps, 15 tbn (default)
 Metadata:
 encoder : Lavc58.134.100 wrapped_avframe
 Stream #0:1(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s (default)
 Metadata:
 encoder : Lavc58.134.100 pcm_s16le
[libvmaf @ 0x7fdeab00bac0] VMAF score: 58.3160815.27 bitrate=N/A speed=5.08x 
libvmaf INFO `compute_vmaf()` is deprecated and will be removed in a future libvmaf version
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 0
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 1
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 2
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 3
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 4
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 5
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 6
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 7
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 8
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 9
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 10
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 11
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 12
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 13
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 14
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 15
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 16
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 17
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 18
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 19
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 20
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 21
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 22
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 23
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 24
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 25
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 26
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 27
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 28
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 29
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 30
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 31
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 32
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 33
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 34
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 35
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 36
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 37
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 38
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 39
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 40
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 41
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 42
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 43
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 44
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 45
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 46
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 47
[null @ 0x7fdeab84ba00] Application provided invalid, non monotonically increasing dts to muxer in stream 0: 48 >= 48
frame= 391 fps= 36 q=-0.0 Lsize=N/A time=00:00:28.73 bitrate=N/A speed=2.62x 
video:205kB audio:5400kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libvmaf @ 0x7fdea9f34a00] VMAF score: 56.339923



I'm curious about what causes such a difference ? And how to calculate vmaf score of multi-resolution webm correctly ?


-
RTMP server with OpenCV (python)
12 février 2024, par OvernoutI'm trying to process an RTMP stream in Python, using OpenCV2 but I'm not able to get OpenCV to capture it (i.e. act as RTMP server).


I can run FFmpeg/FFplay from the command line and receive the stream successfully.
What could cause OpenCV to fail opening the stream in listening mode ?


Here is my code :


import cv2

cap = cv2.VideoCapture("rtmp://0.0.0.0:8000/live", cv2.CAP_FFMPEG)

if not cap.isOpened():
 print("Cannot open video source")
 exit()



And the output :


[tcp @ 00000192c490d640] Connection to tcp://0.0.0.0:8000 failed: Error number -138 occurred
[rtmp @ 00000192c490d580] Cannot open connection tcp://0.0.0.0:8000 
Cannot open video source



edit2 : Output with debug logging turned on :


output of the python script with debug logging on:
[DEBUG:0@0.017] global videoio_registry.cpp:218 cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Builtin backends(9): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930); OBSENSOR(920)
[DEBUG:0@0.026] global videoio_registry.cpp:242 cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Available backends(9): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930); OBSENSOR(920)
[ INFO:0@0.031] global videoio_registry.cpp:244 cv::`anonymous-namespace'::VideoBackendRegistry::VideoBackendRegistry VIDEOIO: Enabled backends(9, sorted by priority): FFMPEG(1000); GSTREAMER(990); INTEL_MFX(980); MSMF(970); DSHOW(960); CV_IMAGES(950); CV_MJPEG(940); UEYE(930); OBSENSOR(920)
[ WARN:0@0.037] global cap.cpp:132 cv::VideoCapture::open VIDEOIO(FFMPEG): trying capture filename='rtmp://192.168.254.101:8000/live' ...
[ INFO:0@0.040] global backend_plugin.cpp:383 cv::impl::getPluginCandidates Found 2 plugin(s) for FFMPEG
[ INFO:0@0.043] global plugin_loader.impl.hpp:67 cv::plugin::impl::DynamicLib::libraryLoad load C:\Users\me\src\opencv\.venv\Lib\site-packages\cv2\opencv_videoio_ffmpeg490_64.dll => OK
[ INFO:0@0.047] global backend_plugin.cpp:50 cv::impl::PluginBackend::initCaptureAPI Found entry: 'opencv_videoio_capture_plugin_init_v1'
[ INFO:0@0.049] global backend_plugin.cpp:169 cv::impl::PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Capture plugin': built with OpenCV 4.9 (ABI/API = 1/1), current OpenCV version is '4.9.0' (ABI/API = 1/1)
[ INFO:0@0.055] global backend_plugin.cpp:69 cv::impl::PluginBackend::initCaptureAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Capture plugin'
[ INFO:0@0.058] global backend_plugin.cpp:84 cv::impl::PluginBackend::initWriterAPI Found entry: 'opencv_videoio_writer_plugin_init_v1'
[ INFO:0@0.061] global backend_plugin.cpp:169 cv::impl::PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Writer plugin': built with OpenCV 4.9 (ABI/API = 1/1), current OpenCV version is '4.9.0' (ABI/API = 1/1)
[ INFO:0@0.065] global backend_plugin.cpp:103 cv::impl::PluginBackend::initWriterAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Writer plugin'
[tcp @ 00000266b2f0d0c0] Connection to tcp://192.168.254.101:8000 failed: Error number -138 occurred
[rtmp @ 00000266b2f0cfc0] Cannot open connection tcp://192.168.254.101:8000
[ WARN:0@5.630] global cap.cpp:155 cv::VideoCapture::open VIDEOIO(FFMPEG): can't create capture
[DEBUG:0@5.632] global cap.cpp:225 cv::VideoCapture::open VIDEOIO: choosen backend does not work or wrong. Please make sure that your computer support chosen backend and OpenCV built with right flags.
Cannot open video source
[ INFO:1@5.661] global plugin_loader.impl.hpp:74 cv::plugin::impl::DynamicLib::libraryRelease unload C:\Users\me\src\opencv\.venv\Lib\site-packages\cv2\opencv_videoio_ffmpeg490_64.dll



Here is the output of cv2.getBuildInformation()


General configuration for OpenCV 4.9.0 =====================================
 Version control: 4.9.0

 Platform:
 Timestamp: 2023-12-31T11:21:12Z
 Host: Windows 10.0.17763 AMD64
 CMake: 3.24.2
 CMake generator: Visual Studio 14 2015
 CMake build tool: MSBuild.exe
 MSVC: 1900
 Configuration: Debug Release

 CPU/HW features:
 Baseline: SSE SSE2 SSE3
 requested: SSE3
 Dispatched code generation: SSE4_1 SSE4_2 FP16 AVX AVX2
 requested: SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
 SSE4_1 (16 files): + SSSE3 SSE4_1
 SSE4_2 (1 files): + SSSE3 SSE4_1 POPCNT SSE4_2
 FP16 (0 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
 AVX (8 files): + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
 AVX2 (36 files): + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2

 C/C++:
 Built as dynamic libs?: NO
 C++ standard: 11
 C++ Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe (ver 19.0.24247.2)
 C++ flags (Release): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP /O2 /Ob2 /DNDEBUG 
 C++ flags (Debug): /DWIN32 /D_WINDOWS /W4 /GR /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP /Zi /Ob0 /Od /RTC1 
 C Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
 C flags (Release): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /O2 /Ob2 /DNDEBUG 
 C flags (Debug): /DWIN32 /D_WINDOWS /W3 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi /fp:precise /MP /Zi /Ob0 /Od /RTC1 
 Linker flags (Release): /machine:x64 /NODEFAULTLIB:atlthunk.lib /INCREMENTAL:NO /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libcpmtd.lib /NODEFAULTLIB:msvcrtd.lib
 Linker flags (Debug): /machine:x64 /NODEFAULTLIB:atlthunk.lib /debug /INCREMENTAL /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:libcpmt.lib /NODEFAULTLIB:msvcrt.lib
 ccache: NO
 Precompiled headers: YES
 Extra dependencies: wsock32 comctl32 gdi32 ole32 setupapi ws2_32
 3rdparty dependencies: libprotobuf ade ittnotify libjpeg-turbo libwebp libpng libtiff libopenjp2 IlmImf zlib ippiw ippicv

 OpenCV modules:
 To be built: calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
 Disabled: java world
 Disabled by dependency: -
 Unavailable: python2 ts
 Applications: -
 Documentation: NO
 Non-free algorithms: NO

 Windows RT support: NO

 GUI: WIN32UI
 Win32 UI: YES
 VTK support: NO

 Media I/O: 
 ZLib: build (ver 1.3)
 JPEG: build-libjpeg-turbo (ver 2.1.3-62)
 SIMD Support Request: YES
 SIMD Support: NO
 WEBP: build (ver encoder: 0x020f)
 PNG: build (ver 1.6.37)
 TIFF: build (ver 42 - 4.2.0)
 JPEG 2000: build (ver 2.5.0)
 OpenEXR: build (ver 2.3.0)
 HDR: YES
 SUNRASTER: YES
 PXM: YES
 PFM: YES

 Video I/O:
 DC1394: NO
 FFMPEG: YES (prebuilt binaries)
 avcodec: YES (58.134.100)
 avformat: YES (58.76.100)
 avutil: YES (56.70.100)
 swscale: YES (5.9.100)
 avresample: YES (4.0.0)
 GStreamer: NO
 DirectShow: YES
 Media Foundation: YES
 DXVA: YES

 Parallel framework: Concurrency

 Trace: YES (with Intel ITT)

 Other third-party libraries:
 Intel IPP: 2021.11.0 [2021.11.0]
 at: D:/a/opencv-python/opencv-python/_skbuild/win-amd64-3.7/cmake-build/3rdparty/ippicv/ippicv_win/icv
 Intel IPP IW: sources (2021.11.0)
 at: D:/a/opencv-python/opencv-python/_skbuild/win-amd64-3.7/cmake-build/3rdparty/ippicv/ippicv_win/iw
 Lapack: NO
 Eigen: NO
 Custom HAL: NO
 Protobuf: build (3.19.1)
 Flatbuffers: builtin/3rdparty (23.5.9)

 OpenCL: YES (NVD3D11)
 Include path: D:/a/opencv-python/opencv-python/opencv/3rdparty/include/opencl/1.2
 Link libraries: Dynamic load

 Python 3:
 Interpreter: C:/hostedtoolcache/windows/Python/3.7.9/x64/python.exe (ver 3.7.9)
 Libraries: C:/hostedtoolcache/windows/Python/3.7.9/x64/libs/python37.lib (ver 3.7.9)
 numpy: C:/hostedtoolcache/windows/Python/3.7.9/x64/lib/site-packages/numpy/core/include (ver 1.17.0)
 install path: python/cv2/python-3

 Python (for build): C:\hostedtoolcache\windows\Python\3.7.9\x64\python.exe

 Java: 
 ant: NO
 Java: YES (ver 1.8.0.392)
 JNI: C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/include C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/include/win32 C:/hostedtoolcache/windows/Java_Temurin-Hotspot_jdk/8.0.392-8/x64/include
 Java wrappers: NO
 Java tests: NO

 Install to: D:/a/opencv-python/opencv-python/_skbuild/win-amd64-3.7/cmake-install
-----------------------------------------------------------------



edit : Receiving the stream with ffplay from command line :


>ffplay.exe -i "rtmp://0.0.0.0:8000/live" -listen 1 -f flv
ffplay version 2024-02-04-git-7375a6ca7b-full_build-www.gyan.dev Copyright (c) 2003-2024 the FFmpeg developers
 built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --pkg-config=pkgconf --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libaribb24 --enable-libaribcaption --enable-libdav1d --enable-libdavs2 --enable-libuavs3d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libaom --enable-libjxl --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libharfbuzz --enable-liblensfun --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-dxva2 --enable-d3d11va --enable-libvpl --enable-libshaderc --enable-vulkan --enable-libplacebo --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libcodec2 --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 libavutil 58. 36.101 / 58. 36.101
 libavcodec 60. 38.100 / 60. 38.100
 libavformat 60. 20.100 / 60. 20.100
 libavdevice 60. 4.100 / 60. 4.100
 libavfilter 9. 17.100 / 9. 17.100
 libswscale 7. 6.100 / 7. 6.100
 libswresample 4. 13.100 / 4. 13.100
 libpostproc 57. 4.100 / 57. 4.100
[rtmp @ 0000018a564ed340] Unexpected stream , expecting livef=0/0
 Last message repeated 1 times
Input #0, flv, from 'rtmp://0.0.0.0:8000/live':KB sq= 0B f=0/0
 Metadata:
 fileSize : 0
 audiochannels : 2
 2.1 : false
 3.1 : false
 4.0 : false
 4.1 : false
 5.1 : false
 7.1 : false
 encoder : obs-output module (libobs version 30.0.2)
 Duration: 00:00:00.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 163 kb/s
 Stream #0:1: Video: h264 (Constrained Baseline), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 2560 kb/s, 30 fps, 30 tbr, 1k tbn
 7.54 A-V: -0.024 fd= 18 aq= 24KB vq= 498KB sq= 0B f=0/0



-
ffmpeg 4.4 problem with image2 combined with stream loop -1 and overlay
14 mai 2021, par codeSamI have a python app and my code to stream ffmpeg is :


'ffmpeg',
'-thread_queue_size', '1024',
'-i', 'rtsp://...',
'-f', 'image2',
'-stream_loop', '-1',
'-i', 'image.png',
'-filter_complex', 'overlay=(main_w-overlay_w)/2:main_h*0.1-overlay_h',
'-acodec', 'aac',
'-ar', '44100',
'-ab', '128k',
'-f', 'flv',
'-g', '30',
'-vcodec', 'libx264',
'-preset', 'ultrafast',
'-crf', '30',
'rtmp://...'



Works fine on ffmpeg 4.3.2. But after ffmpeg updated to 4.4 the stream doesn't start at all. If I change stream_loop -1 to loop 1 the stream starts but as I want to update the image.png like every 10 seconds or so, it stops being updated on the stream. That is probably because new image.png is being saved at the same time it is being read. stream_loop doesn't mind this as I have understood.


Also if I delay image.png start with -ss -5, the stream starts with main video from rtsp ://... but it stops when image.png starts to be read.


Also if I remove -f image2 from the code, the stream starts fine but image.png is not being updated to the stream.


Would be easy to downgrade ffmpeg to the older 4.3.2 version but it is not possible as I want this thing to run on Android device in Termux. Termux has only the latest ffmpeg 4.4 available.


Any ideas how to make this work on ffmpeg 4.4.


Here is what is printed out when I run the command above. The stream does not start. This is done with Termux in Android device. Stream does not start in my Mac Book Pro's ffmpeg 4.4 either, in that 4.3.2 is ok.


ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
 built with Android (6454773 based on r365631c2) clang version 9.0.8 
(https://android.googlesource.com/toolchain/llvm-project 98c855489587874b2a325e7a516b99d838599c6f) (based on LLVM 9.0.8svn)
 configuration: --arch=aarch64 --as=aarch64-linux-android-clang --cc=aarch64-linux-android-clang
 --cxx=aarch64-linux-android-clang++ --cross-prefix=aarch64-linux-android- --disable-indevs 
 --disable-outdevs --enable-indev=lavfi --disable-static --disable-symver --enable-cross-compile 
 --enable-gnutls --enable-gpl --enable-libass --enable-libdav1d --enable-libmp3lame 
 --enable-libfreetype --enable-libvorbis --enable-libopus --enable-libx264 --enable-libx265 
 --enable-libxvid --enable-libvpx --enable-shared --enable-libsoxr --enable-libvidstab 
 --enable-libwebp --prefix=/data/data/com.termux/files/usr --target-os=android 
 --extra-libs=-landroid-glob --enable-neon
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
[udp @ 0x7ebe823840] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 0x7ebe8238e0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 0x7ebe823a20] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 0x7ebe823ac0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)

Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, rtsp, from 'rtsp://...':
 Metadata:
 title : Session streamed by "TP-LINK RTSP Server"
 comment : stream1
 Duration: N/A, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: h264 (High), yuvj420p(pc, bt709, progressive), 1920x1080, 15 fps, 15 tbr, 90k tbn, 30 tbc
 Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Input #1, image2, from 'image.png':
 Duration: 00:00:00.04, start: 0.000000, bitrate: N/A
 Stream #1:0: Video: png, rgba(pc), 1152x87 [SAR 8504:8504 DAR 384:29], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
 Stream #0:0 (h264) -> overlay:main (graph 0)
 Stream #1:0 (png) -> overlay:overlay (graph 0)
 overlay (graph 0) -> Stream #0:0 (libx264)
 Stream #0:1 -> #0:1 (pcm_alaw (native) -> aac (native))
Press [q] to stop, [?] for help