I'm trying to record 8 sources (3 Video + 5 audio) simultaneously and
synchronized, however I can't seem to get it to transcode real time in one
instance.
Sample command:
ffmpeg -y `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M
-video_size 3440x1440 -framerate 100 `
-pixel_format nv12 -i video="Video (Pro Capture)":audio="ADAT (3+4) (RME
Fireface UC)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M
-video_size 3840x2160 -framerate 60 `
-pixel_format nv12 -i video="AVerMedia HD Capture GC573
1":audio="SPDIF/ADAT (1+2) (RME Fireface UC)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M
-video_size 1920x1080 -framerate 60 `
-pixel_format yuv420p -i video="Game Capture HD60 Pro (Video)
(#01)":audio="Game Capture HD60 Pro (Audio) (#01)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M -i
audio="Analog (1+2) (RME Fireface UC)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M -i
audio="ADAT (5+6) (RME Fireface UC)" `
-c:v h264_nvenc -preset: llhp -pix_fmt nv12 -rc-lookahead 100 -b:v 288M
-minrate 288M -maxrate 288M -bufsize 288M `
-c:a aac -ar 44100 -b:a 384k -vsync 1 -max_muxing_queue_size `
-map 0:0,0:1 -map 0:1 -map 1:0,1:1 -map 1:1 -map 2:0,2:1 -map 2:1 -map 3
-map 4 `
C:\Users\djcim\Videos\FFmpeg\FFmpeg.ts
Basically the recording starts with "speed" around .5x and slowly creeps
its way towards 1x, meanwhile my ram usage is ever increasing. Once it gets
to around .9-.95x it hits a standstill and eventually my ram caps out and
the recording speed tanks, frames start dropping, and my whole system slows
down. I have 32GB of system memory, and by the end of this process this
single instance of FFmpeg is using 28GB+! I'm not quite sure how this is
possible when -rtbufsize is only set to 2GB per source (11GB total), what
is filling up all that space?
If I remove any one of the inputs, even just an audio sources linked to one
of the capture cards, the recording will hit real time transcoding before
my RAM is completely saturated (with a peak usage of 16GB). When 1x speed
is achieved, which takes about 1 minute, my RAM usage slowly decreases
before it plateaus around 9GB as the recording continues to transcode real
time with no issues. So basically "it works" when I remove even just one
audio or video source, though it still takes a hot second to get up to
realtime recording which I find odd. Lowing bitrate of audio and or video
also affects transcoding speed but only if I put it extremely low, like 1M
per source as opposed to 288M. In terms of raw throughput this should have
a larger effect than simply removing one of the audio streams, but it
doesn't
Separating the outputs to their own files like this seemingly heeds no
beneficial effect:
ffmpeg -y `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M
-video_size 3440x1440 -framerate 100 `
-pixel_format nv12 -i video="Video (Pro Capture)":audio="ADAT (3+4) (RME
Fireface UC)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M
-video_size 3840x2160 -framerate 60 `
-pixel_format nv12 -i video="AVerMedia HD Capture GC573
1":audio="SPDIF/ADAT (1+2) (RME Fireface UC)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M
-video_size 1920x1080 -framerate 60 `
-pixel_format yuv420p -i video="Game Capture HD60 Pro (Video)
(#01)":audio="Game Capture HD60 Pro (Audio) (#01)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M -i
audio="Analog (1+2) (RME Fireface UC)" `
-thread_queue_size -indexmem -f dshow -rtbufsize 2147.48M -i
audio="ADAT (5+6) (RME Fireface UC)" `
-thread_queue_size -indexmem -r 25 -f lavfi -rtbufsize 2147.48M
-i color=c=black:s=256x120 `
-map 0:0,0:1 -map 0:1 -c:v h264_nvenc -preset: llhp -r 100 -rc-lookahead
100 -pix_fmt nv12 -b:v 288M -minrate 288M `
-maxrate 288M -bufsize 288M -c:a aac -ar 44100 -b:a 384k -vsync 1
-max_muxing_queue_size `
C:\Users\djcim\Videos\FFmpeg\MW\MW.ts `
-map 1:0,1:1 -map 1:1 -c:v h264_nvenc -preset: llhp -r 60 -rc-lookahead 60
-pix_fmt nv12 -b:v 288M -minrate 288M `
-maxrate 288M -bufsize 288M -c:a aac -ar 44100 -b:a 192k -vsync 1
-max_muxing_queue_size `
C:\Users\djcim\Videos\FFmpeg\AM\AM.ts `
-map 2:0,2:1 -map 2:1 -c:v h264_nvenc -preset: llhp -r 60 -rc-lookahead 60
-pix_fmt yuv420p -b:v 288M -minrate 288M `
-maxrate 288M -bufsize 288M -c:a aac -ar 44100 -b:a 384k -vsync 1
-max_muxing_queue_size `
C:\Users\djcim\Videos\FFmpeg\EL\EL.ts `
-map 5,3 -map 3 -c:v h264_nvenc -preset: llhp -r 25 -rc-lookahead 25
-pix_fmt nv12 -b:v 16K -minrate 16K `
-maxrate 16K -bufsize 16K -c:a aac -ar 44100 -b:a 384k -vsync 1
-max_muxing_queue_size `
C:\Users\djcim\Videos\FFmpeg\CP\CP.ts `
-map 5,4 -map 4 -c:v h264_nvenc -preset: llhp -r 25 -rc-lookahead 25
-pix_fmt nv12 -b:v 16K -minrate 16K `
-maxrate 16K -bufsize 16K -c:a aac -ar 44100 -b:a 384k -vsync 1
-max_muxing_queue_size `
C:\Users\djcim\Videos\FFmpeg\SB\SB.ts