
Recherche avancée
Médias (10)
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon seed (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
The four of us are dying (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Corona radiata (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Lights in the sky (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (50)
-
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 -
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)
Sur d’autres sites (7285)
-
Live video in facebook is lagging while using ffmpeg from video link
1er septembre 2022, par Isteyak AliLivevideo in facebook is working fine for local device video(case 1) but its having lagging issue from video link(case 2) using FFMPEG.


Please find command for the same and log.


Case 1 - Command : ffmpeg -re -i videoplayback.mp4 -c:v libx264 -c:a aac -f flv "rtmps ://live-api-s.facebook.com:443/rtmp/5162241770554550 ?s_bl=1&s_oil=2&s_psm=1&s_sw=0&s_tids=1&s_vt=api-s&a=Aby_ZWutqdUZR26F"


Log -
2022-09-01 18:27:19.683 frame= 9 fps=0.0 q=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A dup=21 drop=0 speed= 0x

2022-09-01 18:27:20.163 frame= 19 fps= 19 q=0.0 q=33.0 size= 0kB time=00:00:00.44 bitrate= 8.7kbits/s dup=44 drop=0 speed=0.437x

2022-09-01 18:27:20.879 frame= 32 fps= 21 q=0.0 q=33.0 size= 0kB time=00:00:00.92 bitrate= 4.1kbits/s dup=74 drop=0 speed=0.616x

2022-09-01 18:27:21.374 frame= 47 fps= 22 q=0.0 q=33.0 size= 0kB time=00:00:01.41 bitrate= 2.7kbits/s dup=109 drop=0 speed=0.651x

2022-09-01 18:27:21.940 frame= 58 fps= 21 q=29.0 q=33.0 size= 40kB time=00:00:01.90 bitrate= 174.2kbits/s dup=135 drop=0 speed=0.703x

2022-09-01 18:27:22.530 frame= 69 fps= 21 q=29.0 q=33.0 size= 101kB time=00:00:01.92 bitrate= 429.9kbits/s dup=161 drop=0 speed=0.585x

2022-09-01 18:27:23.003 frame= 83 fps= 22 q=29.0 q=33.0 size= 165kB time=00:00:02.39 bitrate= 566.5kbits/s dup=193 drop=0 speed=0.623x

2022-09-01 18:27:23.567 frame= 97 fps= 22 q=29.0 q=33.0 size= 235kB time=00:00:02.90 bitrate= 661.9kbits/s dup=226 drop=0 speed=0.667x

2022-09-01 18:27:24.133 frame= 111 fps= 23 q=29.0 q=33.0 size= 315kB time=00:00:03.36 bitrate= 765.8kbits/s dup=259 drop=0 speed=0.693x

2022-09-01 18:27:24.715 frame= 125 fps= 23 q=29.0 q=30.0 size= 385kB time=00:00:03.85 bitrate= 817.5kbits/s dup=291 drop=0 speed=0.703x

2022-09-01 18:27:25.227 frame= 142 fps= 24 q=29.0 q=33.0 size= 486kB time=00:00:04.83 bitrate= 824.6kbits/s dup=331 drop=0 speed=0.802x

2022-09-01 18:27:25.712 frame= 158 fps= 24 q=29.0 q=33.0 size= 563kB time=00:00:05.31 bitrate= 867.6kbits/s dup=368 drop=0 speed=0.811x

2022-09-01 18:27:26.262 frame= 173 fps= 24 q=29.0 q=33.0 size= 634kB time=00:00:05.78 bitrate= 897.8kbits/s dup=403 drop=0 speed=0.819x

2022-09-01 18:27:26.796 frame= 191 fps= 25 q=29.0 q=33.0 size= 718kB time=00:00:06.24 bitrate= 941.7kbits/s dup=445 drop=0 speed=0.82x

2022-09-01 18:27:27.337 frame= 211 fps= 26 q=29.0 q=33.0 size= 806kB time=00:00:07.17 bitrate= 920.7kbits/s dup=492 drop=0 speed=0.882x

2022-09-01 18:27:27.816 frame= 233 fps= 27 q=29.0 q=33.0 size= 921kB time=00:00:07.64 bitrate= 987.4kbits/s dup=543 drop=0 speed=0.881x

2022-09-01 18:27:28.348 frame= 251 fps= 27 q=29.0 q=30.0 size= 1031kB time=00:00:08.42 bitrate=1001.9kbits/s dup=585 drop=0 speed=0.919x

2022-09-01 18:27:28.868 frame= 274 fps= 28 q=29.0 q=33.0 size= 1141kB time=00:00:09.03 bitrate=1035.2kbits/s dup=639 drop=0 speed=0.933x

2022-09-01 18:27:29.393 frame= 293 fps= 29 q=29.0 q=33.0 size= 1283kB time=00:00:09.49 bitrate=1106.5kbits/s dup=683 drop=0 speed=0.932x

2022-09-01 18:27:29.870 frame= 313 fps= 29 q=29.0 q=33.0 size= 1433kB time=00:00:10.42 bitrate=1125.6kbits/s dup=730 drop=0 speed=0.975x

2022-09-01 18:27:30.356 frame= 331 fps= 30 q=29.0 q=33.0 size= 1557kB time=00:00:10.89 bitrate=1170.9kbits/s dup=772 drop=0 speed=0.973x

2022-09-01 18:27:30.843 frame= 346 fps= 30 q=29.0 q=33.0 size= 1627kB time=00:00:11.35 bitrate=1174.1kbits/s dup=807 drop=0 speed=0.971x

2022-09-01 18:27:31.357 frame= 361 fps= 30 q=29.0 q=33.0 size= 1711kB time=00:00:11.81 bitrate=1186.2kbits/s dup=842 drop=0 speed=0.969x

2022-09-01 18:27:31.862 frame= 376 fps= 30 q=29.0 q=33.0 size= 1789kB time=00:00:12.28 bitrate=1193.3kbits/s dup=877 drop=0 speed=0.967x

2022-09-01 18:27:32.371 frame= 391 fps= 30 q=29.0 q=33.0 size= 1870kB time=00:00:12.74 bitrate=1201.8kbits/s dup=912 drop=0 speed=0.965x

2022-09-01 18:27:32.908 frame= 406 fps= 30 q=29.0 q=33.0 size= 1959kB time=00:00:13.67 bitrate=1173.3kbits/s dup=947 drop=0 speed=0.997x

2022-09-01 18:27:33.109 frame= 422 fps= 30 q=29.0 q=33.0 size= 2061kB time=00:00:14.14 bitrate=1193.8kbits/s dup=984 drop=0 speed=0.992x

Case 2 - Command : ffmpeg -re -i "https://rr1---sn-o58g5ob-nu8e.googlevideo.com/videoplayback?expire=1662057728&ei=n6gQY-D9OLSA4-EPzJKYyA0&ip=103.11.117.194&id=o-AOgjPoKU_GiUy425eSSF6tHEIQvoHpsUyyIHnHERk6YS&itag=22&source=youtube&requiressl=yes&mh=6k&mm=31%2C29&mn=sn-o58g5ob-nu8e%2Csn-cvhelnls&ms=au%2Crdu&mv=m&mvi=1&pcm2cms=yes&pl=24&initcwndbps=867500&vprv=1&mime=video%2Fmp4&ns=z8jzAKb15xkjMcyG0dBthZQH&ratebypass=yes&dur=256.116&lmt=1649507860591021&mt=1662035606&fvip=3&fexp=24001373%2C24007246&c=WEB&rbqsm=fr&txp=4532434&n=PSC3ywazY86ChDwPP2&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cns%2Cratebypass%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAI-aPoysSukxGNgmlsn-4bgCG84gQnILTkGJR8WQnK_bAiEArwSM0z-GYO4SinkzgdGG5qZJtoiP3ROYneg88sOjhv4%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpcm2cms%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIhAJb7JQbSPhhH2jte8pE0G0iWf1LtRlEzQgSy-2pBGPg3AiBWX0P27KU2xwazMGLiBaQanUOeytB0jPgFsJleM8DO-w%3D%3D" -c:v libx264 -c:a aac -f flv "rtmps ://live-api-s.facebook.com:443/rtmp/5162241770554550 ?s_bl=1&s_oil=2&s_psm=1&s_sw=0&s_tids=1&s_vt=api-s&a=Aby_ZWutqdUZR26F"


Log -


2022-09-01 18:24:23.080 frame= 9 fps=0.0 q=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A dup=21 drop=0 speed= 0x

2022-09-01 18:24:23.579 frame= 23 fps= 22 q=0.0 q=33.0 size= 0kB time=00:00:00.44 bitrate= 8.7kbits/s dup=53 drop=0 speed=0.427x

2022-09-01 18:24:24.177 frame= 33 fps= 21 q=0.0 q=33.0 size= 0kB time=00:00:00.92 bitrate= 4.1kbits/s dup=77 drop=0 speed=0.589x

2022-09-01 18:24:24.872 frame= 39 fps= 18 q=0.0 q=33.0 size= 0kB time=00:00:00.99 bitrate= 3.9kbits/s dup=91 drop=0 speed=0.458x

2022-09-01 18:24:25.513 frame= 46 fps= 16 q=0.0 q=33.0 size= 0kB time=00:00:01.41 bitrate= 2.7kbits/s dup=107 drop=0 speed=0.497x

2022-09-01 18:24:26.070 frame= 52 fps= 15 q=0.0 q=33.0 size= 0kB time=00:00:01.41 bitrate= 2.7kbits/s dup=121 drop=0 speed=0.41x

2022-09-01 18:24:26.602 frame= 58 fps= 14 q=29.0 q=33.0 size= 40kB time=00:00:01.90 bitrate= 174.2kbits/s dup=135 drop=0 speed=0.468x

2022-09-01 18:24:27.341 frame= 63 fps= 14 q=29.0 q=33.0 size= 72kB time=00:00:01.90 bitrate= 311.6kbits/s dup=147 drop=0 speed=0.417x

2022-09-01 18:24:27.957 frame= 71 fps= 13 q=29.0 q=33.0 size= 115kB time=00:00:02.39 bitrate= 392.6kbits/s dup=165 drop=0 speed=0.448x

2022-09-01 18:24:28.621 frame= 78 fps= 13 q=29.0 q=33.0 size= 141kB time=00:00:02.39 bitrate= 483.2kbits/s dup=182 drop=0 speed=0.409x

2022-09-01 18:24:29.277 frame= 82 fps= 12 q=29.0 q=33.0 size= 154kB time=00:00:02.39 bitrate= 527.3kbits/s dup=191 drop=0 speed=0.363x

2022-09-01 18:24:29.851 frame= 89 fps= 12 q=29.0 q=33.0 size= 197kB time=00:00:02.87 bitrate= 560.9kbits/s dup=207 drop=0 speed=0.397x

2022-09-01 18:24:30.385 frame= 96 fps= 12 q=29.0 q=33.0 size= 233kB time=00:00:02.87 bitrate= 662.2kbits/s dup=224 drop=0 speed=0.371x

2022-09-01 18:24:31.119 frame= 100 fps= 12 q=29.0 q=33.0 size= 253kB time=00:00:03.36 bitrate= 615.5kbits/s dup=233 drop=0 speed=0.402x

2022-09-01 18:24:31.449 frame= 110 fps= 12 q=29.0 q=33.0 size= 309kB time=00:00:03.36 bitrate= 750.7kbits/s dup=256 drop=0 speed=0.378x

2022-09-01 18:24:32.062 frame= 111 fps= 12 q=29.0 q=33.0 size= 315kB time=00:00:03.83 bitrate= 672.9kbits/s dup=259 drop=0 speed=0.405x

2022-09-01 18:24:32.696 frame= 122 fps= 12 q=29.0 q=33.0 size= 371kB time=00:00:03.85 bitrate= 787.6kbits/s dup=284 drop=0 speed=0.383x

2022-09-01 18:24:33.374 frame= 130 fps= 12 q=29.0 q=33.0 size= 410kB time=00:00:04.34 bitrate= 773.0kbits/s dup=303 drop=0 speed=0.407x

2022-09-01 18:24:33.987 frame= 139 fps= 12 q=29.0 q=33.0 size= 475kB time=00:00:04.34 bitrate= 895.9kbits/s dup=324 drop=0 speed=0.383x

2022-09-01 18:24:34.445 frame= 146 fps= 12 q=29.0 q=33.0 size= 508kB time=00:00:04.83 bitrate= 861.9kbits/s dup=340 drop=0 speed=0.404x

2022-09-01 18:24:35.218 frame= 153 fps= 12 q=29.0 q=33.0 size= 540kB time=00:00:05.03 bitrate= 878.1kbits/s dup=357 drop=0 speed=0.405x

2022-09-01 18:24:35.558 frame= 163 fps= 12 q=29.0 q=33.0 size= 580kB time=00:00:05.31 bitrate= 893.8kbits/s dup=380 drop=0 speed=0.408x

2022-09-01 18:24:36.220 frame= 167 fps= 12 q=29.0 q=33.0 size= 609kB time=00:00:05.31 bitrate= 938.0kbits/s dup=389 drop=0 speed=0.392x

2022-09-01 18:24:36.821 frame= 172 fps= 12 q=29.0 q=33.0 size= 630kB time=00:00:05.78 bitrate= 892.5kbits/s dup=401 drop=0 speed=0.408x

2022-09-01 18:24:37.428 frame= 179 fps= 12 q=29.0 q=33.0 size= 666kB time=00:00:05.78 bitrate= 943.1kbits/s dup=417 drop=0 speed=0.394x

2022-09-01 18:24:37.812 frame= 185 fps= 12 q=29.0 q=30.0 size= 689kB time=00:00:06.24 bitrate= 903.2kbits/s dup=431 drop=0 speed=0.41x

2022-09-01 18:24:38.368 frame= 190 fps= 12 q=29.0 q=33.0 size= 711kB time=00:00:06.24 bitrate= 932.5kbits/s dup=443 drop=0 speed=0.396x

2022-09-01 18:24:38.979 frame= 195 fps= 12 q=29.0 q=33.0 size= 737kB time=00:00:06.52 bitrate= 925.4kbits/s dup=455 drop=0 speed=0.399x

2022-09-01 18:24:39.706 frame= 204 fps= 12 q=29.0 q=33.0 size= 778kB time=00:00:06.71 bitrate= 949.8kbits/s dup=476 drop=0 speed=0.398x

2022-09-01 18:24:40.252 frame= 212 fps= 12 q=29.0 q=33.0 size= 808kB time=00:00:07.17 bitrate= 922.8kbits/s dup=494 drop=0 speed=0.407x

2022-09-01 18:24:40.977 frame= 220 fps= 12 q=29.0 q=33.0 size= 841kB time=00:00:07.17 bitrate= 960.6kbits/s dup=513 drop=0 speed=0.395x

2022-09-01 18:24:41.926 frame= 226 fps= 12 q=29.0 q=33.0 size= 886kB time=00:00:07.64 bitrate= 949.8kbits/s dup=527 drop=0 speed=0.404x

2022-09-01 18:24:42.470 frame= 233 fps= 12 q=29.0 q=33.0 size= 921kB time=00:00:07.64 bitrate= 987.4kbits/s dup=543 drop=0 speed=0.385x

2022-09-01 18:24:43.081 frame= 237 fps= 12 q=29.0 q=33.0 size= 942kB time=00:00:07.66 bitrate=1007.5kbits/s dup=553 drop=0 speed=0.374x

2022-09-01 18:24:43.745 frame= 241 fps= 11 q=29.0 q=33.0 size= 971kB time=00:00:08.10 bitrate= 981.5kbits/s dup=562 drop=0 speed=0.384x

2022-09-01 18:24:44.270 frame= 248 fps= 11 q=29.0 q=33.0 size= 1011kB time=00:00:08.10 bitrate=1021.5kbits/s dup=578 drop=0 speed=0.373x

2022-09-01 18:24:45.085 frame= 251 fps= 11 q=29.0 q=30.0 size= 1031kB time=00:00:08.10 bitrate=1042.1kbits/s dup=585 drop=0 speed=0.364x

As per my knowledge we have to add such type of delay or late stream video using some command.


-
FFMPEG command runs in terminal but not by subprocess
1er septembre 2022, par BasiliqueI am trying to run a bash command using the
subprocess
module from withinpython 3.10
.

The bash command is :


ffmpeg -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4



In terminal the command runs fine. Here is the output :


ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
 configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --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-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
 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
Input #0, image2, from '*.png':
 Duration: 00:16:39.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: png, rgba(pc), 895x332 [SAR 3937:3937 DAR 895:332], 1 fps, 1 tbr, 1 tbn, 1 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (png (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x55726ab95d00] using SAR=1/1
[libx264 @ 0x55726ab95d00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
[libx264 @ 0x55726ab95d00] profile High, level 2.2
[libx264 @ 0x55726ab95d00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=10 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
 Metadata:
 encoder : Lavf58.29.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 894x332 [SAR 1:1 DAR 447:166], q=-1--1, 1 fps, 16384 tbn, 1 tbc
 Metadata:
 encoder : Lavc58.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 173 fps=0.0 q=17.0 size= 512kB time=00:01:56.00 bitrate= 36.2kbits/frame= 351 fps=350 q=17.0 size= 1536kB time=00:04:54.00 bitrate= 42.8kbits/frame= 517 fps=343 q=17.0 size= 2560kB time=00:07:40.00 bitrate= 45.6kbits/frame= 725 fps=361 q=17.0 size= 3328kB time=00:11:08.00 bitrate= 40.8kbits/frame= 913 fps=364 q=17.0 size= 4352kB time=00:14:16.00 bitrate= 41.6kbits/frame= 999 fps=361 q=-1.0 Lsize= 4986kB time=00:16:36.00 bitrate= 41.0kbits/s speed= 360x 
video:4974kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.241361%
[libx264 @ 0x55726ab95d00] frame I:4 Avg QP: 6.12 size: 24072
[libx264 @ 0x55726ab95d00] frame P:346 Avg QP:12.94 size: 5708
[libx264 @ 0x55726ab95d00] frame B:649 Avg QP:18.19 size: 4655
[libx264 @ 0x55726ab95d00] consecutive B-frames: 5.8% 16.0% 20.1% 58.1%
[libx264 @ 0x55726ab95d00] mb I I16..4: 59.1% 10.6% 30.4%
[libx264 @ 0x55726ab95d00] mb P I16..4: 5.6% 0.6% 2.2% P16..4: 10.5% 4.3% 2.3% 0.0% 0.0% skip:74.5%
[libx264 @ 0x55726ab95d00] mb B I16..4: 2.2% 0.1% 1.7% B16..8: 16.9% 4.8% 1.6% direct: 1.1% skip:71.5% L0:50.9% L1:45.2% BI: 3.9%
[libx264 @ 0x55726ab95d00] 8x8 transform intra:5.9% inter:10.4%
[libx264 @ 0x55726ab95d00] coded y,uvDC,uvAC intra: 20.1% 18.3% 17.3% inter: 4.7% 4.7% 4.6%
[libx264 @ 0x55726ab95d00] i16 v,h,dc,p: 66% 33% 1% 0%
[libx264 @ 0x55726ab95d00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 8% 73% 0% 0% 0% 0% 0% 0%
[libx264 @ 0x55726ab95d00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 31% 31% 2% 3% 2% 4% 2% 3%
[libx264 @ 0x55726ab95d00] i8c dc,h,v,p: 73% 23% 3% 0%
[libx264 @ 0x55726ab95d00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x55726ab95d00] ref P L0: 57.2% 1.5% 24.3% 17.0%
[libx264 @ 0x55726ab95d00] ref B L0: 69.6% 24.8% 5.6%
[libx264 @ 0x55726ab95d00] ref B L1: 92.4% 7.6%
[libx264 @ 0x55726ab95d00] kb/s:40.78



In my python script I tried the following solutions :


video_cmd = """ffmpeg -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4"""

subprocess.run(shlex.split(video_cmd), shell=False, cwd=path_viz, stderr=subprocess.STDOUT, check=True, text=False)

subprocess.run(video_cmd, shell=True, cwd=path_viz, stderr=subprocess.STDOUT, check=True, text=False)



as well as the solution proposed for this similar question


subprocess.Popen(video_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)



None of them worked. Apparently, the right command is run (output of the
check_out
function) :

Command 'ffmpeg -y -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4' returned non-zero exit status 1.



the first part of the job (up to
Stream mapping:
) is done also correctly :

fmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7.3.0 (crosstool-NG 1.23.0.449-a04d0)
 configuration: --prefix=/home/rsghazanfari/anaconda3/envs/_cuda --cc=/opt/conda/conda-bld/ffmpeg_1597178665428/_build_env/bin/x86_64-conda_cos6-linux-gnu-cc --disable-doc --disable-openssl --enable-avresample --enable-gnutls --enable-hardcoded-tables --enable-libfreetype --enable-libopenh264 --enable-pic --enable-pthreads --enable-shared --disable-static --enable-version3 --enable-zlib --enable-libmp3lame
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
Input #0, image2, from '*.png':
 Duration: 00:16:39.00, start: 0.000000, bitrate: N/A
 Stream #0:0: Video: png, rgba(pc), 895x332 [SAR 3937:3937 DAR 895:332], 1 fps, 1 tbr, 1 tbn, 1 tbc



but it then pops up the following error :


Unknown encoder 'libx264'
Traceback (most recent call last):
 File "/home/rsgh/anaconda3/envs/_cuda/lib/python3.10/code.py", line 90, in runcode
 exec(code, self.locals)
 File "<input />", line 1, in <module>
 File "/home/rsgh/anaconda3/envs/_cuda/lib/python3.10/subprocess.py", line 524, in run
 raise CalledProcessError(retcode, process.args,

subprocess.CalledProcessError: Command 'ffmpeg -y -framerate 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p -vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" out.mp4' returned non-zero exit status 1.
</module>


Any ideas of why this error is produced in python while in terminal it runs fine ? Thank you in advance.


PS :
ffmpeg -version
outputs :

ffmpeg version 4.2.7-0ubuntu0.1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=0ubuntu0.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --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-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
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



ubuntu version :


Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal



-
AVPlayer currentTime not match with the displayed frame after many seeking. (HLS Stream)
26 août 2022, par D.BenceI have a m3u8 file which i want to use with HLS.
link to m3u8 file


My problem is that when i seek many times, the currentTime not match with the displayed frame. I experience that, the more seeking there is more difference. (it's like a constant +offset)


Our use case is very timing sensitive, we need to stop the videos at specific positions. For this we use the following code :


[_player addBoundaryTimeObserverForTimes:times
 queue:dispatch_get_main_queue()
 usingBlock:^{
 weakSelf.player.rate = 0.0;
 // The time is correct here, but the displayed frame is not sync with this time
 CMTimeShow(weakSelf.player.currentTime);
 }
] 



I read that AVURLAssetPreferPreciseDurationAndTimingKey can help, but the currentTime still wrong.


NSDictionary<nsstring> *options = @{AVURLAssetPreferPreciseDurationAndTimingKey:@YES};
AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:url options:options];
AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:urlAsset];
</nsstring>


I also read that there is a problem with the m3u8 itself. (for example wrong GOP size.)


What is the reason for the incorrect currentTime, and how can i fix this ?


ffprobe m3u8 :


ffprobe https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.m3u8
ffprobe version 5.1 Copyright (c) 2007-2022 the FFmpeg developers
 built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1 --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-videotoolbox --enable-neon
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
[hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3')
[hls @ 0x152f04280] Skip ('#EXT-X-INDEPENDENT-SEGMENTS')
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate.m3u8' for reading
[hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3')
[https @ 0x154045000] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate.m3u8' for reading
[hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3')
[https @ 0x154045000] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate.m3u8' for reading
[hls @ 0x152f04280] Skip ('#EXT-X-VERSION:3')
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate_00001.ts' for reading
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_6000000bitrate_00002.ts' for reading
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate_00001.ts' for reading
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1080p_15000000bitrate_00002.ts' for reading
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate_00001.ts' for reading
[hls @ 0x152f04280] Opening 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized1520p_33000000bitrate_00002.ts' for reading
Input #0, hls, from 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/released/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.m3u8':
 Duration: 00:49:43.00, start: 2.033367, bitrate: 0 kb/s
 Program 0
 Metadata:
 variant_bitrate : 8133826
 Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn
 Metadata:
 variant_bitrate : 8133826
 Program 1
 Metadata:
 variant_bitrate : 18870392
 Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn
 Metadata:
 variant_bitrate : 18870392
 Program 2
 Metadata:
 variant_bitrate : 40776144
 Stream #0:2: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 2704x1520 [SAR 1:1 DAR 169:95], 29.97 fps, 29.97 tbr, 90k tbn
 Metadata:
 variant_bitrate : 40776144



ffprobe original mp4 :


ffprobe https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/finalized/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.mp4
ffprobe version 5.1 Copyright (c) 2007-2022 the FFmpeg developers
 built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1 --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-videotoolbox --enable-neon
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://mrkresz-content-bucket.s3.eu-central-1.amazonaws.com/applicationData/extended-path-videos/4b0046fd-0be7-4a07-bc7c-c1a0069116b1/finalized/50816bc9-6118-4dd1-a90e-fb72652bb06f-final-from-anonymized.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf58.76.100
 Duration: 00:49:42.81, start: 0.000000, bitrate: 36142 kb/s
 Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 2486x1398, 36138 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]