Jibri works but save empty files

The recording creates a file in srv/recordings (random) but the file is empty (es: test-05-05-2020.mp4). What could be the problem?

Please post your jibri logs

/var/log/jitsi/jibri/log.0.txt & browser0.txt

browser.0.txt (3.1 MB)

log.0.txt (73.8 KB)

Thanks for your prompt reply!

The program creating the file is ffmpeg,
check the ffmpeg log in /var/log/jitsi/jibri/ffmpeg.0.txt
there is a known bug if jibri is started using java 11 instead of java 8 then jibri fail to stop ffmpeg gracefully (because it is unable to figure out the pid used by ffmpeg) and fallback to forcefully stop the execution. This will cause a corrupt file that looks empty when viewed because it is missing the correct mp4 ending.

how do i use java 8 instead 11?

sudo update-alternatives --config java

select java 8

OK, thanks

There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64/bin/java
Nothing to configure.

ffmpeg.0.txt (51.7 KB)

the ffmpeg log file show that ffmpeg itself is OK, ffmpeg it start at 05:48:22

2020-05-05 05:48:22.766 INFO: [387] ffmpeg.call() ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg developers

ffmpeg conencts to the X11 screen for video and connects to the system alsa audio source.

2020-05-05 05:48:22.899 INFO: [387] ffmpeg.call() Input #0, x11grab, from ':0.0+0,0':
2020-05-05 05:48:22.899 INFO: [387] ffmpeg.call()   Duration: N/A, start: 1588654102.838176, bitrate: N/A
2020-05-05 05:48:22.899 INFO: [387] ffmpeg.call()     Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
2020-05-05 05:48:22.899 INFO: [387] ffmpeg.call() Guessed Channel Layout for Input Stream #1.0 : stereo
2020-05-05 05:48:23.001 INFO: [387] ffmpeg.call() Input #1, alsa, from 'plug:cloop':
2020-05-05 05:48:23.001 INFO: [387] ffmpeg.call()   Duration: N/A, start: 1588654102.516527, bitrate: 1536 kb/s
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call()     Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call() Stream mapping:
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call()   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call()   Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call() Press [q] to stop, [?] for help
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call() [libx264 @ 0x55bc87774fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
2020-05-05 05:48:23.002 INFO: [387] ffmpeg.call() [libx264 @ 0x55bc87774fc0] profile Main, level 3.1
2020-05-05 05:48:24.003 INFO: [387] ffmpeg.call() [libx264 @ 0x55bc87774fc0] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
2020-05-05 05:48:24.003 INFO: [387] ffmpeg.call() Output #0, mp4, to '/srv/recordings/vatcbgvqmpopgyvk/test01_2020-05-05-05-48-17.mp4':

2020-05-05 05:48:40.925 INFO: [387] ffmpeg.call() frame=  115 fps=6.5 q=17.0 size=     256kB time=00:00:03.83 bitrate= 547.2kbits/s speed=0.215x    
2020-05-05 05:48:42.930 INFO: [387] ffmpeg.call() [alsa @ 0x55bc8774a6c0] ALSA buffer xrun.
2020-05-05 05:48:43.003 INFO: [387] ffmpeg.call() frame=  116 fps=5.9 q=17.0 size=     256kB time=00:00:03.83 bitrate= 547.2kbits/s speed=0.194x    
2020-05-05 05:48:44.977 INFO: [387] ffmpeg.call() [alsa @ 0x55bc8774a6c0] ALSA buffer xrun.

and after 20 seconds recording later the recording stops with a generated filesize of 256kB.
The ALSA buffer xrun looks like an issue, that ffmpeg is unable to capture the audio.

I rechecked the jibri log and jibri thinks the same:

2020-05-05 05:48:22.188 INFO: [383] org.jitsi.jibri.service.impl.FileRecordingJibriService.invoke() Selenium joined the call, starting the capturer
2020-05-05 05:48:22.503 INFO: [383] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.launch() Starting ffmpeg with command ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 30 -s 1280x720 -thread_queue_size 4096 -i :0.0+0,0 -f alsa -thread_queue_size 4096 -i plug:cloop -acodec aac -strict -2 -ar 44100 -c:v libx264 -preset veryfast -profile:v main -level 3.1 -pix_fmt yuv420p -r 30 -crf 25 -g 60 -tune zerolatency -f mp4 /srv/recordings/vatcbgvqmpopgyvk/test01_2020-05-05-05-48-17.mp4 ([ffmpeg, -y, -v, info, -f, x11grab, -draw_mouse, 0, -r, 30, -s, 1280x720, -thread_queue_size, 4096, -i, :0.0+0,0, -f, alsa, -thread_queue_size, 4096, -i, plug:cloop, -acodec, aac, -strict, -2, -ar, 44100, -c:v, libx264, -preset, veryfast, -profile:v, main, -level, 3.1, -pix_fmt, yuv420p, -r, 30, -crf, 25, -g, 60, -tune, zerolatency, -f, mp4, /srv/recordings/vatcbgvqmpopgyvk/test01_2020-05-05-05-48-17.mp4])
2020-05-05 05:48:23.996 INFO: [386] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegStateMachineStateChange() Ffmpeg capturer transitioning from state Starting up to Running
2020-05-05 05:48:23.997 INFO: [386] org.jitsi.jibri.service.impl.FileRecordingJibriService.onServiceStateChange() File recording service transitioning from state Starting up to Running
2020-05-05 05:48:23.998 INFO: [386] org.jitsi.jibri.api.xmpp.XmppApi.invoke() Current service started up successfully, sending on iq <iq to='jibribrewery@internal.auth.videorete.mimorg.eu/focus' id='3N1jQ-799' type='set'><jibri xmlns='http://jitsi.org/protocol/jibri' status='on'/></iq>
2020-05-05 05:48:38.960 INFO: [349] org.jitsi.jibri.selenium.JibriSelenium.run() Jibri client receive bitrates: {}, all clients muted? false
2020-05-05 05:48:47.524 FINE: [349] org.jitsi.jibri.util.ProcessStatePublisher.ffmpeg.invoke() Process ffmpeg hasn't written in 2 seconds, publishing periodic update
2020-05-05 05:48:47.544 INFO: [385] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegProcessUpdate() Ffmpeg quit abruptly.  Last output line: [alsa @ 0x55bc8774a6c0] ALSA buffer xrun.
2020-05-05 05:48:47.552 INFO: [385] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.onFfmpegStateMachineStateChange() Ffmpeg capturer transitioning from state Running to Error: SESSION Ffmpeg failed to start
2020-05-05 05:48:47.560 INFO: [385] org.jitsi.jibri.service.impl.FileRecordingJibriService.onServiceStateChange() File recording service transitioning from state Running to Error: SESSION Ffmpeg failed to start
2020-05-05 05:48:47.572 INFO: [385] org.jitsi.jibri.api.xmpp.XmppApi.invoke() Current service had an error, sending error iq <iq to='jibribrewery@internal.auth.videorete.mimorg.eu/focus' id='3N1jQ-801' type='set'><jibri xmlns='http://jitsi.org/protocol/jibri' status='off' failure_reason='error'/></iq>
2020-05-05 05:48:47.579 FINE: [385] org.jitsi.jibri.statsd.JibriStatsDClient.incrementCounter() Incrementing statsd counter: stop:recording
2020-05-05 05:48:47.585 INFO: [385] org.jitsi.jibri.JibriManager.stopService() Stopping the current service
2020-05-05 05:48:47.587 INFO: [385] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Stopping capturer
2020-05-05 05:48:47.589 INFO: [385] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() Stopping ffmpeg process

jibri asks the same question are all participants muted or is audio capture broken?

so i checked the browser log and it are unable to connect to the virtual ALSA soundcard on the server:

2020-05-05 05:49:19.485 INFO: [374] browser.leaveCallAndQuitBrowser() [2020-05-05T05:49:19+0100] [WARNING] /libs/lib-jitsi-meet.min.js?v=4074 9:26307 "2020-05-05T04:49:17.709Z" "[modules/RTC/RTCUtils.js]" "Failed to get access to local media.  NotReadableError: Could not start audio source [object Object] "
2020-05-05 05:49:19.485 INFO: [374] browser.leaveCallAndQuitBrowser() [2020-05-05T05:49:19+0100] [WARNING] libs/lib-jitsi-meet.min.js?v=4074 0:124690 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 rtc.audio_output_device_changed listeners added. Use emitter.setMaxListeners() to increase limit
    at u (libs/lib-jitsi-meet.min.js?v=4074:1:124432)
    at a.addListener (/libs/lib-jitsi-meet.min.js?v=4074:1:126702)
    at z.addListener (/libs/lib-jitsi-meet.min.js?v=4074:1:133384)
    at new y (libs/lib-jitsi-meet.min.js?v=4074:10:11710)
    at libs/lib-jitsi-meet.min.js?v=4074:1:100369
    at Array.map (<anonymous>)
    at R (libs/lib-jitsi-meet.min.js?v=4074:1:100223)
    at libs/lib-jitsi-meet.min.js?v=4074:1:101747
2020-05-05 05:49:19.486 INFO: [374] browser.leaveCallAndQuitBrowser() [2020-05-05T05:49:19+0100] [SEVERE] libs/lib-jitsi-meet.min.js?v=4074 9:26307 "2020-05-05T04:49:18.234Z" "[modules/detection/ActiveDeviceDetector.js]" "Failed to acquire audio device with error: " undefined

so this is the error:
the crome browser used by jibri fails to open the audio device on the server. unfortuanlly, I do not know how to solve it.

In any case, THANK YOU. You were very kind. I try to install the server again

this is the clue…

what does lsmod | grep snd_aloop on the jibri server show?

snd_aloop 28672 0
snd_pcm 114688 1 snd_aloop
snd 94208 3 snd_timer,snd_aloop,snd_pcm

did you update your jibri server off-late?

can you please run apt -y install linux-image-extra-virtual & try again?

`linux-image-extra-virtual there is not in Debian 10

i´m facing the same issue, did you find a solution?

hello @malpa,

What is your Linux distribution and which release?
And the output of theese commands?

uname -a
lsmod | grep snd_aloop
update-alternatives --display java

And the log file:
/var/log/jitsi/jibri/ffmpeg.0.txt

My Linux distro is Debian 10.4
uname -a
Linux 4.19.0-9-amd64 #1 SMP Debian 4.19.118-2 (2020-04-29) x86_64 GNU/Linux

lsmod | grep snd_aloop
snd_aloop 28672 1
snd_pcm 114688 1 snd_aloop
snd 94208 5 snd_timer,snd_aloop,snd_pcm

update-alternatives --display java
java - auto mode
link best version is /usr/lib/jvm/java-11-openjdk-amd64/bin/java
link currently points to /usr/lib/jvm/java-11-openjdk-amd64/bin/java
link java is /usr/bin/java
slave java.1.gz is /usr/share/man/man1/java.1.gz
/usr/lib/jvm/java-11-openjdk-amd64/bin/java - priority 1111
slave java.1.gz: /usr/lib/jvm/java-11-openjdk-amd64/man/man1/java.1.gz

ffmpeg.0.txt
2020-06-02 12:56:38.907 INFO: [56] ffmpeg.call() ffmpeg version 4.1.4-1~deb10u1 Copyright © 2000-2019 the FFmpeg developers
2020-06-02 12:56:38.907 INFO: [56] ffmpeg.call() built with gcc 8 (Debian 8.3.0-6)
2020-06-02 12:56:38.975 INFO: [56] ffmpeg.call() configuration: --prefix=/usr --extra-version=‘1~deb10u1’ --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-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
2020-06-02 12:56:38.975 INFO: [56] ffmpeg.call() libavutil 56. 22.100 / 56. 22.100
2020-06-02 12:56:38.975 INFO: [56] ffmpeg.call() libavcodec 58. 35.100 / 58. 35.100
2020-06-02 12:56:38.975 INFO: [56] ffmpeg.call() libavformat 58. 20.100 / 58. 20.100
2020-06-02 12:56:38.976 INFO: [56] ffmpeg.call() libavdevice 58. 5.100 / 58. 5.100
2020-06-02 12:56:38.976 INFO: [56] ffmpeg.call() libavfilter 7. 40.101 / 7. 40.101
2020-06-02 12:56:38.976 INFO: [56] ffmpeg.call() libavresample 4. 0. 0 / 4. 0. 0
2020-06-02 12:56:38.976 INFO: [56] ffmpeg.call() libswscale 5. 3.100 / 5. 3.100
2020-06-02 12:56:38.976 INFO: [56] ffmpeg.call() libswresample 3. 3.100 / 3. 3.100
2020-06-02 12:56:38.976 INFO: [56] ffmpeg.call() libpostproc 55. 3.100 / 55. 3.100
2020-06-02 12:56:38.977 INFO: [56] ffmpeg.call() [x11grab @ 0x5650b4285f40] Stream #0: not enough frames to estimate rate; consider increasing probesize
2020-06-02 12:56:38.977 INFO: [56] ffmpeg.call() Input #0, x11grab, from ‘:0.0+0,0’:
2020-06-02 12:56:38.977 INFO: [56] ffmpeg.call() Duration: N/A, start: 1591113398.930717, bitrate: N/A
2020-06-02 12:56:38.977 INFO: [56] ffmpeg.call() Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 30 fps, 1000k tbr, 1000k tbn, 1000k tbc
2020-06-02 12:56:38.977 INFO: [56] ffmpeg.call() Guessed Channel Layout for Input Stream #1.0 : stereo
2020-06-02 12:56:38.986 INFO: [56] ffmpeg.call() Input #1, alsa, from ‘plug:cloop’:
2020-06-02 12:56:38.986 INFO: [56] ffmpeg.call() Duration: N/A, start: 1591113398.593778, bitrate: 1536 kb/s
2020-06-02 12:56:38.986 INFO: [56] ffmpeg.call() Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
2020-06-02 12:56:38.986 INFO: [56] ffmpeg.call() Stream mapping:
2020-06-02 12:56:38.986 INFO: [56] ffmpeg.call() Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
2020-06-02 12:56:38.989 INFO: [56] ffmpeg.call() Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
2020-06-02 12:56:38.989 INFO: [56] ffmpeg.call() Press [q] to stop, [?] for help
2020-06-02 12:56:38.989 INFO: [56] ffmpeg.call() [libx264 @ 0x5650b42bb580] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
2020-06-02 12:56:38.990 INFO: [56] ffmpeg.call() [libx264 @ 0x5650b42bb580] profile Main, level 3.1
2020-06-02 12:56:39.990 INFO: [56] ffmpeg.call() [libx264 @ 0x5650b42bb580] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=8 lookahead_threads=8 sliced_threads=1 slices=8 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=60 keyint_min=6 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
2020-06-02 12:56:39.991 INFO: [56] ffmpeg.call() Output #0, mp4, to ‘/mnt/recordings/vffhyhfvnulkppti/malpa_2020-06-02-12-56-36.mp4’:
2020-06-02 12:56:39.991 INFO: [56] ffmpeg.call() Metadata:
2020-06-02 12:56:39.991 INFO: [56] ffmpeg.call() encoder : Lavf58.20.100
2020-06-02 12:56:39.991 INFO: [56] ffmpeg.call() Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1280x720, q=-1–1, 30 fps, 15360 tbn, 30 tbc
2020-06-02 12:56:39.991 INFO: [56] ffmpeg.call() Metadata:
2020-06-02 12:56:39.991 INFO: [56] ffmpeg.call() encoder : Lavc58.35.100 libx264
2020-06-02 12:56:39.992 INFO: [56] ffmpeg.call() Side data:
2020-06-02 12:56:39.992 INFO: [56] ffmpeg.call() cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
2020-06-02 12:56:39.992 INFO: [56] ffmpeg.call() Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
2020-06-02 12:56:39.992 INFO: [56] ffmpeg.call() Metadata:
2020-06-02 12:56:39.992 INFO: [56] ffmpeg.call() encoder : Lavc58.35.100 aac
2020-06-02 12:56:39.992 INFO: [56] ffmpeg.call() frame= 14 fps=0.0 q=26.0 size= 0kB time=00:00:00.44 bitrate= 0.9kbits/s speed=0.861x
2020-06-02 12:56:40.993 INFO: [56] ffmpeg.call() frame= 29 fps= 28 q=25.0 size= 0kB time=00:00:00.95 bitrate= 0.4kbits/s speed=0.933x
2020-06-02 12:56:40.993 INFO: [56] ffmpeg.call() frame= 45 fps= 29 q=24.0 size= 0kB time=00:00:01.46 bitrate= 0.3kbits/s speed=0.961x

forget it, i´ve change to java 8 and it’s working now

1 Like