How to render lossless video by Jibri - FFMPEG

Hi,

I am trying to set a custom ffmpeg command for rendering lossless video. By researching, I found that -crf args is used for lossless video. (-crf 0). LINK.

But when I set this args in /usr/local/bin/ffmpeg, Jibri can not record. Here is the log:
2022-05-18 16:58:44.861 INFO: [262] org.jitsi.jibri.util.JibriSubprocess.log() 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:bsnoop -acodec aac -strict -2 -ar 44100 -b:a 128k -af aresample=async=1 -c:v libx264 -preset veryfast -profile:v main -level 3.1 -pix_fmt yuv420p -r 30 -crf 25 -g 60 -tune zerolatency -f mp4 /config/recordings/eysijnjavuygjziw/1-luongdnt_2022-05-18-16-58-39.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:bsnoop, -acodec, aac, -strict, -2, -ar, 44100, -b:a, 128k, -af, aresample=async=1, -c:v, libx264, -preset, veryfast, -profile:v, main, -level, 3.1, -pix_fmt, yuv420p, -r, 30, -crf, 25, -g, 60, -tune, zerolatency, -f, mp4, /config/recordings/eysijnjavuygjziw/1-luongdnt_2022-05-18-16-58-39.mp4])
2022-05-18 16:58:49.876 FINE: [18] org.jitsi.jibri.util.ProcessStatePublisher.log() Process ffmpeg hasn’t written in 2 seconds, publishing periodic update
2022-05-18 16:58:49.877 INFO: [266] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.log() Ffmpeg quit abruptly. Last output line: Conversion failed!
2022-05-18 16:58:49.877 INFO: [266] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.log() Ffmpeg capturer transitioning from state Starting up to Error: QuitUnexpectedly SESSION Conversion failed!
2022-05-18 16:58:49.877 INFO: [266] org.jitsi.jibri.service.impl.FileRecordingJibriService.log() File recording service transitioning from state Starting up to Error: QuitUnexpectedly SESSION Conversion failed!
2022-05-18 16:58:49.878 INFO: [266] org.jitsi.jibri.api.xmpp.XmppApi.log() Current service had an error Error: QuitUnexpectedly SESSION Conversion failed!, sending error iq
2022-05-18 16:58:49.884 FINE: [266] org.jitsi.jibri.statsd.JibriStatsDClient.log() Incrementing statsd counter: stop:recording
2022-05-18 16:58:49.885 INFO: [266] org.jitsi.jibri.JibriManager.log() Stopping the current service
2022-05-18 16:58:49.885 INFO: [266] org.jitsi.jibri.service.impl.FileRecordingJibriService.log() Stopping capturer
2022-05-18 16:58:49.887 INFO: [266] org.jitsi.jibri.util.JibriSubprocess.log() Stopping ffmpeg process
2022-05-18 16:58:49.898 INFO: [266] org.jitsi.jibri.util.JibriSubprocess.log() ffmpeg exited with value 1
2022-05-18 16:58:49.898 INFO: [266] org.jitsi.jibri.service.impl.FileRecordingJibriService.log() Quitting selenium
2022-05-18 16:58:49.913 INFO: [266] org.jitsi.jibri.service.impl.FileRecordingJibriService.log() Participants in this recording:
2022-05-18 16:58:49.929 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Leaving call and quitting browser
2022-05-18 16:58:49.929 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Recurring call status checks cancelled
2022-05-18 16:58:49.941 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Got 4 log entries for type browser
2022-05-18 16:58:49.958 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Got 465 log entries for type driver
2022-05-18 16:58:50.037 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Got 0 log entries for type client
2022-05-18 16:58:50.040 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Leaving web call
2022-05-18 16:58:50.272 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Quitting chrome driver
2022-05-18 16:58:50.465 INFO: [266] org.jitsi.jibri.selenium.JibriSelenium.log() Chrome driver quit

How can I set -crf 0 and record lossless video?

Many thanks!

Can you share your /usr/local/bin/ffmpeg

1 Like

I suppose you mean recording?

Could it be possible that it’s so slow recording in that mode that our checks get tripped thinking the process is stuck?

1 Like

I fixed it. So many thanks! <3