FFmpeg configuration

hello
I’m trying to stream on twitch by sending a 6000k bitrate (maxrate), but the codec doesn’t seem to take my settings into account. I end up with a bitrate of 10,000k and twitch crashes because I’m sending it too much bitrate.
Do you have any idea why?
I’m on Jetson nano 4gb

logs :

● BeyondStream.service - BeyondSpeedRuns
Loaded: loaded (/etc/systemd/system/BeyondStream.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-05-25 18:59:37 CEST; 2min 30s ago
Main PID: 12147 (node)
Tasks: 48 (limit: 4181)
CGroup: /system.slice/BeyondStream.service
├─12147 /home/tchoune/.nvm/versions/node/v16.20.0/bin/node /home/tchoune/Twitch/Speedrun/server.js
└─12193 ffmpeg -nostdin -f concat -safe 0 -i concat:playlist.txt|control.txt -i images/logo.png -filter_complex [0:v]scale=1920:-1,fps=60[video]; [1:v]scale=200:-1[logo]; [video][logo]overlay=W

Video stderr: ffmpeg version 549430e Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
configuration: --enable-nvmpi --enable-libfreetype

Video stderr: libavutil 58. 2.100 / 58. 2.100
libavcodec 60. 3.100 / 60. 3.100
libavformat 60. 3.100 / 60. 3.100
libavdevice 60. 1.100 / 60. 1.100
libavfilter 9. 3.100 / 9. 3.100
libswscale 7. 1.100 / 7. 1.100

Video stderr: libswresample 4. 10.100 / 4. 10.100

Video stderr: [mov,mp4,m4a,3gp,3g2,mj2 @ 0x55a215a450] Auto-inserting h264_mp4toannexb bitstream filter

Video stderr: Input #0, concat, from ‘concat:playlist.txt|control.txt’:
Duration: N/A, start: 0.000000, bitrate: 1244 kb/s

Video stderr: Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 1116 kb/s, 30 fps, 30 tbr, 15360 tbn
Metadata:
creation_time : 2023-04-12T02:28:45.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 04/11/2023.
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
Metadata:
creation_time : 2023-04-12T02:28:45.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 04/11/2023.
vendor_id : [0][0][0][0]

Video stderr: Input #1, png_pipe, from ‘images/logo.png’:
Duration: N/A, bitrate: N/A

Video stderr: Stream #1:0: Video: png, rgba(pc), 4000x3001 [SAR 5669:5669 DAR 4000:3001], 25 fps, 25 tbr, 25 tbn

Video stderr: Stream mapping:
Stream #0:0 (h264) → scale:default (graph 0)
Stream #1:0 (png) → scale:default (graph 0)
drawtext:default (graph 0) → Stream #0:0 (h264_nvmpi)

Video stderr: Stream #0:1#0:1 (aac (native) → aac (native))

Video stderr: NvMMLiteOpen : Block : BlockType = 4

Video stderr: ===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4

Video stdout: Opening in BLOCKING MODE
875967048
842091865

Video stderr: H264: Profile = 100, Level = 51

Video stderr: NVMEDIA_ENC: bBlitMode is set to TRUE

Video stderr: NvMMLiteOpen : Block : BlockType = 4

Video stderr: ===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4

Video stdout: Got 0 size buffer in capture
Opening in BLOCKING MODE
875967048
842091865

Video stderr: H264: Profile = 100, Level = 51

Video stderr: NVMEDIA_ENC: bBlitMode is set to TRUE

Video stderr: Output #0, flv, to ‘rtmp://live.twitch.tv/app/live_910416467_O6jOr7am0Lzot0qHfTdX2YoUuUVfF3’:
Metadata:
encoder : Lavf60.3.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 2000 kb/s, 60 fps, 1k tbn
Metadata:
encoder : Lavc60.3.100 h264_nvmpi
Stream #0:1(und): Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 160 kb/s
Metadata:
creation_time : 2023-04-12T02:28:45.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 04/11/2023.
vendor_id : [0][0][0][0]
encoder : Lavc60.3.100 aac

Mai 25 19:02:03 tchoune-desktop node[12147]: Video stderr: frame=17252 fps=120 q=-0.0 size= 280988kB time=00:04:47.64 bitrate=8002.3kbits/s speed= 2x
Mai 25 19:02:04 tchoune-desktop node[12147]: Video stderr: frame=17311 fps=120 q=-0.0 size= 282092kB time=00:04:48.57 bitrate=8007.9kbits/s speed= 2x
Mai 25 19:02:04 tchoune-desktop node[12147]: Video stderr: frame=17370 fps=120 q=-0.0 size= 283079kB time=00:04:49.50 bitrate=8010.1kbits/s speed= 2x
Mai 25 19:02:05 tchoune-desktop node[12147]: Video stderr: frame=17435 fps=120 q=-0.0 size= 284108kB time=00:04:50.56 bitrate=8009.9kbits/s speed= 2x
Mai 25 19:02:05 tchoune-desktop node[12147]: Video stderr: frame=17499 fps=120 q=-0.0 size= 285082kB time=00:04:51.63 bitrate=8008.0kbits/s speed= 2x
Mai 25 19:02:06 tchoune-desktop node[12147]: Video stderr: frame=17555 fps=120 q=-0.0 size= 286108kB time=00:04:52.56 bitrate=8011.1kbits/s speed= 2x
Mai 25 19:02:06 tchoune-desktop node[12147]: Video stderr: frame=17611 fps=120 q=-0.0 size= 287427kB time=00:04:53.50 bitrate=8022.5kbits/s speed= 2x
Mai 25 19:02:07 tchoune-desktop node[12147]: Video stderr: frame=17671 fps=120 q=-0.0 size= 288588kB time=00:04:54.61 bitrate=8024.4kbits/s speed= 2x
Mai 25 19:02:07 tchoune-desktop node[12147]: Video stderr: frame=17737 fps=120 q=-0.0 size= 289672kB time=00:04:55.60 bitrate=8027.7kbits/s speed= 2x
Mai 25 19:02:08 tchoune-desktop node[12147]: Video stderr: frame=17803 fps=120 q=-0.0 size= 290722kB time=00:04:56.70 bitrate=8026.9kbits/s speed= 2x

My commande :

ffmpegVideo = spawn('ffmpeg', [
        '-threads',4,
        '-nostdin',
        '-f', 'concat', '-safe', '0',
        '-i', 'concat:playlist.txt|control.txt',
        '-i', 'images/logo.png',
        '-filter_complex', '[0:v]scale=1920:-1[video]; [1:v]scale=200:-1[logo]; [video][logo]overlay=W-w-5:5[main]; [main]drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf:textfile=runner....
        '-r', '60',
        '-g', '120',
        '-c:v', 'h264_nvmpi',
        '-preset', 'slow', 
         '-profile:v', 'high',
         '-pix_fmt', 'yuv420p',
        '-bit_rate', '5M',
        '-bufsize', '10M',
         '-rc', 'cbr', 
         '-acodec', 'aac',
         '-b:a', '160k',
         '-ac', '2',
         '-f', 'flv',
         `rtmp://live.twitch.tv/app/${twitchStreamKey}`
]);

Someone have a good configuration for 1080p60fps via twitch ?

Hi,
Do you use jocover’s contribution? In our package, we support hardware decoding. It looks like you are using hardware encoding.

The packages are mentioned in Jetson Nano FAQ

Q: Is hardware acceleration enabled in ffmpeg?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.