
Recherche avancée
Médias (91)
-
Valkaama DVD Cover Outside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
Valkaama DVD Label
4 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Image
-
Valkaama DVD Cover Inside
4 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Image
-
1,000,000
27 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Demon Seed
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Four of Us are Dying
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (27)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
-
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)
Sur d’autres sites (4772)
-
ffmpeg x11grab to streamable format
2 juin 2021, par Jintor2 FFMPEG process


(1) generating a ffmpeg x11grab to a .mp4
(2) take the .mp4 and restream it simultaneously to multiple rtmp endpoints


ISSUE the generated file in (1) have this error "moov atom not found"


This is the command that generate (1) :


ffmpeg -re -y -f x11grab -draw_mouse 0 -framerate 30 
-video_size $RESOLUTION -i :$DISPLAY_NUM -c:a aac -c:v libx264 
-movflags +faststart -preset ultrafast -crf 28 -refs 4 -qmin 4 
-pix_fmt yuv420p -filter:v fps=30 file.mp4



in the (2) => when I try to ffmpeg -i file.mp4 output somewhere : I get "moov atom not found" so the (2) can't read or open (1).


What I'm I missing


in (1)
-movflags +faststart
doesn't seem to fix the issue

••••••• EDIT : more details on the context ••••••


I'm using openvidu : webrtc with kurento and coturn.


The record feature creates a .mp4 on the fly as the chat is going on.


To start the recording, there is an API call i can make to my server and it automatically stops when all users leaves the chatroom OR do an other api call to stop. see composed video in this link https://docs.openvidu.io/en/2.17.0/advanced-features/recording/


openvidu have also webhooks.


My problem is not how to stop ffmpeg, but getting FFMPEG to encode while the mp4 or other is being generated "on the fly".


There is 2 options :


OPTION 1 : individual => 1 .webm per camare => this .webm ffmpeg can restream as hls or RTMP => it's working.


OPTION 2 : ** but the issue is with "Composed" video => it's using ffmpeg to x11grab the session... but it's mp4 without moov ato, so ffmpeg don't do anything with this.


see the composed.sh script here
https://github.com/OpenVidu/openvidu/blob/master/openvidu-server/docker/openvidu-recording/scripts/composed.sh


***************** EDIT 3 *************


in the .sh this is the part that is creating the mp4


ffmpeg -y -f alsa -i pulse -f x11grab -draw_mouse 0
-framerate $FRAMERATE -video_size $RESOLUTION -i :$DISPLAY_NUM
-c:a aac -c:v libx264 -preset ultrafast
-crf 28 -refs 4 -qmin 4 -pix_fmt yuv420p
-filter:v fps=$FRAMERATE "/recordings/$VIDEO_ID/$VIDEO_NAME.$VIDEO_FORMAT"


How can I modify this to have better result example VP8 or VP9 with good quality .webm so that the ffpmeg second command(2) can encode it live...


**** EDIT 4 ********


I tried this it worked for 30 seconds and suddenly stopped


<./stop ffmpeg -y -f alsa -i pulse -f 
x11grab -draw_mouse 0 -framerate $FRAMERATE 
-video_size $RESOLUTION -i :$DISPLAY_NUM 
-c:v libx264 -b:v 1396k -b:a 128k -ar 44100 -maxrate 1369k 
-pix_fmt yuv420p -preset veryfast -tune zerolatency 
-c:a aac -ac 2 -profile:v main -flags -global_header 
-bufsize 969k -hls_time 1 -hls_list_size 0 -g 30 
-start_number 0 -streaming 1 -hls_playlist 1 
-lhls 1 -hls_playlist_type event -f hls "/recordings/$VIDEO_ID/$VIDEO_NAME".m3u8


N: [pulseaudio] main.c: Running in system mode, forcibly disabling SHM mode.
N: [pulseaudio] main.c: Running in system mode, forcibly disabling exit idle time.
Display in use -> :99
----------------------------------------
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
 configuration: --prefix=/usr --extra-version=1ubuntu0.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
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'pulse':
 Duration: N/A, start: 1617150428.783763, bitrate: 1536 kb/s
 Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[x11grab @ 0x55e88a4e8780] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #1, x11grab, from ':99':
 Duration: N/A, start: 1617150428.837799, bitrate: N/A
 Stream #1:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1080, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
Stream mapping:
 Stream #1:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
 Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x55e88a4f70c0] max bitrate less than average bitrate, assuming CBR
[libx264 @ 0x55e88a4f70c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
[libx264 @ 0x55e88a4f70c0] profile Main, level 4.0
[alsa @ 0x55e88a4c2e40] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619940.ts' for writing
Output #0, hls, to '/recordings/13391978436095-2/rec13390362561994.m3u8':
 Metadata:
 encoder : Lavf58.29.100
 Stream #0:0: Video: h264 (libx264), yuv420p(progressive), 1920x1080, q=-1--1, 1396 kb/s, 30 fps, 90k tbn, 30 tbc
 Metadata:
 encoder : Lavc58.54.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 1369000/0/1396000 buffer size: 969000 vbv_delay: -1
 Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
 Metadata:
 encoder : Lavc58.54.100 aac
frame= 16 fps=0.0 q=21.0 size=N/A time=00:00:00.53 bitrate=N/A speed=1.06x 
frame= 31 fps= 31 q=16.0 size=N/A time=00:00:01.03 bitrate=N/A speed=1.02x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619941.ts' for writing
frame= 47 fps= 31 q=21.0 size=N/A time=00:00:01.56 bitrate=N/A speed=1.03x 
frame= 62 fps= 30 q=22.0 size=N/A time=00:00:02.06 bitrate=N/A speed=1.02x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619942.ts' for writing
frame= 77 fps= 30 q=24.0 size=N/A time=00:00:02.56 bitrate=N/A speed=1.01x 
frame= 92 fps= 30 q=22.0 size=N/A time=00:00:03.06 bitrate=N/A speed=0.999x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619943.ts' for writing
frame= 108 fps= 30 q=29.0 size=N/A time=00:00:03.60 bitrate=N/A speed= 1x 
frame= 124 fps= 30 q=21.0 size=N/A time=00:00:04.13 bitrate=N/A speed=1.01x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619944.ts' for writing
frame= 139 fps= 30 q=20.0 size=N/A time=00:00:04.63 bitrate=N/A speed=1.01x 
frame= 154 fps= 30 q=18.0 size=N/A time=00:00:05.13 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619945.ts' for writing
frame= 169 fps= 30 q=19.0 size=N/A time=00:00:05.63 bitrate=N/A speed= 1x 
frame= 185 fps= 30 q=19.0 size=N/A time=00:00:06.16 bitrate=N/A speed=1.01x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619946.ts' for writing
frame= 199 fps= 30 q=20.0 size=N/A time=00:00:06.63 bitrate=N/A speed= 1x 
frame= 215 fps= 30 q=19.0 size=N/A time=00:00:07.16 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619947.ts' for writing
frame= 230 fps= 30 q=19.0 size=N/A time=00:00:07.66 bitrate=N/A speed= 1x 
frame= 242 fps= 30 q=18.0 size=N/A time=00:00:08.06 bitrate=N/A speed=0.99x 
frame= 254 fps= 29 q=17.0 size=N/A time=00:00:08.46 bitrate=N/A speed=0.979x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619948.ts' for writing
frame= 276 fps= 30 q=17.0 size=N/A time=00:00:09.20 bitrate=N/A speed=1.01x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec133903625619949.ts' for writing
frame= 290 fps= 30 q=21.0 size=N/A time=00:00:09.66 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199410.ts' for writing
frame= 306 fps= 30 q=31.0 size=N/A time=00:00:10.20 bitrate=N/A speed= 1x 
frame= 322 fps= 30 q=21.0 size=N/A time=00:00:10.73 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199411.ts' for writing
frame= 337 fps= 30 q=21.0 size=N/A time=00:00:11.23 bitrate=N/A speed= 1x 
frame= 352 fps= 30 q=19.0 size=N/A time=00:00:11.73 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199412.ts' for writing
frame= 367 fps= 30 q=19.0 size=N/A time=00:00:12.23 bitrate=N/A speed= 1x 
frame= 382 fps= 30 q=18.0 size=N/A time=00:00:12.73 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199413.ts' for writing
frame= 397 fps= 30 q=18.0 size=N/A time=00:00:13.23 bitrate=N/A speed= 1x 
frame= 412 fps= 30 q=18.0 size=N/A time=00:00:13.73 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199414.ts' for writing
frame= 428 fps= 30 q=18.0 size=N/A time=00:00:14.26 bitrate=N/A speed= 1x 
frame= 443 fps= 30 q=17.0 size=N/A time=00:00:14.76 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199415.ts' for writing
frame= 458 fps= 30 q=18.0 size=N/A time=00:00:15.26 bitrate=N/A speed= 1x 
frame= 474 fps= 30 q=17.0 size=N/A time=00:00:15.80 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199416.ts' for writing
frame= 489 fps= 30 q=18.0 size=N/A time=00:00:16.30 bitrate=N/A speed= 1x 
frame= 504 fps= 30 q=17.0 size=N/A time=00:00:16.80 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199417.ts' for writing
frame= 520 fps= 30 q=20.0 size=N/A time=00:00:17.33 bitrate=N/A speed= 1x 
frame= 535 fps= 30 q=18.0 size=N/A time=00:00:17.83 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199418.ts' for writing
frame= 551 fps= 30 q=20.0 size=N/A time=00:00:18.36 bitrate=N/A speed= 1x 
frame= 566 fps= 30 q=19.0 size=N/A time=00:00:18.86 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199419.ts' for writing
frame= 581 fps= 30 q=20.0 size=N/A time=00:00:19.36 bitrate=N/A speed= 1x 
frame= 596 fps= 30 q=19.0 size=N/A time=00:00:19.86 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199420.ts' for writing
frame= 612 fps= 30 q=21.0 size=N/A time=00:00:20.40 bitrate=N/A speed= 1x 
frame= 626 fps= 30 q=20.0 size=N/A time=00:00:20.86 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199421.ts' for writing
frame= 641 fps= 30 q=21.0 size=N/A time=00:00:21.37 bitrate=N/A speed= 1x 
frame= 657 fps= 30 q=35.0 size=N/A time=00:00:21.90 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199422.ts' for writing
frame= 672 fps= 30 q=33.0 size=N/A time=00:00:22.40 bitrate=N/A speed= 1x 
frame= 687 fps= 30 q=23.0 size=N/A time=00:00:22.90 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199423.ts' for writing
frame= 703 fps= 30 q=23.0 size=N/A time=00:00:23.43 bitrate=N/A speed= 1x 
frame= 718 fps= 30 q=25.0 size=N/A time=00:00:23.93 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199424.ts' for writing
frame= 733 fps= 30 q=27.0 size=N/A time=00:00:24.44 bitrate=N/A speed= 1x 
frame= 749 fps= 30 q=26.0 size=N/A time=00:00:24.96 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199425.ts' for writing
frame= 764 fps= 30 q=28.0 size=N/A time=00:00:25.46 bitrate=N/A speed= 1x 
frame= 780 fps= 30 q=27.0 size=N/A time=00:00:26.00 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199426.ts' for writing
frame= 795 fps= 30 q=27.0 size=N/A time=00:00:26.50 bitrate=N/A speed= 1x 
frame= 810 fps= 30 q=26.0 size=N/A time=00:00:27.00 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec1339036256199427.ts' for writing
frame= 825 fps= 30 q=29.0 size=N/A time=00:00:27.50 bitrate=N/A speed= 1x 
[hls @ 0x55e88a4f3040] Opening '/recordings/13391978436095-2/rec13390362561994.m3u8.tmp' for writing
frame= 840 fps= 30 q=30.0 Lsize=N/A time=00:00:28.01 bitrate=N/A speed= 1x 
video:4635kB audio:404kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x55e88a4f70c0] frame I:42 Avg QP:12.88 size: 28020
[libx264 @ 0x55e88a4f70c0] frame P:798 Avg QP:13.11 size: 4473
[libx264 @ 0x55e88a4f70c0] mb I I16..4: 88.4% 0.0% 11.6%
[libx264 @ 0x55e88a4f70c0] mb P I16..4: 6.6% 0.0% 0.4% P16..4: 6.6% 1.9% 0.6% 0.0% 0.0% skip:83.8%
[libx264 @ 0x55e88a4f70c0] coded y,uvDC,uvAC intra: 18.8% 20.1% 10.1% inter: 1.7% 2.4% 0.1%
[libx264 @ 0x55e88a4f70c0] i16 v,h,dc,p: 55% 30% 12% 4%
[libx264 @ 0x55e88a4f70c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 27% 31% 2% 3% 2% 2% 1% 2%
[libx264 @ 0x55e88a4f70c0] i8c dc,h,v,p: 77% 9% 12% 1%
[libx264 @ 0x55e88a4f70c0] Weighted P-Frames: Y:1.1% UV:0.1%
[libx264 @ 0x55e88a4f70c0] kb/s:1355.98
[aac @ 0x55e88a4f8440] Qavg: 40876.258
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): Cannot iterate over null (null)
jq: error (at <stdin>:1): null (null) cannot be parsed as a number
jq: error (at <stdin>:1): null (null) cannot be parsed as a number
jq: error: syntax error, unexpected '|' (Unix shell quoting issues?) at , line 1:
.hasAudio=false | .hasVideo=false | .duration= | .size= | .status="failed" 
jq: 1 compile error
ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
 configuration: --prefix=/usr --extra-version=1ubuntu0.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
Invalid duration specification for ss: -i
</stdin></stdin></stdin></stdin>


***** Edit 5 **********


no mather what format I choose, it stops after 20 to 30 secs.
the same line with .webm .mov .264 when it's not .mp4 ffmpeg seems to drop


-
Why does my ffmpeg audio sound slower and deeper - sample rate mismatch
4 septembre 2020, par yogesh zinzuok so this is a discord bot to record voice chat
https://hatebin.com/hgjlazacri
Now the bot works perfectly fine but the issue is that the audio sounds a bit deeper and slower than normal.. Why does it happen ? how can I make the audio sound 1:1..




const Discord = require('discord.js');
const client = new Discord.Client();
const ffmpegInstaller = require('@ffmpeg-installer/ffmpeg');
const ffmpeg = require('fluent-ffmpeg');
ffmpeg.setFfmpegPath(ffmpegInstaller.path);
const fs = require('fs-extra')
const mergeStream = require('merge-stream');
const config = require('./config.json');
const { getAudioDurationInSeconds } = require('get-audio-duration');
const cp = require('child_process');
const path1 = require('path');
const Enmap = require('enmap');
const UserRecords = require("./models/userrecords.js")
const ServerRecords = require("./models/serverrecords.js")
let prefix = `$`
class Readable extends require('stream').Readable { _read() {} }
let recording = false;
let currently_recording = {};
let mp3Paths = [];
const silence_buffer = new Uint8Array(3840);
const express = require('express')
const app = express()
const port = 3000
const publicIP = require('public-ip')
const { program } = require('commander');
const { path } = require('@ffmpeg-installer/ffmpeg');
const version = '0.0.1'
program.version(version);
let debug = false
let runProd = false
let fqdn = "";
const mongoose = require("mongoose");
const MongoClient = require('mongodb').MongoClient;
mongoose.connect('SECRRET',{
 useNewUrlParser: true
}, function(err){
 if(err){
 console.log(err);
 }else{
 console.log("Database connection initiated");
 }
});
require("dotenv").config()
function bufferToStream(buffer) {
 let stream = new Readable();
 stream.push(buffer);
 return stream;
}





client.commands = new Enmap();

client.on('ready', async () => {
 console.log(`Logged in as ${client.user.tag}`);

 let host = "localhost"

 

 let ip = await publicIP.v4();

 let protocol = "http";
 if (!runProd) {
 host = "localhost"
 } else {
 host = `35.226.244.186`;
 }
 fqdn = `${protocol}://${host}:${port}`
 app.listen(port, `0.0.0.0`, () => {
 console.log(`Listening on port ${port} for ${host} at fqdn ${fqdn}`)
 })
});
let randomArr = []
let finalArrWithIds = []
let variable = 0
client.on('message', async message => {
 console.log(`fuck`);
 if(message.content === `$record`){
 mp3Paths = []
 finalArrWithIds = []
 let membersToScrape = Array.from(message.member.voice.channel.members.values());
 membersToScrape.forEach((member) => {
 if(member.id === `749250882830598235`) {
 console.log(`botid`);
 }
 else {
 finalArrWithIds.push(member.id)
 }
 
 })
 const randomNumber = Math.floor(Math.random() * 100)
 randomArr = []
 randomArr.push(randomNumber)
 }
 
 
 const generateSilentData = async (silentStream, memberID) => {
 console.log(`recordingnow`)
 while(recording) {
 if (!currently_recording[memberID]) {
 silentStream.push(silence_buffer);
 }
 await new Promise(r => setTimeout(r, 20));
 }
 return "done";
 }
 console.log(generateSilentData, `status`)
 function generateOutputFile(channelID, memberID) {
 const dir = `./recordings/${channelID}/${memberID}`;
 fs.ensureDirSync(dir);
 const fileName = `${dir}/${randomArr[0]}.aac`;
 console.log(`${fileName} ---------------------------`);
 return fs.createWriteStream(fileName);
 }
 
 if (!fs.existsSync("public")) {
 fs.mkdirSync("public");
 }
 app.use("/public", express.static("./public"));
 if (!message.guild) return;

 if (message.content === config.prefix + config.record_command) {
 if (recording) {
 message.reply("bot is already recording");
 return
 }
 if (message.member.voice.channel) {
 recording = true;
 const connection = await message.member.voice.channel.join();
 const dispatcher = connection.play('./audio.mp3');

 connection.on('speaking', (user, speaking) => {
 if (speaking.has('SPEAKING')) {
 currently_recording[user.id] = true;
 } else {
 currently_recording[user.id] = false;
 }
 })


 let members = Array.from(message.member.voice.channel.members.values());
 members.forEach((member) => {

 if (member.id != client.user.id) {
 let memberStream = connection.receiver.createStream(member, {mode : 'pcm', end : 'manual'})

 let outputFile = generateOutputFile(message.member.voice.channel.id, member.id);
 console.log(outputFile, `outputfile here`);
 mp3Paths.push(outputFile.path);
 

 silence_stream = bufferToStream(new Uint8Array(0));
 generateSilentData(silence_stream, member.id).then(data => console.log(data));
 let combinedStream = mergeStream(silence_stream, memberStream);

 ffmpeg(combinedStream)
 .inputFormat('s32le')
 .audioFrequency(44100)
 .audioChannels(2)
 .on('error', (error) => {console.log(error)})
 .audioCodec('aac')
 .format('adts') 
 .pipe(outputFile)
 
 }
 })
 } else {
 message.reply('You need to join a voice channel first!');
 }
 }

 if (message.content === config.prefix + config.stop_command) {

 let date = new Date();
 let dd = String(date.getDate()).padStart(2, '0');
 let mm = String(date.getMonth() + 1).padStart(2, '0'); 
 let yyyy = date.getFullYear();
 date = mm + '/' + dd + '/' + yyyy;





 let currentVoiceChannel = message.member.voice.channel;
 if (currentVoiceChannel) {
 recording = false;
 await currentVoiceChannel.leave();

 let mergedOutputFolder = './recordings/' + message.member.voice.channel.id + `/${randomArr[0]}/`;
 fs.ensureDirSync(mergedOutputFolder);
 let file_name = `${randomArr[0]}` + '.aac';
 let mergedOutputFile = mergedOutputFolder + file_name;
 
 
 let download_path = message.member.voice.channel.id + `/${randomArr[0]}/` + file_name;

 let mixedOutput = new ffmpeg();
 console.log(mp3Paths, `mp3pathshere`);
 mp3Paths.forEach((mp3Path) => {
 mixedOutput.addInput(mp3Path);
 
 })
 console.log(mp3Paths);
 //mixedOutput.complexFilter('amix=inputs=2:duration=longest');
 mixedOutput.complexFilter('amix=inputs=' + mp3Paths.length + ':duration=longest');
 
 let processEmbed = new Discord.MessageEmbed().setTitle(`Audio Processing.`)
 processEmbed.addField(`Audio processing starting now..`, `Processing Audio`)
 processEmbed.setThumbnail(`https://media.discordapp.net/attachments/730811581046325348/748610998985818202/speaker.png`)
 processEmbed.setColor(` #00FFFF`)
 const processEmbedMsg = await message.channel.send(processEmbed)
 async function saveMp3(mixedData, outputMixed) {
 console.log(`${mixedData} MIXED `)
 
 
 
 return new Promise((resolve, reject) => {
 mixedData.on('error', reject).on('progress',
 async (progress) => {
 
 let processEmbedEdit = new Discord.MessageEmbed().setTitle(`Audio Processing.`)
 processEmbedEdit.addField(`Processing: ${progress.targetSize} KB converted`, `Processing Audio`)
 processEmbedEdit.setThumbnail(`https://media.discordapp.net/attachments/730811581046325348/748610998985818202/speaker.png`)
 processEmbedEdit.setColor(` #00FFFF`)
 processEmbedMsg.edit(processEmbedEdit)
 console.log('Processing: ' + progress.targetSize + ' KB converted');
 }).on('end', () => {
 console.log('Processing finished !');
 resolve()
 }).saveToFile(outputMixed);
 console.log(`${outputMixed} IT IS HERE`);
 })
 }
 // mixedOutput.saveToFile(mergedOutputFile);
 await saveMp3(mixedOutput, mergedOutputFile);
 console.log(`${mixedOutput} IN HEREEEEEEE`);
 // We saved the recording, now copy the recording
 if (!fs.existsSync(`./public`)) {
 fs.mkdirSync(`./public`);
 }
 let sourceFile = `${__dirname}/recordings/${download_path}`
 console.log(`DOWNLOAD PATH HERE ${download_path}`)
 const guildName = message.guild.id;
 const serveExist = `/public/${guildName}`
 if (!fs.existsSync(`.${serveExist}`)) {
 fs.mkdirSync(`.${serveExist}`)
 }
 let destionationFile = `${__dirname}${serveExist}/${file_name}`

 let errorThrown = false
 try {
 fs.copySync(sourceFile, destionationFile);
 } catch (err) {
 errorThrown = true
 await message.channel.send(`Error: ${err.message}`)
 }
 const usersWithTag = finalArrWithIds.map(user => `\n <@${user}>`);
 let timeSpent = await getAudioDurationInSeconds(`public/${guildName}/${file_name}`)
 let timesSpentRound = Math.floor(timeSpent)
 let finalTimeSpent = timesSpentRound / 60
 let finalTimeForReal = Math.floor(finalTimeSpent)
 if(!errorThrown){
 //--------------------- server recording save START
 class GeneralRecords {
 constructor(generalLink, date, voice, time) {
 this.generalLink = generalLink;
 this.date = date;
 this.note = `no note`;
 this.voice = voice;
 this.time = time
 }
 }
 let newGeneralRecordClassObject = new GeneralRecords(`${fqdn}/public/${guildName}/${file_name}`, date, usersWithTag, finalTimeForReal)
 let checkingServerRecord = await ServerRecords.exists({userid: `server`})
 if(checkingServerRecord === true){
 existingServerRecord = await ServerRecords.findOne({userid: `server`})
 existingServerRecord.content.push(newGeneralRecordClassObject)
 await existingServerRecord.save()
 }
 if(checkingServerRecord === false){
 let serverRecord = new ServerRecords()
 serverRecord.userid = `server`
 serverRecord.content.push(newGeneralRecordClassObject)
 await serverRecord.save()
 }
 //--------------------- server recording save STOP
 }
 
 //--------------------- personal recording section START
 for( member of finalArrWithIds) {

 let personal_download_path = message.member.voice.channel.id + `/${member}/` + file_name;
 let sourceFilePersonal = `${__dirname}/recordings/${personal_download_path}`
 let destionationFilePersonal = `${__dirname}${serveExist}/${member}/${file_name}`
 await fs.copySync(sourceFilePersonal, destionationFilePersonal);
 const user = client.users.cache.get(member);
 console.log(user, `user here`);
 try {
 ffmpeg.setFfmpegPath(ffmpegInstaller.path);
 
 ffmpeg(`public/${guildName}/${member}/${file_name}`)
 .audioFilters('silenceremove=stop_periods=-1:stop_duration=1:stop_threshold=-90dB')
 .output(`public/${guildName}/${member}/personal-${file_name}`)
 .on(`end`, function () {
 console.log(`DONE`);
 })
 .on(`error`, function (error) {
 console.log(`An error occured` + error.message)
 })
 .run();
 
 }
 catch (error) {
 console.log(error)
 }
 

 // ----------------- SAVING PERSONAL RECORDING TO DATABASE START
 class PersonalRecords {
 constructor(generalLink, personalLink, date, time) {
 this.generalLink = generalLink;
 this.personalLink = personalLink;
 this.date = date;
 this.note = `no note`;
 this.time = time;
 }
 }
 let timeSpentPersonal = await getAudioDurationInSeconds(`public/${guildName}/${file_name}`)
 let timesSpentRoundPersonal = Math.floor(timeSpentPersonal)
 let finalTimeSpentPersonal = timesSpentRoundPersonal / 60
 let finalTimeForRealPersonal = Math.floor(finalTimeSpentPersonal)
 let newPersonalRecordClassObject = new PersonalRecords(`${fqdn}/public/${guildName}/${file_name}`, `${fqdn}/public/${guildName}/${member}/personal-${file_name}`, date, finalTimeForRealPersonal)

 let checkingUserRecord = await UserRecords.exists({userid: member})
 if(checkingUserRecord === true){
 existingUserRecord = await UserRecords.findOne({userid: member})
 existingUserRecord.content.push(newPersonalRecordClassObject)
 await existingUserRecord.save()
 }
 if(checkingUserRecord === false){
 let newRecord = new UserRecords()
 newRecord.userid = member
 newRecord.content.push(newPersonalRecordClassObject)
 await newRecord.save()
 }


 
 // ----------------- SAVING PERSONAL RECORDING TO DATABASE END
 

 const endPersonalEmbed = new Discord.MessageEmbed().setTitle(`Your performance was amazing ! Review it here :D`)
 endPersonalEmbed.setColor('#9400D3')
 endPersonalEmbed.setThumbnail(`https://media.discordapp.net/attachments/730811581046325348/745381641324724294/vinyl.png`)
 endPersonalEmbed.addField(`1
-
Conversion Funnel Optimisation : 10 Ways to Convert More
24 janvier 2024, par Erin